Command line functions: Difference between revisions

From SPEDAS Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Command line vs GUI ==
SPEDAS can be used in two ways:
SPEDAS can be used in two ways:



Revision as of 21:19, 8 April 2016

Command line vs GUI

SPEDAS can be used in two ways:

  • The IDL command line
  • The SPEDAS GUI

Comparing the two, the command line is more powerful, it offers more options, and there are functions that have only command line representation without any equivalent GUI element. On the other hand, new users may find the GUI easier to work with.

To use the IDL command line, an IDL software license from Exelis (now Harris Geospatial) is required.

When working with SPEDAS, the workflow is usually the following:

  1. Load some data.
  2. Perform some transformations on the data.
  3. Make some plots.


Load data

SPEDAS can download data from several space missions. Each mission provides its own functions to load data. Each mission has its own directory in the "projects" folder and this directory contains the functions needed to load data. The files contain detailed information on the command line functions needed to load particular data and the parameters and keywords that the user can provide. Most of the time the user has to provide as parameters the dates and the instruments for which data should be loaded.

For example, to load FGM data for the probe 1 of the MMS mission, the command is:

mms_load_fgm, probe=1, trange=['2015-09-01/21:15', '2015-09-01/21:25'], level='l2'

This command line function will download the proper CDF files from a remote directory (usually using HTTP), read the downloaded files and load the data into an IDL object that is called tplot. This object is the heart of SPEDAS, it will hold all the data and it can be used to manipulate and plot the data.

To find the proper load function, the user can open the projects directory of the SPEDAS source code, find the proper source code file and read the comments at the beginning of the file. These commend should provide detailed explanations of the available options and in most cases they will also provide some examples of use.


Data analysis

After the data is loaded, it resides inside the tplot object and can be transformed and manipulated using the SPEDAS functions for data analysis or the functions provided by IDL itself. The results can again be saved inside the tplot object and can later be used for plotting data.


Plots

Data sets can be plotted, either as a single panel plots, or as multipanel plots. The tplot function can plot any number of data sets it contains.

For example, to load FGM data for the probe 1 of the MMS mission, the command is:

tplot, 'mms1_fgm_b_gsm_srvy_l2'


How to find which command line function to use

There are several options in order to find the relevant command line functions and their parameters and keywords:

  • Open the projects directory, find a file and read the source code comments at the beginning of the file.
  • Open the examples directory of a particular project and find a crib sheet to use as an example.
  • Browse or search the SPEDAS HTML documentation.