READ_MYCDF

The function READ_MYCDF reads from one to many variables from one to many CDF files, and returns all data and metadata for these variables in a single structure of the form:

structure_name.variable_name.attribute_name.value
The substructure for each variable will have three fields in addition to any fields holding any metadata information. These three fields are: VARNAME, which holds the name of the variable in a case-sensitive fashion, CDFTYPE, which holds the type of the CDF variable, and DAT, which holds the actual data values.

When reading more than one CDF, metadata and non-record-varying variables are only read from the first CDF, only record-varying data is read from all CDFs.

If an error occurs while reading the CDF(s), a -1 is returned

Calling Sequence

Result = READ_MYCDF(varnames, cdfnames)

Arguments

varnames

A string or string array containing the names of the variables to be read from the CDF file(s). If specifying the variable names in a single string, then the names should be separated by a comma. NOTE: CDF is case sensitive, so the given variable names must be an exact match.

cdfnames

A string or string array containing the names of the CDF file(s) to be read. If specifying the CDF filenames in a single string, then the names should be separated by a comma. NOTE: If reading a file outside your current directory, then the full filename, including directory/path information, must be provided. If running on a UNIX system, remember that all path and file information is case-sensitive.

Keywords

ALL

Set this keyword to read all variables regardless of varnames.

NODATASTRUCT

If this keyword is set, then the .DAT field will be replaced with a field called .HANDLE. The value of this field is a handle_id where the data is located. Using this keyword can result in a performance improvement.

NOQUIET

Set this keyword to keep from disabling obnoxious warning messages from IDL's CDF file access routines.

DEBUG

Set this keyword to turn on some progress messages.

Example

a=strarr(2)
a(0)='/disk/bolero/burley/spdflib/i8_k0_mag_19951008_v01.cdf'
a(1)='/disk/bolero/burley/spdflib/i8_k0_mag_19951013_v01.cdf'
b=read_mycdf('RMS,RMS_p',a)
help,/struct,b
** Structure < 4006fca8 >, 4 tags, length=296936, refs=1:
   RMS             STRUCT    -> < Anonymous > Array(1)
   RMS_P           STRUCT    -> < Anonymous > Array(1)
   EPOCH           STRUCT    -> < Anonymous > Array(1)
   CARTESIAN       STRUCT    -> < Anonymous > Array(1)
help,/struct,b.RMS
** Structure < 400cd808 >, 32 tags, length=147488, refs=2:
   VARNAME         STRING    'RMS'
   TITLE           STRING    'IMP-8 Magnetic Field'
   PROJECT         STRING    'ISTP>International Solar-Terrestrial Physics'
   DISCIPLINE      STRING    'Space Physics>Magnetospheric Science'
   SOURCE_NAME     STRING    'IMP-8>Interplanetary Monitoring Platform 8'
   DESCRIPTOR      STRING    'MAG>Magnetic Field Investigation'
   DATA_TYPE       STRING    'K0>Key Parameter'
   DATA_VERSION    STRING    '1'
   TEXT            STRING    Array(15)
   MODS            STRING    Array(19)
   ADID_REF        STRING    'NSSD0094'
   LOGICAL_FILE_ID STRING    'I8_K0_MAG_19951008_V01'
   FIELDNAM        STRING    'Components of RMS of B (GSE)'
   VALIDMIN        FLOAT     Array(3)
   VALIDMAX        FLOAT     Array(3)
   SCALEMIN        FLOAT     Array(3)
   SCALEMAX        FLOAT     Array(3)
   UNITS           STRING    'nT'
   UNIT_PTR        STRING    ''
   LABLAXIS        STRING    ''
   LABL_PTR_1      STRING    Array(3)
   MONOTON         STRING    ''
   FORMAT          STRING    'F7.3'
   FORM_PTR        STRING    ''
   FILLVAL         FLOAT      -1.00000e+31
   CATDESC         STRING    ''
   VAR_TYPE        STRING    'data'
   DICT_KEY        STRING    ''
   DEPEND_0        STRING    'Epoch'
   DEPEND_1        STRING    'cartesian'
   CDFTYPE         STRING    'CDF_REAL4'
   DAT             FLOAT     Array(3, 12206)

Return to CDFplot