The HDF_DFP_PUTPAL procedure appends a palette to an HDF file.
Examples
id = HDF_OPEN('test.hdf', /CREATE, /RDWR)
HDF_DFP_PUTPAL,'test.hdf'’, FINDGEN(3,256)
PRINT, HDF_DFP_NPALS('test.hdf')
HDF_DFP_PUTPAL,’test.hdf’,findgen(3,256)
PRINT, HDF_DFP_NPALS('test.hdf')
HDF_DFP_PUTPAL, 'test.hdf', FINDGEN(3,256), /OVERWRITE
PRINT, HDF_DFP_NPALS('test.hdf')
HDF_DFP_PUTPAL, 'test.hdf', $
FINDGEN(3,256), /DELETE
HDF_CLOSE, id
HDF_DFP_PUTPAL, 'test.hdf', FINDGEN(3,256), /DELETE
PRINT, HDF_DFP_NPALS('test.hdf')
IDL Output
1
2
2
% HDF_DFP_PUTPAL: Could not write palette
% Execution halted at: $MAIN$
1
Syntax
HDF_DFP_PUTPAL, Filename, Palette [, /DELETE] [, /OVERWRITE]
Arguments
Filename
A scalar string containing the name of the file to be written.
Palette
A vector or array containing palette data. Palettes must be either [3, 256] arrays or 786-element vectors.
Keywords
DELETE
Set this keyword to delete the HDF file (if it exists) and create a new HDF file with the specified palette as its first object.
Note: The HDF file must be closed before the DELETE keyword is specified. Attempting to delete an open HDF file will result in an error.
OVERWRITE
Set this keyword to overwrite the previous palette with the one specified by Palette.
Version History