Data model: Difference between revisions

From SPEDAS Wiki
Jump to navigation Jump to search
(Basic tplot variables)
Line 3: Line 3:
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.   
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 ==
== 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".   
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".   

Revision as of 00:23, 22 August 2014

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.

SPEDAS> tplot_names
   1 no_structures    
   2 one_structure    
   3 two_structures   
   4 three_structures 

The structure data in tplot variables can be accessed using the get_data command.


SPEDAS> get_data,'no_structures',data=d
SPEDAS> help,d
D               LONG      =            0
SPEDAS> get_data,'three_structures',data=d,limits=l,dlimits=dl
SPEDAS> help,d
** Structure <4c80a938>, 1 tags, length=4, data length=4, refs=1:
   X               LONG      Array[1]
SPEDAS> help,l
** Structure <4d40bd48>, 2 tags, length=8, data length=8, refs=2:
   HEIGHT          LONG                 7
   WIDTH           LONG                 9
SPEDAS> help,dl
** Structure <f0cadb58>, 1 tags, length=16, data length=16, refs=2:
   GOODBYE         STRING    'world'

Tplot variables can be identified by name string or by number(from the tplot_names listing)

SPEDAS> get_data,2,data=d,limits=l
SPEDAS> help,d
** Structure <4c80a938>, 1 tags, length=16, data length=16, refs=1:
   HELLO           STRING    Array[1]
SPEDAS> help,l
L               LONG      =            0

One-dimensional Tplot Data

Two-dimensional Tplot Data

Importing Tplot Data into the SPEDAS GUI