DA2NDF

Converts a direct-access unformatted file to an NDF

Description:

This application converts a direct-access (fixed-length records) unformatted file to an NDF. It can therefore also process unformatted data files generated by C routines. Only one of the array components may be created from the input file. The shape of the NDF has be to be supplied.

Usage:

da2ndf in out [comp] noperec shape [type]

Parameters:

COMP = LITERAL (Read)
The NDF component to be copied. It may be "Data", "Quality" or "Variance". To create a variance or quality array the NDF must already exist. ["Data"]
IN = FILENAME (Read)
Name of the input direct-access unformatted file.
NOPEREC = _INTEGER (Read)
The number of data values per record of the input file. It must be positive. The suggested default is the size of the first dimension of the array. A null (!) value for NOPEREC causes the size of first dimension to be used.
OUT = NDF (Read and Write)
Output NDF data structure. When COMP is not "Data" the NDF is modified rather than a new NDF created. It becomes the new current NDF. Unusually for an output NDF, there is a suggested default—the current value—to facilitate the inclusion of variance and quality arrays.
SHAPE = _INTEGER (Read)
The shape of the NDF to be created. For example, [40,30,20] would create 40 columns by 30 lines by 10 bands.
TYPE = LITERAL (Read)
The data type of the direct-access file and the NDF. It must be one of the following HDS types: "_BYTE", "_WORD", "_REAL", "_INTEGER", "_INT64", "_DOUBLE", "_UBYTE", "_UWORD" corresponding to signed byte, signed word, real, 64-bit integer, integer, double precision, unsigned byte, and unsigned word respectively. See SUN/92 for further details. An unambiguous abbreviation may be given. TYPE is ignored when COMP = "Quality" since the QUALITY component must comprise unsigned bytes (equivalent to TYPE = "_UBYTE") to be a valid NDF. The suggested default is the current value. ["_REAL"]

Examples:

da2ndf ngc253.dat ngc253 shape=[100,60] noperec=8
This copies a data array from the direct-access file ngc253.dat to the NDF called ngc253. The NDF is two-dimensional: 100 elements in x by 60 in y. Its data array has type _REAL. The data records each have 8 real values.
da2ndf ngc253q.dat ngc253 q 100 [100,60]
This copies a quality array from the direct-access file ngc253q.dat to an existing NDF called ngc253 (such as created in the first example). The NDF is two-dimensional: 100 elements in x by 60 in y. Its data array has type _UBYTE. The data records each have 100 unsigned-byte values.
da2ndf type="_uword" in=ngc253.dat out=ngc253
This copies a data array from the direct-access file ngc253.dat to the NDF called ngc253. The NDF has the current shape and data type is unsigned word. The current number of values per record is used.

Notes:

The details of the conversion are as follows:

Related Applications

CONVERT: NDF2DA.