This page was created by the IDL library routine mk_html_help2.

Last modified: Fri Sep 19 14:20:01 2014.


Directory Listing of Routines


Routine Descriptions

CDF2IDLTYPE

[Next Routine] [List of Routines]
NAME:
 cdf2idltype
PURPOSE:
 Return an IDL type number given a CDF data type
CALLING SEQUENCE:
 idl_type = cdf2idltype(code)
INPUT:
 code = the CDF data type code for that variable
OUTPUT:
 idl_type = the type number for the appropriate IDL variable
 CDF_TYPE      IDL_TYPE
'CDF_UINT1'    1 (byte)
'CDF_UCHAR'    1 (byte)
'CDF_BYTE'     2 (int)
'CDF_INT1'     2 (int)
'CDF_INT2'     2 (int)
'CDF_INT4'     3 (long)
'CDF_FLOAT'    4 (float)
'CDF_REAL4'    4 (float)
'CDF_DOUBLE'   5 (double)
'CDF_REAL8'    5 (double)
'CDF_CHAR'     7 (string)
'CDF_UINT2'    12 (unsigned int)
'CDF_UINT4'    13 (unsigned long)
'CDF_INT8'     14 (long64)
'CDF_UINT8'    15 (unsigned long64)
 There are some CDF types that have no corresponding IDL type,
 e.g., CDF_BYTE and CDF_INT1 are signed bytes, here we return a type
 code of 2 (signed integer), The EPOCH and TT2000 are not handled
 here, and will return a code of 0
HISTORY:
 26-nov-2013, jmm, jimm@ssl.berkeley.edu
 $LastChangedBy: jimm $
 $LastChangedDate: 2013-11-26 12:22:47 -0800 (Tue, 26 Nov 2013) $
 $LastChangedRevision: 13597 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf2idltype.pro $

(See general/CDF/cdf2idltype.pro)


CDF2TPLOT

[Previous Routine] [Next Routine] [List of Routines]
CDF2TPLOT ,files,varformat=varformat

Keywords:
 
 VARFORMAT = PATTERN  ; PATTERN should be a string (wildcards accepted) that will match the CDF variable that should be made into tplot variables
 PREFIX = STRING      ; String that will be pre-pended to all tplot variable names. 
 SUFFIX = STRING      ; String appended to end of each tplot variable created.
 VARNAMES = named variable ; CDF variable names are returned in this variable
 /GET_SUPPORT_DATA    ; Often required to get support data if the CDF file does not have all the needed depend attributes
 
 record=record if only one record and not full cdf-file is requested

load_labels=load_labels ;copy labels from labl_ptr_1 in attributes into dlimits
         resolve labels implemented as keyword to preserve backwards compatibility 

Author: Davin Larson -  20th century

 $LastChangedBy: davin-mac $
 $LastChangedDate: 2014-06-14 12:58:32 -0700 (Sat, 14 Jun 2014) $
 $LastChangedRevision: 15373 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf2tplot.pro $

(See general/CDF/cdf2tplot.pro)


CDF_INFO

[Previous Routine] [Next Routine] [List of Routines]
NAME:  cdf_info
FUNCTION:   cdf_info(id)
PURPOSE:
  Returns a structure with useful information about a CDF file.
  In particular the number of file records is returned in this structure.
INPUT:
   id:   CDF file ID.
CREATED BY:    Davin Larson
 LAST MODIFIED: @(#)cdf_info.pro    1.9 02/11/01
 $LastChangedBy: egrimes $
 $LastChangedDate: 2014-05-29 12:20:42 -0700 (Thu, 29 May 2014) $
 $LastChangedRevision: 15257 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf_info.pro $

(See general/CDF/cdf_info.pro)


CDF_INFO_TO_TPLOT

[Previous Routine] [Next Routine] [List of Routines]
 This is a new routine that needs further testing, development, and enhancements.
 PROCEDURE:  cdf2tplot, cdfi
 Purpose:  Creates TPLOT variables from a CDF structure (obtained from "CDF_LOAD_VAR")
 This routine will only work well if the underlying CDF file follows the SPDF standard.

 Written by Davin Larson

 $LastChangedBy: pcruce $
 $LastChangedDate: 2014-02-28 16:39:25 -0800 (Fri, 28 Feb 2014) $
 $LastChangedRevision: 14473 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf_info_to_tplot.pro $

(See general/CDF/cdf_info_to_tplot.pro)


CDF_LOAD_VARS

[Previous Routine] [Next Routine] [List of Routines]
 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/tags/spedas_1_00/general/CDF/cdf_load_vars.pro $

(See general/CDF/cdf_load_vars.pro)


CDF_SAVE_VARS

[Previous Routine] [Next Routine] [List of Routines]
 FUNCTION: dummy = cdf_save_vars(cdf_structure,new_cdf_name)
 PURPOSE:  To dump data and metadata from an IDL structure into a CDF file.
		The structure format is the structure produced by cdf_load_vars.pro
 INPUTS:   cdf_structure : IDL structure defined by cdf_load_vars.pro
	    new_cdf_name  : a string to name the new CDF file with
 OUTPUTS:  CDF file named by the new_cdf_name input
 EXAMPLE:  dummy = cdf_save_vars(cdfi,'newcdf.cdf')

 Written by: Matt Davis  

Note: To use this routine you must have the CDF_EPOCH/CDF_EPOCH16 bug patch on your IDL6.3
and if you are using Solaris you need to be in 32-bit mode NOT 64-bit (ie, idl -32)

(See general/CDF/cdf_save_vars.pro)


CDF_SET_CDF27

[Previous Routine] [Next Routine] [List of Routines]
 NAME: cdf_set_cdf27
 SYNTAX: 
   cdf_set_cdf27 [, /yes | /no]
 PURPOSE:
   Call CDF_SET_CDF27_BACKWARD_COMPATIBLE but don't bomb unnecessarily when
   run on an (unpatched) pre-IDL 6.3, pre-CDF 3.1 installation of IDL.
 VERSION:
   $LastChangedBy: kenb-mac $
   $LastChangedDate: 2006-12-13 11:21:07 -0800 (Wed, 13 Dec 2006) $
   $LastChangedRevision: 88 $
   $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf_set_cdf27.pro $

(See general/CDF/cdf_set_cdf27.pro)


CDF_VAR_ATTS

[Previous Routine] [Next Routine] [List of Routines]
NAME:  cdf_var_atts
FUNCTION:   cdf_var_atts(id [,var[,attname]])
PURPOSE:
  Returns a structure that contains all the attributes of a variable within
  a CDF file. If attname is provided then it returns the value of only that attribute.
KEYWORDS:
  DEFAULT: The default value of the attribute.
  ATTRIBUTES=att  A named variable that returns an array of structures containing attribute info
                  if this variable is passed in on subsequent calls to cdf_var_atts it can significantly
                  improve performance.   OBSOLETE!!!
USAGE:
   atts = cdf_var_atts(file)  ; returns structure containing all global attributes
   atts = cdf_var_atts(file
INPUT:
   id:         CDF file ID or filename.
   var;        CDF variable name or number
   attname:    CDF attribute name
CREATED BY:    Davin Larson
 $LastChangedBy: jimm $
 $LastChangedDate: 2014-05-20 10:05:23 -0700 (Tue, 20 May 2014) $
 $LastChangedRevision: 15173 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/cdf_var_atts.pro $

(See general/CDF/cdf_var_atts.pro)


IDL2CDFTYPE

[Previous Routine] [Next Routine] [List of Routines]
NAME:
 idl2cdftype
PURPOSE:
 Given an IDL variable, return the appropriate CDF type code
CALLING SEQUENCE:
 code = idl2cdftype(var, format_out=format_out,
        fillval_out=fillval_out, validmin_out=validmin_out,
        validmax_out=validmax_out)
INPUT:
 var = an IDL variable
OUTPUT:
 code = the CDF data type code for that variable, if applicable, for
        objects, complex,  and similar vars a null string is returned.
    IDL_TYPE             CDF_TYPE
    1 (byte)             'CDF_UINT1'
    2 (int)              'CDF_INT2'
    3 (long)             'CDF_INT4'
    4 (float)            'CDF_FLOAT'
    5 (double)           'CDF_DOUBLE'
    7 (string)           'CDF_CHAR'
    12 (unsigned int)    'CDF_UINT2'
    13 (unsigned long)   'CDF_UINT4'
    14 (long64)          'CDF_INT8'
    15 (unsigned long64) 'CDF_UINT8'
KEYWORDS:
 format_out = return a format code for the data type
    1 (byte)             'I4'
    2 (int)              'I6'
    3 (long)             'I10'
    4 (float)            'E13.6'
    5 (double)           'E20.12'
    7 (string)           strlen(value)
    12 (unsigned int)    'I6'
    13 (unsigned long)   'I10'
    14 (long64)          'I20'
    15 (unsigned long64) 'I20'
 fillval_out = a fill value
    1 (byte)             255
    2 (int)              -32768
    3 (long)             -2147483648
    4 (float)            !values.f_nan
    5 (double)           !values.d_nan
    7 (string)           ''
    12 (unsigned int)    65535
    13 (unsigned long)   4294967295
    14 (long64)          -9223372036854775808
    15 (unsigned long64) 18446744073709551615
 validmin_out = a min value
    1 (byte)             0
    2 (int)              -32768
    3 (long)             -2147483648
    4 (float)            -1.0e38
    5 (double)           -1.0e308
    7 (string)           'NA'
    12 (unsigned int)    0
    13 (unsigned long)   0
    14 (long64)          -9223372036854775808
    15 (unsigned long64) 0
 validmax_out = a max value
    1 (byte)             255
    2 (int)              32767
    3 (long)             2147483647
    4 (float)            1.0e38
    5 (double)           1.0e308
    7 (string)           'NA'
    12 (unsigned int)    65535
    13 (unsigned long)   4294967295
    14 (long64)          -9223372036854775808
    15 (unsigned long64) 18446744073709551615
HISTORY:
 26-nov-2013, jmm, jimm@ssl.berkeley.edu
 $LastChangedBy: jimm $
 $LastChangedDate: 2014-05-23 12:24:27 -0700 (Fri, 23 May 2014) $
 $LastChangedRevision: 15221 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/tags/spedas_1_00/general/CDF/idl2cdftype.pro $

(See general/CDF/idl2cdftype.pro)


MAKE_CDF_INDEX

[Previous Routine] [Next Routine] [List of Routines]
NAME:
  make_cdf_index
PROCEDURE:
  make_cdf_index,  [pattern]
PURPOSE:
  Creates an index file for CDF files.
  The index file will have one line for each CDF file found.
  Each line contains the start time, end time and filename
  with the following format:
YYYY-MM-DD/hh:mm:ss  YYYY-MM-DD/hh:mm:ss   fullpathname.cdf
  CDF files may be distributed over many directories or disks.

INPUT:
  pattern:  (string) file pattern, default is:  '*.cdf'
KEYWORDS:
  DATA_DIREC  (string) data directory(s) 
  INDEX_FILENAME:  (string) Name of index file to be created.
  NO_DUPLICATES:   Set to 1 if duplicate days are to be ignored.
SEE ALSO:
  "makecdf","loadcdf","loadcdfstr","loadallcdf",
CREATED BY:
  Davin Larson,  August 1996
VERSION:
  02/04/17  make_cdf_index.pro  1.5

(See general/CDF/make_cdf_index.pro)


PRINT_CDF_INFO

[Previous Routine] [List of Routines]
PROCEDURE:     print_cdf_info
PURPOSE:   prints information about a specified cdf file
INPUT:
   filename: The name of the file for which info is desired.
KEYWORDS:
   none

CREATED BY:    D. Larson
LAST MODIFICATION:     @(#)print_cdf_info.pro 1.13 02/11/01

(See general/CDF/print_cdf_info.pro)