general/CDF/
cdf_load_vars.pro
Routines
top source cdf_load_vars
result = cdf_load_vars(files, varnames=varnames, varformat=varformat, info=info, verbose=verbose, all=all, record=record, convert_int1_to_int2=convert_int1_to_int2, spdf_dependencies=spdf_dependencies, var_type=var_type, no_attributes=no_attributes, number_records=number_records)
FUNCTION cdfi = cdf_load_vars(file) INPUT: file = CDF filename(s) OUTPUT: CDFI = A strucutre containing pointers to the data and attributes for the files, with tags: CDFI.FILENAME = The filename(s) CDFI.INQ = A structure with information about the file: CDFI.INQ.NDIMS = CDF Dims attribute, for rVariables typically 0 (rVariables are rarely used anymore See http://cdf.gsfc.nasa.gov/html/FAQ.html#intro) CDFI.INQ.DECODING = 'HOST_DECODING' (can be network or host) CDFI.INQ.ENCODING = 'NETWORK_ENCODING' (can be network or host) CDFI.INQ.MAJORITY = 'ROW_MAJOR' (can be row or column) CDFI.INQ.MAXREC = Max number of records (Default is -1) CDFI.INQ.NVARS = number of rVariables, usually 0 CDFI.INQ.NZVARS = number of zVariables, usually all of them CDFI.INQ.NATTS = number of variable attributes CDFI.INQ.DIM = dimensions of rVariables CDFI.g_atttributes = CDF global attributes, strucuture varies Here is a sample from THEMIS EFI: PROJECT STRING 'THEMIS' SOURCE_NAME STRING 'THA>Themis Probe A' DISCIPLINE STRING 'Space Physics>Magnetospheric Science' DATA_TYPE STRING 'EFI' DESCRIPTOR STRING 'L2>L2 DATA' DATA_VERSION STRING '1' PI_NAME STRING 'V. Angelopoulos, J. Bonnell & F. Mozer' PI_AFFILIATION STRING 'UCB, NASA NAS5-02099' TITLE STRING 'Electric Field Instrument (EFI) Measurements' TEXT STRING 'THEMIS-A: Electric Field Instrument (EFI) Electric field measurements. The L2 product is a 3D estimate of'... INSTRUMENT_TYPE STRING 'Electric Fields (space)' MISSION_GROUP STRING 'THEMIS' LOGICAL_SOURCE STRING 'tha_l2_efi' LOGICAL_FILE_ID STRING 'tha_l2_efi_20131001_v01' LOGICAL_SOURCE_DESCRIPTION STRING 'Spacecraft-collected (EFI) Electric field' TIME_RESOLUTION STRING '3-1/8s' RULES_OF_USE STRING 'Open Data for Scientific Use' GENERATED_BY STRING 'THEMIS SOC' GENERATION_DATE STRING 'Sun Oct 6 03:11:38 2013' ACKNOWLEDGEMENT STRING 'NASA Contract NAS5-02099' MODS STRING 'Rev- 2009-09-16' ADID_REF STRING 'NSSD0110' LINK_TEXT STRING Array[3] LINK_TITLE STRING Array[3] HTTP_LINK STRING Array[3] FILE_NAMING_CONVENTION STRING 'source_descriptor_datatype' CAVEATS STRING 'See THEMIS website for caveats' VALIDITY STRING 'to be validated' VALIDATOR STRING 'tbd' VALIDATE STRING 'Compatible with the ISTP CDF Standards' INST_MOD STRING 'THM>xxxx' PARENTS STRING 'xxxx' INST_SETTINGS STRING 'Not used' SOFTWARE_VERSION STRING '13273' CDFI.NV = Number of variables CDFI.VARS = AN array of CDFI.NV structures, one for each zvariable: CDFI.VARS.NAME = The variable name CDFI.VARS.NUM = The index of the given variable in the cdfi.vars array CDFI.VARS.IS_ZVAR = 1 for a zVariable CDFI.VARS.DATATYPE = The data type, e.g.'CDF_FLOAT' CDFI.VARS.TYPE = The nummerical IDL data type (float is 4, etc...) CDFI.VARS.NUMATTR = -1, Not sure about this one, returned from CDF_VARGET CDFI.VARS.NUMELEM = Number of elements in a record, returned from CDF_VARGET CDFI.VARS.RECVARY = Set to 1 if variable varies from record to record CDFI.VARS.NUMREC = the number of records input. CDFI.VARS.NDIMEN = the number dimensions in the data CDFI.VARS.D = A six-element array with the number of dimensions for each index CDFI.VARS.DATAPTR = A pointer to the data array: CDFI.VARS.ATTRPTR = A pointer to the varaible attributes structure for each variable. Content varies, here is a sample from THEMIS EFI Electric field data: CATDESC STRING 'EFF_DOT0 (fast-survey, 1/8 sec time resolution, using E dot B=0) electric field vector in GSM coordinates'... FIELDNAM STRING 'EFF_DOT0 (fast-survey, 1/8 sec time resolution, using E dot B=0) electric field vector in GSM coordinates'... FILLVAL FLOAT NaN VALIDMIN FLOAT Array[3] VALIDMAX FLOAT Array[3] VAR_TYPE STRING 'data' DISPLAY_TYPE STRING 'time_series' FORMAT STRING 'E13.6' LABL_PTR_1 STRING 'tha_eff_dot0_gsm_labl' UNITS STRING 'mV/m' DEPEND_TIME STRING 'tha_eff_dot0_time' DEPEND_EPOCH0 STRING 'tha_eff_dot0_epoch0' DEPEND_0 STRING 'tha_eff_dot0_epoch' DEPEND_1 STRING 'tha_eff_dot0_gsm_compno' VAR_NOTES STRING 'Units are in mV/m' COORDINATE_SYSTEM STRING 'GSM' REPRESENTATION_1 STRING 'Rep_xyz_gsm' TENSOR_ORDER STRING '1' AVG_TYPE STRING 'standard' PROPERTY STRING 'vector' SC_ID STRING 'a' SCALE_TYP STRING 'linear' DICT_KEY STRING 'electric_field>vector_GSM' SI_CONVERSION STRING '1e-3>V/m' LABEL_1 STRING 'tha_eff_dot0_gsm_labl' Each variable may have a different set of attributes, but this example is a minimal structure that will be ISTP compliant. KEYWORDS: VARFORMAT = string or string array: a string or string array (which may contain wildcard characters) that specifies the CDF variable names to load. Use 'VARFORMAT='*' to load all variables. NOTE THAT VARFORMAT MUST BE SET IF YOU ACTUALLY WANT TO READ DATA. VARNAMES = named variable ;output variable for variable names that were loaded. SPDF_DEPENDENCIES : Set to 1 to have SPDF defined dependent variables also loaded. VAR_TYPE = string or string array; Variables that have a VAR_TYPE matching these strings will be loaded. CONVERT_INT1_TO_INT2 Set this keyword to convert signed one byte to signed 2 byte integers. This is useful because IDL does not have the equivalent of INT1 (bytes are unsigned) RECORD: Specify the record index where you want to start reading. By default, this option will read one record. NUMBER_RECORDS: Specify the number of records that you want to read. By default, this option will begin at record zero. Note: Record & Number_Records can be used together to specify a range of records to be read. Author: Davin Larson - 2006 Side Effects: Data is returned in pointer variables. Calling routine is responsible for freeing up heap memory - otherwise a memory leak will occur. $LastChangedBy: davin-mac $ $LastChangedDate: 2014-06-04 08:35:27 -0700 (Wed, 04 Jun 2014) $ $LastChangedRevision: 15302 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/CDF/cdf_load_vars.pro $
Parameters
- files
Keywords
- varnames
- varformat
- info
- verbose
- all
- record
- convert_int1_to_int2
- spdf_dependencies
- var_type
- no_attributes
- number_records
File attributes
Modification date: | Mon Jun 9 05:59:05 2014 |
Lines: | 144 |