HDF_SD_SETEXTFILE procedure moves data values from a dataset into an external file. Only the data is moved, all other information remains in the original file. This routine can only be used with HDF version 3.3 (and later) files, not on older HDF files or NetCDF files. Data can only be moved once, and the user must keep track of the external file(s). The OFFSET keyword allows writing to an arbitrary location in the external file.
As shown in the example, when adding data to an external file SD, you
first use HDF_SD_ENDACCESS to sync the file, then reacquire the SDS ID with HDF_SD_SELECT before using HDF_SD_SETEXTFILE.
An SD dataset ID as returned by HDF_SD_SELECT.
The name of the external file to be written.
Set this keyword to a number of bytes from the beginning of the external file at which data writing should begin. Exercise extreme caution when using this keyword with existing files.
sd_id = HDF_SD_START('ext_main.hdf', /CREATE)
sds_id = HDF_SD_CREATE(sd_id, 'float_findgen', [3,5], /FLOAT)
HDF_SD_ADDDATA, sds_id, FINDGEN(3,5)
sds_id = HDF_SD_SELECT(sd_id, 0)
HDF_SD_SETEXTFILE, sds_id, 'findgen.hdf'
HDF_SD_GETDATA, sds_id, fout
0.00000 1.00000 2.00000
3.00000 4.00000 5.00000
6.00000 7.00000 8.00000
9.00000 10.0000 11.0000
12.0000 13.0000 14.0000