Creating HDF Files
The following IDL commands should be used to create a new HDF file:
Adding Data to an HDF File
The routines used to add data to an HDF file vary based on the interface model being used:
- To add an 8-bit image (with or without a palette), use HDF_DFR8_ADDIMAGE or DFR8_PUTIMAGE.
- To add a palette, use HDF_DFP_ADDPAL or HDF_DFP_PUTPAL.
- To add a 24-bit image, use HDF_DF24_ADDIMAGE or HDF_DF24_PUTIMAGE.
- To add a Multi-File Scientific Dataset, use the following commands:
- HDF_SD_CREATE or HDF_SD_SELECT to create an SDS or select an existing one.
- HDF_SD_DIMSET to set dimension information.
- HDF_SD_ATTRSET to set attribute information.
- HDF_SD_SETINFO to insert optional information about the data.
- HDF_SD_ADDDATA to insert the data.
- HDF_SD_SETEXTFILE to move the data to an external file (optional).
- HDF_SD_ENDACCESS to end access to the SDS.
- To add a Vdata, use the following commands:
- To add a Vdata to a Vgroup, use the following commands:
HDF Examples
Example Code
Two example files that demonstrate the use of the HDF routines can be found in the examples/doc/sdf subdirectory of the IDL distribution. The file hdf_info.pro prints a summary of basic information about an HDF file. The file hdf_rdwr.pro creates a new HDF file and then reads the information back from that file. Run these example procedures by entering hdf_info or hdf_rdwr at the IDL command prompt or view the files in an IDL Editor window by entering .EDIT hdf_info.pro or .EDIT hdf_rdwr.pro.