APPENDRUN

Section: User Commands (1)
Updated:
Index
Return to Main Contents
 

NAME

appendrun - append data from one run file to another  

SYNOPSIS

appendrun firstrun secondrun  

DESCRIPTION

Appendrun is used to concatenate two run files into one. The data from secondrun is appended to firstrun. The run name arguments can be given with or without the .frm suffix. Because the first run is modified in the process, it is recommended that you first make a copy of that run. See copyrun(1).

Before actually appending, appendrun checks the two runs for consistency, ensuring the capture parameters used for both are compatible. It makes sure that the sampling rate, the window duration and delay, and the channel assignments and divisors are all the same in both runs. (The run lengths and numbers of frames can of course differ.) If any discrepancy is found, it will not append the second run. You can concatenate two raw runs, or two averaged runs, but you cannot mix the two types. Averaged runs can be concatenated only if they were produced by the same averaging method.

You will also be warned if any waveform file in the second run will be time-shifted in the concatenated run. Such a time shift occurs when the sample rate divisor for any waveform does not evenly divide the length of the first run at the sampling rate used. In this case, the waveform from the second must be shifted over in time when appended to the first run, to maintain the same interval between samples on the waveform. The time shift will not exceed the effective sampling period of the waveform. If the time shift is negative, it means the first sample in the waveform from the second run will have to be thrown out to maintain the correct waveform file size in the new run.

After these consistency checks, appendrun asks you if it is OK to append the second run to the first. Type an N if you decide to cancel the operation - the first run will remain unchanged. If you type a Y, or hit SPACE or RETURN, appendrun will append all of the waveforms from the second run to the corresponding waveform files in the first run, then append all of the frames from the second run's frame file to the first's (adjusting the frame trigger times for raw runs), and finally update the first run's run header to reflect the new length. It makes no attempt to merge the contents of the run description file (.txt), nor the frame description file (.frd); you will have to update these text files by hand, if present. Any associated analysis(1) parameter file or waveform parameter files will also not be merged.  

DIAGNOSTICS

Here are the error diagnostics that can occur, in the order for which they are tested.
Can't append a run to itself!
The specified firstrun and secondrun must refer to two distinct runs (two different frame files).
Can't read frame file name
The named frame file for one of the runs could not be opened for reading. Make sure you specified the name correctly, and have read permission on the file.
Not a run file: name
The named frame file for one of the runs does not begin with a valid run header.
Parameters incompatible in run files
This is followed by a list of the incompatibilities found. Make sure that the sampling rate, the window duration and delay, and the channel assignments and divisors are all the same in both runs. The runs must both be raw, or both averaged using the same averaging method.
Incorrect size for name
The size of one of the waveform files is not what it should be for its sampling rate, rate divisor, and run length. The file was most likely truncated.
Warning - name will be shifted by x ms
A common problem, which will usually be acceptable. See above for details about time shifts in waveforms. This will not prevent you from continuing.
Skip-size calculation error for name
The waveform size calculations yielded an unacceptable number of samples to be skipped. (Shouldn't happen if the individual waveform files have the correct sizes.)
OK to append name to name? (Y/N):
It's not really an error message. You are given an opportunity to bail out if the file names are incorrect (or in the wrong order), or if you find the waveform time shifts reported to be unacceptable.

Any error after this point aborts the operation, which can leave firstrun in an unusable state if any of its waveform files have been modified. That's why you should make a copy of it beforehand.

Can't append to name
The first frame file could not be opened for writing. No modifications will have been made to the first run. Make sure you have write permission on this file, and on all of its waveform files.
Appending name to name failed
One of the waveform file append operations failed. This message is followed by a brief explanation of the error. A likely cause is running out of disk space, or not having write permission on one of the waveform files. You will also need permission to remove these waveform files from their directory if they have links. (Linked waveform files are copied, and the link removed, to avoid appending twice to the same file.)
Can't open name
The second frame file could not be re-opened for reading.
Can't allocate frame buffer
A memory allocation error occurred. This could be caused by a corrupted run header.
Write error on name
An error occurred while appending frames to firstrun's frame file. A likely cause is running out of disk space. This would leave the frame file incomplete, causing errors later if you try to access frames that were not successfully copied. The program still attempts to update the run header, so not all is lost.
Incomplete frame or read error on name
An error occurred while getting frames from secondrun's frame file. This could leave firstrun's frame file incomplete, causing errors later if you try to access frames that were not successfully copied. The program still attempts to update the run header, so not all is lost.
Can't re-write header in name
The program could not update the header. Since this update is done at the start of the file, running out of disk space should not prevent this. Likely cause: a disk error of some sort? Check your system error logs or the console terminal.
 

FILES

*.frm         frame files, containing run headers

*.w??          corresponding waveform files

*.txt          corresponding run descriptions

*.frd          corresponding frame descriptions
 

SEE ALSO

cap(1), dsepr(1), lsrun(1), copyrun(1)  

BUGS

Appendrun does not merge the .frd frame description files.
 

Index

NAME
SYNOPSIS
DESCRIPTION
DIAGNOSTICS
FILES
SEE ALSO
BUGS

This document was created by man2html, using the manual pages.
Time: 20:21:25 GMT, November 21, 2017
Copyright © G. R. Detillieux, Spinal Cord Research Centre, The University of Manitoba.