impbin1 - Imports 1-D, 2-D, or 3-D binary data

SYNOPSIS

impbin1  [ parameter=value ... ]  [ inputfile outputfile ]
impbin1  [ parameter=value ... ]  [ inputfile ... directory ]

Parameters are: dim_sizes, dim_names, var_name, var_units, var_type, bad_value, scale_factor, scale_offset, header_size, data_start, dim_dist, instantiate.

DESCRIPTION

impbin1 produces TeraScan datasets from binary files. impbin1 can import 1-D, 2-D or 3-D data. impbin1 is a slightly more generalized version of impbin, but it is restricted to importing one or more identical variables at a time. (Identical variables have the same dimensions, units, type, scale factor and offset.) The assemble function can be used to work around this restriction.

impbin1 requires that the offset from

V[I1, ..., Ij, ..., In] to V[I1, ..., Ij +1, ..., In]

be a function of j only, hereby defined to be dimdist(j). impbin further requires that dimdist(j) = sizeof(V) for j > 1, where sizeof(V) denotes the width of an element of V in bytes.

The following example shows data that can be imported by impbin1 and not impbin:

\fC<header><some fixed offset>
  y  11  x  x  12  x  x  13  x  x  14  z  z  z
  y  21  x  x  22  x  x  23  x  x  24  z  z  z
  y  31  x  x  32  x  x  33  x  x  34  z  z  zi

  Value of V[i,j] = i*10 + j

  dimdist(1) = sizeof(V) + 6*sizeof(x) + 3*sizeof(z) + sizeof(y)
  dimdist(2) = sizeof(V) + 2*sizeof(x)

PARAMETERS

dim_sizes

Specifies the list of dimension sizes. Valid responses are one, two, or three positive integers. There is no default.

dim_names

Specifies the list of dimension names. Each name can be at most 31 characters long. If the number of dimensions is one, the default is [points]. If the number of dimensions is two, the default is [line sample]. Otherwise the default is [x y z].

var_name

Specifies the names of the imported variables. Each name can be at most 31 characters long. There is no default.

var_units

Specifies the units for the imported variables. The units' name can be at most 31 characters long. The default is blank, which means no units. The following units are understood by impbin1:

 units          converted to

yymmdd           std_date
yyddd            std_date

hhmmss           std_time

Times are always assumed to be GMT.

var_type

Specifies the datatype for the imported variables. Types can be one of the following:

byte          8-bit unsigned integer
short         16-bit integer
long          32-bit integer
float         32-bit floating point
double        64-bit floating point
str#          string of length #

String length usually includes space for a trailing 0. There is no default.

bad_value

Specifies the bad value for the imported variables. The default is 0.

scale_factor, scale_offset

Used only if var_type=byte or var_type=short. This parameter specifies the variable attributes used in the following linear transform:

true value = scale_factor * input value + offset

The default is 1 and 0, respectively,

header_size

Specifies the length of the input file header. The default is 0.

data_start

For each imported variable, specifies the number of bytes to skip beyond the header before reading any data. The default is 0 for each variable.

dim_dist

Specifies the distance between dimensions, defined above. The default is the minimum possible for each dimension.

instantiate

Indicates whether or not the variable data is to be copied from the input files to the corresponding output files. Otherwise, the data is not copied, and the output files contain link variables pointing back to the input files. Valid responses are [yes, no]. The default is no.

EXAMPLES

The following example imports five AVHRR channels from raw HRPT telemetry. The data is laid out as follows; total record size is 22528 bytes:

<750*2 byte pad> <ch1> <ch2> ... <ch5> <ch1> <ch2> ...<ch5> ...
<750*2 byte pad> <ch1> <ch2> ... <ch5> <ch1> <ch2> ...<ch5> ...
:

[2] % impbin1 hrpt avhrr
dim_sizes      : int (  3) ? 5050 2048
dim_names      : char( 63) ? [line sample]
var_name       : char(255) ? av1 av2 av3 av4 av5
var_units      : char( 31) ? []
var_type       : char( 15) ? sh
bad_value      : real      ? [0] -1
scale_factor   : real      ? [1]
scale_offset   : real      ? [0]
header_size    : int       ? [0]
data_start     : int (  5) ? [0 0 0 0 0] 1500 1502 1504 1506 1508
dim_dist       : int (  2) ? [4096 2] 22528 10
instantiate    : char(  3) ? [no]

SEE ALSO

assemble, impasc, impbin, datasets, formats, import


Last Update: $Date: 1998/05/29 17:36:06 $