How do I get IDL to place a string array into a netdcf file attribute? [message #84435] |
Fri, 31 May 2013 13:08 |
Peter Thorne
Messages: 13 Registered: October 2000
|
Junior Member |
|
|
Newbie dipping in after a frustrating afternoon. I tried to search pretty exhaustively and can't find an answer to this on existing (at least cached) threads or anywhere else on the net.
I am crashing my IDL (v8.2 on a mac) in trying to write the following (as an e.g.)
flag_type_vals=[101, 102, 103, 999]
flag_type_descriptors=['Raw','Quality_Controlled_by_originat or','Homogenized_by_originator','Missing/Unknown/Not_Applica ble']
; netcdf commands
NCDF_ATTPUT,wilma,'data_type_flags','flag_values',flag_type_ vals,length=N_ELEMENTS(flag_type_vals),/SHORT
NCDF_ATTPUT,wilma,'data_type_flags','flag_meanings',flag_typ e_descriptors,length=N_ELEMENTS(flag_type_descriptors),/STRI NG
If I use /CHAR instead of string in the last command then the program does not crash my IDL but only writes the first string element of the flag_type_descriptors array.
I have a whole bunch of these that need writing (some are 50 element flag identifiers and descriptors ...!). So, how do I get IDL to write these flag descriptors out either 1. as a string array or 2. as something which a netcdf reader is going to interpret as a string array so that someone can match the descriptors to the flag values?
Thanks
Peter
|
|
|