expbin, exppipe - Export variable data in binary format

SYNOPSIS

expbin  [ parameter=value ... ]  [ inputfile outputfile ]
expbin  [ parameter=value ... ]  [ inputfile ... directory ]
exppipe  [ parameter=value ... ]  [ inputfile ...  ]

Parameters for expbin are: include_vars, sort_by_var, apply_scaling.
Parameters for exppipe are: include_vars, sort_by_var, apply_scaling, tty_output.

DESCRIPTION

expbin exports TeraScan dataset variable data to binary UNIX disk files. exppipe works in the same manner as expbin, except that data is exported to UNIX stdout.

Only variable data is exported. Dataset definitions are not exported, i.e., dimension data, attribute data, and variable definitions.

Output data can be sorted by variable, or by leading dimension:

by variable - <all data for var 1> <all data for var 2> ...

by lead dim - <var 1 row 1 data> <var 2 row 1 data> ...
              <var 1 row 2 data> <var 2 row 2 data> ...
              ...

In the latter case, all exported variables must have the same leading dimension.

Variable scale and offset attributes can optionally be applied prior to output. Byte, short, and 32-bit floating point data are scaled to 32-bit floating point. Long and 64-bit floating point data are scaled to 64-bit floating point.

Variables with units of std_date and std_time are converted to yymmdd and hhmmss, respectively. Note that date conversion does not take place if variable scaling is applied.

PARAMETERS

include_vars

Specifies the list of variables to export. If the list is preceded by a minus sign, all variables except those listed will be exported. Wildcards * and ? are allowed. The default is to export all variables.

sort_by_var

Specifies whether or not data for each variable is to be contiguous in the output. Otherwise, the output data is sorted by leading dimension. See above. Valid responses are [yes, no]. The default is yes.

apply_scaling

Specifies whether or not variable scale and offset attributes are to be applied to the data before it is output. See above. Valid responses are [yes, no]. The default is no.

tty_output

Specifies whether or not variable data is to be output to the user's screen. This parameter is used by exppipe only when UNIX stdout is a tty, and serves as a bit of protection when the user forgets to redirect stdout to a file or a pipe. Valid responses are [yes, no]. The default is no.

EXAMPLES

The following exports all variables in new7 starting with the letters av and sorts the output by leading dimension.

temp [10] % expbin new7 exp
include_vars   : char(255) ? [] av*
sort_by_var    : char(  3) ? [yes] n
apply_scaling  : char(  3) ? [no]

SEE ALSO

expasc, impasc, impbin, impbin1, printvar

NOTES

exppipe does not mix data from different input files when sort_by_var=no. Data from the first input file will be exported prior to data from the second input file.

exppipe is useful for piping TeraScan variable data into a non-Terascan process, such as a compression filter. Unless the process is a simple stream processor (e.g., compress), the user must be sure to prefix the data so the process can determine the shape of the incoming data. For example, suppose we wanted to pipe an image variable into the JPEGS compressor cjpeg, and that the image was of some known size, so we could generate an appropriate header that was meaningful to cjpeg. Then we could:

impbin the header into a TeraScan dataset, possibly keeping it around for future use.

exppipe the header and image files into cjpeg, with the include_vars parameter indicating the names of the header variable and the image variable.

One header format accepted by cjpegs is PGM. The header for a 3000 line by 2048 sample byte image is a 3-line ASCII file listed below:

P5
2048 3000
255

Last Update: $Date: 1998/05/28 18:02:23 $