MDA2ASCII

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
AUTHOR
SEE ALSO

NAME

mda2ascii − convert EPICS MDA files to ASCII format

SYNOPSIS

mda2ascii [−hvmtbfe1a] [−x extension] [−d directory] [−o output] [−c commenter] [−s separator] [−i  dimension]  mdafile [...]

DESCRIPTION

mda2ascii is a utility for converting the binary MDA data files (created by saveData in EPICS) into ASCII output. It can handle arbitrary dimensional scans, and can split multi-dimensional scans into separate files for each dimensionalty. Scan values for the dimensionalty being converted are put into column form, while the higher dimensional information is kept in a commented header.

By default, it writes the output for a one-dimensional MDA file to a single file, while for multi-dimensional scans it writes multiple files. The files are put into the current directory. The name of the written file(s) are determined from the input file name, where the extension is removed and replaced with "asc". For multiple files, the higher-dimensional indices are added in order to the base file name. Each scan dimensionality that contains detectors is converted. In addition, mda2ascii can process multiple files at a time.

OPTIONS

−h

Show the help screen.

−v

Show the version information.

−m

Merge the higher dimensional data into the current dimensional scan values. Each of the higher dimensional values takes the form of a column with that single value, and the higher dimensional values are removed from the header. The higher dimensional scan indices are also added as columns, with the corresponding single values.

−t

Trim off all the commented header lines, leaving only values.

−b

Comment out blank lines.

−f

Friendlier data presentation, with all the data columns having a uniform width, making manual browsing of values much easier. An extra commented line at the beginning of scan data indicates the column numbers.

−e

Write "Extra PV" information into a separate file. The name of this extra file is included in the scan file after the header. This option is overriden by the −t and −1 options.

−1

For a multi-dimensional scan file, all of the resulting output for each scan is merged into a single output file. An overall header is added at the start of the file, the scans are all separated by dividers, and another divider is added before the first scan of every dimensionality.

−a

Write out all the scans, even those that are not considered truly finished. This only really matters for a multidimensional data file, where the overall scan was aborted before finishing. Technically, only those lower-dimensional scans under the completed highest-dimensional scans are considered complete. However, there may be incomplete scans under the highest dimensional scan that was running, and this option outputs those scans. Those scans tend to have bad values in the higher dimensional areas, so take care with these scans.

−x extension

Change the extension used for automatically naming files. The default is "asc".

−d directory

Change the output directory when automatically naming files. The default is the current directory (or ".").

−o output | −

Specify the output file, limiting the number of input MDA files to one. Either the entire file name and path can be specified, or simply the name’s base. If using a base, an extension and directory will be appended to it, coming either from the −x and −d options or their defaults). Alternatively, if "" is specified, the output will be redirected to the standard output (the screen).

−c commenter

Change the string used at the beginning of a comment line. Normally, this is a single character, but it can be more. The default is "#".

−s separator

Change the string used to separate the data values into columns. The default is " ".

−i dimension | −

Specify the scan dimensionality that is output. The possible parameters are the scan dimensionality or "" for all scans. The default is to use all scans that contain detectors.

EXAMPLES

To convert a directory full of MDA files, sending the output to the directory "asc_data", one would simply run

mda2ascii -d asc_data *.mda

Alternatively, you can go into the "asc_data" directory and run instead

mda2ascii ../*.mda

where all the ASCII files go into the current directory.

If your program needs "%" as the comment character and "," as data separators, you could convert the data this way, running

mda2ascii -s "," -c "%" *.mda

where the output goes into the original directory.

Suppose one wants all the resultant one-dimensional data from a multi-dimensional data file (say "data.mda") to come out in a multidimensional ASCII form, suitable for a matrix manipulating program. This can be accomplished using

mda2ascii -m1t -i 1 -o data-matrix.dat data.mda

where the output is stored in a special file "data-matrix.dat". This file will have the complete multi-dimensional data set ready to be read. For a file with n dimensions, the first n columns will be the indices identifying the point. There is a caveat to all of this: mda2ascii does absolutely no checking to make sure that the parameters of the lower dimensional scans weren’t altered while the top-most dimensional scan was running. In theory, the one-dimensional scans could have different numbers of detectors, different number of scan points, etc. which would make the data nonsensical. This is very unlikely, but it is theoretically possible.

AUTHOR

Dohn A. Arms

SEE ALSO

mda-dump(1), mda-info(1), mda-ls(1)