The following IDL commands should be used to create a new HDF file:
HDF_OPEN: Call this procedure first to open an HDF file. The CREATE keyword must be set if you want to create a new file instead of open an existing one.
HDF_DFAN_ADDFDS: Optionally, add a file description.
HDF_DFAN_ADDFID: Optionally, add a file annotation.
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.
HDF_VG_ATTACH to get a Vgroup identifier.
HDF_VG_SETINFO to set the Vgroup name and class (optional).
HDF_VG_INSERT to add the Vdata to a Vgroup.
HDF_VG_DETACH to close the Vgroup.
HDF_CLOSE to close the file.
Two example files that demonstrate the use of the HDF routines can be found in the hdf_ncdf subdirectory of the examples 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.