The HDF_DFP_PUTPAL procedure appends a palette to an HDF file.
HDF_DFP_PUTPAL, Filename, Palette [, /DELETE] [, /OVERWRITE]
A scalar string containing the name of the file to be written.
A vector or array containing palette data. Palettes must be either [3, 256] arrays or 786-element vectors.
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 |
Set this keyword to overwrite the previous palette with the one specified by Palette.
; Create HDF file:
id = HDF_OPEN('test.hdf', /CREATE, /RDWR)
; Add a palette:
HDF_DFP_PUTPAL,'test.hdf'', FINDGEN(3,256)
; Print number of palettes:
PRINT, HDF_DFP_NPALS('test.hdf')
; Append a palette:
HDF_DFP_PUTPAL,'test.hdf',findgen(3,256)
; Print the number of palettes:
PRINT, HDF_DFP_NPALS('test.hdf')
; Overwrite the last palette:
HDF_DFP_PUTPAL, 'test.hdf', FINDGEN(3,256), /OVERWRITE
; Print the number of palettes:
PRINT, HDF_DFP_NPALS('test.hdf')
; An attempt to delete a file and add a new palette
; without first closing the HDF file fails:
HDF_DFP_PUTPAL, 'test.hdf', $
FINDGEN(3,256), /DELETE
; Close the HDF file:
HDF_CLOSE, id
; Delete file and add a new palette:
HDF_DFP_PUTPAL, 'test.hdf', FINDGEN(3,256), /DELETE
; Print the number of palettes:
PRINT, HDF_DFP_NPALS('test.hdf')
1 2 2 % HDF_DFP_PUTPAL: Could not write palette % Execution halted at: $MAIN$ 1
Introduced: 4.0