NASA Logo, National Aeronautics and Space Administration

Accessing CDAWeb Data From IDL

This page describes an IDL library that provides easy access to CDAWeb data from an IDL program.  With this library, an IDL user can retrieve data from CDAWeb by entering a single IDL command.  The data is automatically downloaded and read into an IDL structure (with its associated metadata/documentation) in the user's local IDL environment.  The user can then write their own IDL code to analyze or visualize the data.  There is also a GUI program to make discovering and retrieving CDAWeb data even easier.  Finally, there is an example program that demonstrates many of the lower-level calls for those who want to incorporate CDAWeb data access into a larger IDL program.

Preparation

  1. Determine if you need the CDF patch for IDL.
    • At the IDL command prompt, type help, /dlm, 'cdf'.
    • If the output shows version 3.4 or higher, you do not need the patch.
    • If the output shows a version less than 3.4, download and install the CDF patch for IDL.
  2. Download spdfcdas.sav
  3. Start IDL 7.0 or higher.
  4. IDL> restore, 'spdfcdas.sav'

"One-line" Data Access

  1. IDL> d = spdfgetdata('AC_H2_MFI', ['Magnitude' , 'BGSEc'], ['2009-06-01T00:00:00.000Z', '2009-06-03T00:00:00.000Z'])
Notes:

GUI Data Access

The purpose of this GUI is to allow the user to retrieve data from CDAWeb into their local IDL environment without having to know the values of the parameters (e.g., AC_K2_MFI, Magnitude, BGSEc, etc.) to the spdfGetData function.  Once the user selects the data they want from CDAWeb, this program can retrieve the data and place it in an IDL structure.  The user can then enter any IDL commands to analyze, alter, or visualize the data.
  1. IDL> spdfcdawebchooser
  2. Change the dataview if you wish
  3. Select one or more Mission Groups (e.g., ACE)
  4. Select one or more Instrument Types (e.g., Magnetic Fields)
  5. Select the Find Datasets button
  6. Select one or more variables from a single dataset (e.g., AC_K2_MFI: Magnitude, BGSEc)
  7. Enter a Start and Stop time
  8. Change the variable name if you wish
  9. Select the Get Data button
  10. IDL> help, data.varname.dat, /struct ; where varname is the name of a selected variable (e.g., data.magnitude.data)
  11. Perform any IDL operations on the data that you want (e.g. plot, data.magnitude.dat)
Notes:

"More complete" CDAWeb Access Example

  1. IDL> spdfcdaswsexample
Notes:

NASA Logo -
	    nasa.gov