The term scale refers to the spacing between points on the axes. If these spacing is uniform, i.e., the gaps are of equal size, a uniform scale is specified -- for example,
1.0, 2.0, 3.0, . . .
. Scales may be omitted in an HDF file; they must be included in a text file.FIGURE 15a - The fp2hdf Utility
15.4.2 Command-line Syntax
The syntax of fp2hdf is as follows.fp2hdf input-filename [input-filename] -o output-filename
[-r] [-f]
[-e|-i horizontal-resolution vertical-resolution depth]
[-p palette-filename]
[-m mean] fp2hdf -h
The input-filename parameter is the name of the file containing the unconverted data set. The file may contain a single two-dimensional or three-dimensional floating point array in ASCII text, native floating point, or HDF SDS format. If an HDF file is used for input, it must contain an SDS. The SDS need only contain a dimension record and the data, but if it also contains maximum and minimum values and/or scales for each axis, these will be used. If the format is ASCII text or native floating point, see the discussion at the end of this section regarding the required structure of the data.
-e
and the -i
flags cannot be used simultaneously. Either pixel interpolation or bilinear interpolation can be chosen for image expansion, but not both.An optional palette can accompany the image by loading it from an HDF file that contains a palette.
Data from several input files (with one set per input file) are stored as several data sets and/or images in one output file. A shell script can be used as another option in calling fp2hdf repeatedly to convert data from multiple input files to their corresponding output HDF files.
If an HDF file is used for input, it must contain an SDS. The SDS need only contain a dimension record and the data, but if it also contains maximum and minimum values and/or scales for the horizontal and vertical axes, these will be used as well.
If the input file format is ASCII text or native floating point, the data must be presented in an ordered set of fields as listed in Table 15F.
For the
FP32
and FP64
input formats, number_of_planes, number_of_rows, and number_of_columns are native integers; where format is the integer representation of the appropriate 4-character string (0x46503332
for FP32
and 0x46503634
for FP64
). The remaining input fields are composed of native 32-bit floating point values for FP32
input format, or native 64-bit floating point values for FP64
input format.
fp2hdf infile1.txt -o outfile1This fp2hdf command is used to convert floating-point data in the file named "infile2.txt" to an 8-bit raster image and store it in RIS8 format in the HDF output file named "outfile2".
fp2hdf infile2 -o outfile2 -rThis fp2hdf command is used to convert floating-point data in the file named "infile3.txt" to the RIS8 and SDS formats and store both converted data groups in the HDF output file "outfile3".
fp2hdf infile3.txt -o outfile3 -r -fThis fp2hdf command is used to convert floating-point data in the file named "infile4.txt" to a 500 x 600 raster image, storing the RIS8 in the HDF file "outfile4". This also stores the palette data read from the file name "palfile" with the image data.
fp2hdf input4.txt -o outfile4 -r -e 500 600 -p palfileThis fp2hdf command is used to convert floating-point data in all files whose names begin with the letter "f" to 500 x 600 RIS8 images and store them in the output file "output5".
fp2hdf f* -o outfile5 -r -i 500 600