Data model

Contents

Overview

The primary data model for SPEDAS is built around tplot-variables. Tplot-variables bind a name-string to a structure containing time series measurements with one or two structures storing heterogeneous metadata.

Getting, Storing, & Listing Tplot Data

At their core, tplot variables are binding of a name to zero to three structures of any type. The structures are called "data", "dlimits" and "limits".

To bind a name to zero to three structures:

SPEDAS> store_data,'no_structures' ;creates tplot variable names "no_structures" no associated structures.
SPEDAS> store_data,'one_structure',data={hello:'world'} ;creates a tplot variable named "one_structure" with a data structure
SPEDAS> store_data,'two_structures',data={x:0},limits={y:0} ;creates a tplot variable named "two_structures" with a data and a limits structure
SPEDAS> store_data,'three_structures',data={x:0},limits={height:7,width:9},dlimits={goodbye:'world'} ; creates a tplot variable named "three_structures" with all three structures

At any time you can see what tplot_variables you have stored in memory using the tplot_names command.

Line Data

One dimensional tplot variables are generally intended for line plotting. To be compatible with SPEDAS routines, the name conventions for structure fields must be followed. The data structure for the tplot variable must have two fields.
"x": A 1-d array of SPEDAS times
"y": A 1-d or 2-d array of numeric data. The first dimension of the array, must have the same number of elements as "x"

As in the first example, the x field stores the times associated with each sample, but this data associates 3 measurements with each time.

Spectral Data

Two dimensional tplot data are generally treated as spectral data, but they can also be interpreted in other ways, depending on the processing or analysis routine that they're used with.(e.g. as map data) To be compatible with SPEDAS routines, the name conventions for structure fields must be followed. The data structure for the tplot variable must have two or three fields.

"x": A 1-d array of SPEDAS times
"y": A 2-d array of numeric data. The first dimension of the array, must have the same number of elements as "x"
"v"(optional): A 1-d or 2-d array of numeric data. If 1-d the number of elements of "v" must match the number of elements in the second dimension of "y". If 2-d, "v" must have the same dimensions as "y". If omitted. Data are assumed to be evenly distributed in the second axis.

To be interpreted as spectral data, the dlimits or limits structure for the variable should also have the field "spec:1".