Original Document "fileutil.wpd" from B. Fedirchuk: June 10, 1998
SCRC FILE UTILITIES
SPECIFICALLY MADE FOR MANAGING DATA FILES
appendrun merges two run files into a single file.
asc2run converts an ascii file of voltage values into a run file.
axon2run converts data in axotape format to scrc run file format.
copyrun duplicates a run file and saves it under a different name.
dumprun displays the run header and trace data as ascii
lsrun displays the names of the run files and their run headers (*.txt files)
mergelo merge layout files into a single file
removerun there is no removerun command! Use rm. show me some UNIX
renamerun renames an existing run file
rmendfrm removes the last frame from a run file
rmtfetch for "fetching" entire directory structures from another computer or disk to the local system
can be done on the same computer)
salvagerun attempts to salvage an incomplete run from an aborted capture
trimfrms makes a copy of a run file while deleting data from each trace in the frames
-s specifies the number of columns to skip for each line of input. You may skip the first n of columns, but
once those columns are skipped, the sampled columns must be contiguous. (default is 0)
-c specifies number of channels. Your ascii file must have the appropriate number of columns. (default is 1)
-t specifies a particular character as separating the columns. (default is to consider: space(s) (therefore tab(s) are also seen as separators), comma, parentheses, slash, colon, or semicolon as a column separator - and therefore skip over repeated occurances) If you have columns separated by another character, it must be specified with the "-t character" option.
-m specifies a gain multiplier used to bring the ascii voltage values to a desirable range of A/D units. (the default is 1 and means and input range of ± 0.160 V: therefore: -0.160 V < ascii values < +0.160 V) Specifying "-m 0.01" would mean that ascii values could be between ± 16 V.
-f specifies the sampling frequency of the ascii samples (default is 10,000 Hz)
-d specifies the sampling divisors for output waveforms. Divisors must be within quotes and separated by spaces with the whole list given as one arguement. (e.g. -d "1 1 2 1") This would mean that for the 3rd data column of the ascii file, only every 2nd point would be used to construct the waveform. Although this halves the sampling rate for that waveform, the original ascii file still must have the same number of samples as the other columns. (default is 1 for all input channels)
*warning: if no destinationrun name is given, it will remove the .dat suffix from the original Axon file and
write a runfile with the same prefix but an .frm suffix. This will silently overwrite another .frm file with the
same name if one existed.
If you give the name of an existing run, it will not be overwritten. You must first remove all of the
destination's files if you want to replace it with a copy of the source. Don't specify a directory name as the
destination: it won't tack on the source file name to the destination directory, like cp does. If you want to
copy several run files to another directory, keeping the same names, use cp as in this example:
cp cell5* ../mydir.
With the -f option, dumprun will display (dump out) the frame header for each frame, following the run header contents. With the -t , it will dump out not only the frame headers, but also the trace data within each frame, as decimal integer values representing the raw A/D levels recorded. This gives an ASCII text representation of the entire frame file. By default, the trace data will be presented as a single column, one number per line. A greater number of columns can be selected with the -c option. The samples should be read along rows rather than down the columns.
dumprun can be used to move trace data into a spreadsheet for further analysis. For example, create an average of several frames and save it (Bins-save) as "myfile". Then use dumprun to create a new file with the data points as integers. Eg.
dumprun -t myfile > temp.prn
Now read "temp.prn" into your favourite spreadsheet as an ascii file
Merglo merges all of the specified layout files into one combined layout, which it puts out on its standard output. It compares the headers of all the given layout files to make sure they were all set up for the same page size.
No changes are made to the panels' sizes or placements. If a panel appears at the same location in two layout
files, they will overlap in the merged layout file.
There is no removerun command! Use the UNIX command "rm" (carefully!!). You can easily remove all of the files making up one run by typing "rm runname.???". (This will also remove associated parameter files.) show me basic UNIX commands
Salvagerun can be used to recover data from a runfile which is incomplete, such as the run file you are left with when you run out of disk space during a data capture. The runfile argument can be given with or without the .frm suffix.
Before actually fixing the file, salvagerun makes sure the run header is complete and usable. Since the run may not have been validated by the capture program, by placing the correct run ID in the header, other checks are needed to ensure that the run is valid. It makes sure that the header size, the averaging type, the sampling rate, the window duration, the frame size, and the sampling rate divisors all fall within acceptable limits, and are mutually consistent. If any discrepancy is found, it will not be able to salvage the run, and it will indicate which parameter(s) failed the test.
Next, salvagerun will compare the actual lengths of the waveform files against each other, and against the expected run length. It will warn you if any waveform files are missing. It will then give you a summary of the changes that are required to the runfile. These caninclude fixing the run ID, adjusting the run length and number of frames, padding out short waveform files with zeroes, and clearing the waveform divisors for missing waveform files. If it finds nothing to fix, it will say so and quit.
After these consistency checks and summary, salvagerun asks you if it is OK to proceed. Type an N if you decide to cancel the operation; the run will remain unchanged. If you type a Y, or hit SPACE or RETURN, salvagerun will update the run header with all the necessary corrections, then pad out the waveform files that are too short. The padding will appear as a straight line at the level of 0 A/D units. This portion of the waveforms will obviously be useless in any analysis, but at least the analysis program will let you look at the run, and analyse the valid data up to the point where the padding began. Salvagerun makes no attempt to correct or replace the run description file (.txt), nor the frame description file (.frd); you will have to update these text files by hand, if there is any problem with them.
The -f option can be used to change the sampling frequency as recorded in the run header, if it is incorrect. If
the given freq is a number, that number will replace the current value. If it is given as a slash ( / ) followed
immediately by a number (in the same argument), the current frequency is divided by the given number. If just
a slash, with no following number is given, the current frequency is divided by the number of waveforms in the
run. This latter correction is to fix a problem introduced with an old alpha release of the axon2run program,
which incorrectly set the sampling frequency.
Trimfrms copies all of the files making up the run of the given source name, to the given destination name. These files are the frame file (.frm), the run description file (.txt), the frame description file (.frd), and the waveform files (.wnn). Any associated analysis parameter file or waveform parameter files will not be copied. The name arguments can be given with or without the .frm suffix. While copying the frame file, trimfrms will trim data from the start and/or end of each trace in the frames, according to your specifications.
The destination name must correspond to the final run name. If you give the name of an existing run, it will be not be overwritten. You must first remove all of the destination's files if you want to replace it with a copy of the source.
Before beginning, trimfrms will show what the current window size is for the triggered sweeps, and ask how much you want to trim from the start, and from the end. Enter the amounts in milliseconds. The default values are 0 , for no trimming. It will then indicate the new window size, and the resulting sizes for each trace.
If you are trimming from the start of the window, you will be warned if any trace will need to be time-shifted in the trimmed run. Such a time shift occurs when the sample rate divisor for any trace does not evenly divide the amount being trimmed from the start, expressed as a number of samples at the basic sampling rate.
After this, trimfrms asks you if it is OK to proceed. Type an N if you decide to cancel the operation. The new run will not be created. If you type a Y , or hit SPACE or RETURN, trimfrms will proceed with copying the files that make up the run. While copying and trimming the frame file, it will adjust the delay and window size parameters in the new run eader, to reflect the new offset and length of the triggered sweeps.