HEConvert HEConvert is a command-line conversion utility used to convert HDF-EOS Version 2.x files to HDF-EOS Version 5.x. Upon successful completion of HEConvert there will exist a fully qualified HDF-EOS Version 5.x file that is based on using the HDF5 library. Starting with the 2011 version HEConvert will convert non-HDF-EOS objects and their attributes to HDF5. You will need to install the following software (or newer version) for compiling the source code: HDF-EOS2.19v1.00 HDF-EOS5.1.15 HDF4.2.10 hdf5-1.8.12 jpegsrc.v6b szip-2.1 zlib-1.2.8 After installation of HDF and HDF-EOS, typing "make" in the heconvert directory will indicate which environment variables are needed to be set before typing this "make" for successful creation of the HEConvert executable. The following is an example of how HEConvert works: HEConvert -i Infile.hdf4 -o Outfile.hdf5 The above command will grab the file Infile.hdf4, check for the existence of any HDF-EOS objects (Swath/Point/Grid). Once it determines how many objects exist they will be read in, converted to HDF-EOS Version 5.x types, and written out to the file Outfile.hdf5. It will also detect objects that are written using native HDF4 (HDF4 objects), and will convert them to HDF5 objects. If the HDF4 objects are for dimension scales then the converter will convert HDF4 dimension scales into HDF-EOS5 dimension scales To receive help with HEConvert type: HEConvert -h The following message will appear: ************* HEConvert converts HDF-EOS2 objects to HDF-EOS5 objects and HDF4 objects to HDF5 objects ************* Usage: HEConvert -i -o [-v][-h][-c ] HEConvert -version -i - input file name (-i flag must be used) -o - output file name (-o flag must be used, file name must be a new file) -v - verbose mode -c - if HDF4 file is compressed, compress (DEFLATE) HDF5 file - chunk number is optional -version - utility version -h - help HEConvert Options The -i option is the option used to flag HEConvert that the next parameter is the input file. This option is mandatory. The file listed must have read permission, the file must exist, and be an HDF4 formatted file. The -o option is the option used to flag HEConvert that that next parameter is the output file. This option is mandatory. The file listed must not exist and the directory used must have write permission. The -v option turns on the verbose mode of HEConvert. HEConvert without the -v option would print out only a few important messages regarding its progress. While using the -v option will cause HEConvert to give many detailed messages regarding the progress of HEConvert. The -version option will print out the version of the utility. If this option is entered anywhere on the line HEConvert will print out the HEConvert version and not performed any conversions. HEConvert will not convert any files when the -version option is entered. The -h option will cause the usage message (listed above) to print and no further conversions will be performed. HEConvert will not convert any files when the -h option is entered. The -c option is used for compression. When using the compression option the user may enter a number of suggested chunks after the -c. The number following the -c is not mandatory of the optional -c flag is used. If the -c flag is used HEConvert will check to see if the input file has been compressed. If any tables have been compressed in the input file HEConvert will compress the tables in the output file using the DEFLATE method. The algorithm to calculate chunk size is as follows: If the user supplied a chunk size, use it. If the user did not supply a chunk size do the following, take the square root of the dimension size. If this value is less than or equal to ten (10), set the chunking to one (1). Otherwise, modulo the square rooted value into the dimension size. If the modulo value is not zero (0) subtract one (1) from the squared rooted value and perform the modulo again. Repeat this until the modulo value is zero(0). This is the chunk size. HEConvert Summary The HEConvert utility will make no assumptions regarding a file. It will merely read the data using the HDF-EOS Version 2.x library (and HDF4 library for hybrid files) and write that exact data using the HDF-EOS Version 5.x library (and HDF5 library if needed). Since Group and Local attributes did not exist in the HDF-EOS Version 2.x library those elements were not written into the output file. However, starting with the 2011 version of the converter HDF4 calls were used to read attributes that are written to HDF-EOS2 files using HDF4 calls. After reading these attributes converter writes them to HDF-EOS5 output using HDF-EOS5 library. Also with this version the converter will read and write all SDSes that were written to HDF-EOS2 files using HDF4 calls. In addition the converter was modified to read and write Dimension Scales. The Dimension Scale writing capability was added to HDF-EOS 2 and 5 in 2010. Also with this new version the converter will read core and archive metadata from the input hdf-eos2 file and write the same metadata to the output hdf-eos5 file.