.TH A2M 1 "23 April 1992" "MIT DB software 8.0" "DB applications" .SH NAME a2m, ad2m, m2a, md2a \- utilities for converting between MIT and AHA DB formats .SH SYNOPSIS \fBa2m -i \fIahafile\fB -r \fIrecord\fB -a \fIannotator\fR [ \fIoptions\fR ... ] .br \fBad2m -i \fIahafile\fB -r \fIrecord\fR [ \fIoptions\fR ... ] .br \fBm2a -r \fIrecord\fB -a \fIMIT-annotator AHA-annotator\fR [ \fIoptions\fR ... ] .br \fBmd2a -o \fIahafile\fB -r \fIrecord\fR [ \fIoptions\fR ... ] .SH DESCRIPTION These programs can be used to convert AHA DB distribution files from half-inch 9-track tape or floppy disks to MIT format (i.e., formats that can be read directly by programs compiled with the \fIdb\fR(3) library), or to convert files in MIT format into AHA DB tape distribution format (conversion to AHA DB floppy disk distribution format is not supported). All four of these programs print a brief usage summary if invoked with no command-line arguments, or with a \fB-h\fR option. .PP Use \fIa2m\fR to convert AHA-format annotation files into MIT format. Options for \fIa2m\fR include: .TP \fB-s\fI time\fR Shift annotations forward by the specified \fItime\fR (default: no shift for type 0 input files, 5 minutes for type 1 or 3, or 2 hours and 30 minutes for type 2). .TP \fB-t\fI type\fR Convert an input file of the specified \fItype\fR (0: a file produced by a DB application using \fIputann\fR and `AHA_WRITE' mode; 1: an AHA DB `short format' tape file; 2: an AHA DB `long format' tape file; 3: an AHA DB compressed (\fI*.ano\fR) floppy disk file). Input files of types 1, 2, and 3 are assumed to contain annotation times in milliseconds, which are converted to sampling intervals based on an assumed sampling frequency of 250 Hz. .PP Use \fIad2m\fR to convert AHA-format signal files into MIT format. Options for \fIad2m\fR include: .TP \fB-c\fR Convert an AHA DB compressed (\fI*.cmp\fR) floppy disk file (default: convert a file in AHA DB tape format). .TP \fB-f\fI time\fR Begin converting at the specified \fItime\fR relative to the beginning of the input file (default: 0, i.e., at the beginning of the input file) .TP \fB-t\fI time\fR Stop converting at the specified \fItime\fR relative to the beginning of the input file (default: 35 minutes after the starting time, or the end of the input file, whichever comes first). .PP Use \fIm2a\fR to convert MIT-format annotation files into AHA tape format. Options for \fIm2a\fR include: .TP \fB-s\fI time\fR Shift annotation times backward by the specified \fItime\fR, and convert them from sample intervals to milliseconds. .PP Use \fImd2a\fR to convert MIT-format signal files into AHA tape format. Options for \fImd2a\fR include: .TP \fB-n\fI new-record\fR Create a new header file for the AHA-format output signal file, so that it may be read as record \fInew-record\fR. .PP MIT-format files can be excerpted and reformatted in more generally useful ways using \fIsnip\fR(1) or \fIxform\fR(1). .PP The shell variable \fBDB\fR should be set and exported (see \fIsetdb\fR(1)). .SH EXAMPLES .SS "AHA DB floppy disk" To make a version of AHA DB record 1201 in MIT format, given the distribution floppy disk, copy the files \fI1201.ano\fR and \fI1201.cmp\fR to the current directory, then type: .br ad2m -i 1201.cmp -r 1201 -c .br a2m -i 1201.ano -r 1201 -a atruth -t 3 .br These commands produce files \fI1201.dat\fR (the signal file), \fIheader.1201\fR (the header file, named \fI1201.hea\fR under MS-DOS), and \fIatruth.1201\fR (the reference annotation file, named \fI1201.atr\fR under MS-DOS), all in the current directory. Run \fIad2m\fR first, so that the new header file is available for the use of \fIa2m\fR. .SS "AHA DB short format tape" .PP To obtain the same files given a `short format' 9-track distribution tape, copy the second and third files from the tape into files \fI1201.tap\fR and \fI1201.ann\fR in the current directory, then type: .br ad2m -i 1201.tap -r 1201 .br a2m -i 1201.ann -r 1201 -a atruth -t 1 .br The names for the files copied from the tape are arbitrary, but do not use names of files to be generated by \fIad2m\fR or \fIa2m\fR (see the previous example). Note that the first and fourth files on the distribution tape contain an `id' block, which can be read by \fIreadid\fR (a program included in the \fIconvert\fR directory of the DB Software Package) to verify the record name. Distribution tapes that contain more than one record contain additional sets of four files, always in the same order within each set. .SS "AHA DB long format tape" .PP To make a version of the three-hour AHA DB record 1001 in MIT format, given the `long format' distribution tape, copy the second and third files from the tape into files \fI1001.tap\fR and \fI1001.ann\fR in the current directory, then type: .br ad2m -i 1001.tap -r 1001 -t 3:0:0 .br a2m -i 1001.ann -r 1001 -a atruth -t 2 .br The \fB-t 3:0:0\fR option is necessary to prevent \fIad2m\fR from truncating the signal file after the first 35 minutes. .SS "Converting AHA DB long format to short format" .PP To make a version of AHA DB record 1201 in MIT format, given a `long format' 9-track distribution tape containing the corresponding three-hour record 1001, copy the second and third files from the tape into files \fI1001.tap\fR and \fI1001.ann\fR in the current directory, then type: .br ad2m -i 1001.tap -r 1201 -f 2:25:0 .br a2m -i 1001.ann -r 1201 -a atruth -t 1 .br In this case, the \fB-f\fR option instructs \fIad2m\fR to skip the first two hours and 25 minutes of the `long-format' AHA signal file, and to reformat the remainder (equivalent to the 35-minute `short-format' record). The \fB-t 1\fR option is used with \fIa2m\fR even though its input file comes from a `long-format' tape, because the annotation times must be shifted only by the amount necessary for a `short-format' tape in this case. .SS "Sharing signal files for long format and short format AHA DB records" .PP To keep both versions (1001 and 1201) on-line, make the `long format' version first (see above), then type: .br a2m -i 1001.ann -r 1201 -a atruth -t 1 .br to make a `short format' reference annotation file. Continue (under UNIX) by: .br cp header.1001 header.1201 .br or (under MS-DOS) by: .br copy 1001.hea 1201.hea .br and edit the copy of the header file, replacing `1001' in the first line (only!) with `1201', and replacing `212' in the second and third lines by `212+6525000' (see the description of the `byte offset' field in \fIheader\fR(5)). Although two header and reference annotation files are needed, both versions can share the same signal file, allowing a substantial savings in storage requirements. Note that DB application programs that read the `short format' record 1201 signal file may report signal checksum errors at the end of the record, unless you also recalculate the signal checksums (easily done using \fIsnip\fR(1) to copy the record; delete the copy once the checksums have been obtained). .SH AVAILABILITY These programs are provided in the \fIconvert\fR directory of the DB Software Package. Run \fImake\fR in that directory to compile and install them if they have not been installed already. .SH SEE ALSO snip(1), xform(1), db(3), header(5)