SPEDAS training session– Beginner course –by ERG Science Center (ERG-SC)

T. Hori1) , S. Nakamura1) , S. Imajo1) , C. W. Jun1), M. Kitahara1),
M. Shoji1), S. Matsuda2), M. Teramoto3), K. Keika4) ,N. Umemura1), T. Segawa1) and Y. Miyoshi1)1)ERG Science Center, ISEE, Nagoya Univ.
2) Kyushu Institute of Technology,3)ISAS/JAXA, 4)Univ. of Tokyo
1

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterPurpose of this course} To get familiar with the SPEDAS scheme.
} To get you ready to use SPEDAS to analyze ERG

data.

2

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

What will you be doing in this training?
} Learn about the data model employed by SPEDAS.
} Load/manipulate/visualize ERG satellite and otherground data.

3

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

What's SPEDAS?

5SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSpace Physics Environment Data Analysis
Software (SPEDAS)
SPEDAS frameworkDatarepository

CDF

CDF

CDF
Van Allen
Probes

CDF

ERG satellite
data
Each project
develops andreleases APIs toautomaticallydownload and readeach project data

CDF

ERG-related groundobservation
network data
CDF
HDF?

CDF

ERG simulation/ modeling data
ERG-SC develops dataarchives and APIs to readthe data from SPEDAS

6SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

What can you do with SPEDAS?
} time-series plots} filtering of data
} frequency analysis} mapping to the ground maps
} …

7

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterBasics of SPEDAS:
tplot and tplot variable

8

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterA few basics of IDL before entering SPEDAS…
Insert a comma ( , ) between a command, its arguments, and keywords.

}

IDL> tplot , 1 , title='New plot'

A string is expressed as a text sandwiched by delimeters ( ' ) or ( " ).

}IDL> print, 'This is a text.'

An array is expressed as comma-separated elements that are bracketed.

}

IDL> arr1 = [ 2, 3, 4, 5 ]IDL> string_arr1 = [ 'text1', 'text2', 'text3' ]Typical errors beginners often encounter:}% Attempt to call undefined procedure: '????'.
à command/routine name (????) is misspelled.
% Syntax error.
à , ' ( ) [ ] is missing or mismatched in most cases.

Use Up arrow key to reuse previously typed commands. You can edit
them with Left/Right arrow, Backspace keys and execute!

}

9

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

How SPEDAS works?
One of the simplest procedures would be:
Run IDL
Initialize the SPEDAS environment on IDL
Set a date/time range for which data are loaded.
Load data

1.
2.
3.
4.

(Manipulate the loaded data)

5.

Plot the data

6.

10

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

How SPEDAS works?
In SPEDAS command lines,
prompt> idl
IDL> erg_init
ERG> timespan, '2017-05-27', 07
ERG> erg_load_mgf(manipulate tplot variables)

ERG> tplot, ['erg_mgf_l2_mag_8sec_dsi', 'erg_mgf_l2_magt_8sec' ]11

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSet a date/time range
ERG> timespan, timestr, N, option
timestr : a string expressing a particular date/timein UTC in the format of 'yyyy-mm-dd/hh:mm:ss'
N : number of time length (Default: 1)
option : unit (/day, /hour, /min, /sec, Default: /day)

For 1 day from 2017-05-27/00:00:00 UTC
ERG> timespan, '2017-05-27'
For 90 min from 2017-05-29/03:25:30 UTC
ERG> timespan, '2017-05-29/03:25:30', 90, /min
12

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Centertplot variable as the primary data model} 'erg_mgf_l2_mag_8sec_dsi' in prev. page is called

tplot variable.
} "Tplot variables" bind an indexed name-string to adata structure on IDL containing time-series datawith metadata.
SPEDAS session#1 'tplot var. name 1'#2 'tplot var. name 2'

13

Memory space of IDL
timeseries
data 1Time
array

metadata

timeseries
data 2

Dat
aarr
ay

Time
array

Dat
aarr
ay

metadata

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Ex: How the MGF load procedure works
SPEDAS session
Request to download

yo
ur
P

C

ERG> erg_load_mgf

CD
St
or
e

load as tplot vars.

F

fil
e

on

erg_mgf_l2_mag_8sec_ds
i…

erg_mgf_l2_8sec_20170501_v03.04.c
df
・
・
・

14

1 year latency for each ERG productsàWorking group password is required
for the data within 1 year after
observation.

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Data Products of Arasen

Overview of the ERG projectnnMiyoshi et al., EPS, 2018a

ERG Science Center
n

n
n
n

Miyoshi et al., EPS, 2018b

Orbit（predict/definitive, L2/L3）
Attitude（L2）
MGF（pre/L2）nn

PWE（pre/L2/L3）nKasahara et al., EPS, 2018
Kumamoto et al., EPS, 2018
Ozaki et al., EPS, 2018
Matsuda et al., EPS, 2018
Kasaba et al., EPS, 2017n

Mitani et al., EPS, 2018

n
n
n
n

n
n
n

XEP（L2/L3/L4）
HEP (HEP-H/HEP-L, pre/ L2/L3/L4)
MEPi(pre/L2/L3/L4)
n

n
n
n

15

Matsuoka et al., EPS, 2018

Yokota et al., EPS, 2017

MEPe(pre/L2/L3/L4)nKasahara et al., EPS, 2018nKazama et al., EPS, 2017

LEPi(pre/L2/L3/L4)nAsamura et al., EPS, 2018
LEPe(pre/L2/L3/L4)

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterListing tplot data & viewing the content
ERG> tplot_names
ERG> print_tinfo, 'erg_mgf_l2_mag_8sec_dsi'

All tplot variables
are listed withunique index
numbers
16

The actual data structure bound to tplot variable'erg_mgf_l2_mag_8sec_dsi' is shown.

X: time array containing time labels in decimal UNIX time
Y: data array, in this case, a 2-D array of time x 3-components

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterListing tplot data & viewing the content
ERG> tplot_names, 'erg_mgf_l2_mag_8sec_dsi', /verbose
ERG> tplot_names, 1, /v

Metadata (informationon the data) are dumped.

RULES_OF_USE carries"rules of the road" inusing the data.
17

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Rules of the Road

• All data users should follow
the Rules of the road.
• Users are encouraged toreport any suspicious data
to the PI. (erg_xxx_info@isee.nagoya-u.ac.jp)
18

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Plotting a tplot data by tplot
Tplot with tplot variable names (string)
ERG> tplot, 'erg_mgf_l2_mag_8sec_dsi'
ERG> tplot, [ 'erg_mgf_l2_mag_8sec_dsi' , 'erg_mgf_l2_mag_8sec_gse' ]Tplot with the index number of a tplot variable
ERG> tplot, 1
With an array of variable indices to combine multiple variable in a single plot window
ERG> tplot, [2,1]Some wildcards can be used
ERG> tplot, 'erg_mgf_l2_mag_8sec_*'

Tplot accepts variables asarguments in various formats.

19

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterDecorate the plot panel for each tplot variableoptions, varname, option1='…', option2='…', …
varname: tplot variable name (wildcards accepted)
option?: name of tplot variable attribute

ERG> options, 'erg_mgf_l2_mag_8sec_gse', ytitle= 'Arase mag' , ysubtitle='[nT]'
ERG> options, 'erg_mgf_l2_mag_8sec_*', labels=['Bx-comp', 'By-comp', 'Bz-comp' ]ERG> tplot, 'erg_mgf_l2_mag_8sec_gse'

ytitle,ysubtitlelabels20

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSeparate a tplot variable with vector data
ERG> split_vec, 'erg_mgf_l2_mag_8sec_gse'
STORE_DATA(260): Creating tplot variable: 19 erg_mgf_l2_mag_8sec_gse_x
STORE_DATA(260): Creating tplot variable: 20 erg_mgf_l2_mag_8sec_gse_y
STORE_DATA(260): Creating tplot variable: 21 erg_mgf_l2_mag_8sec_gse_z
ERG> tplot, 'erg_mgf_l2_mag_8sec_gse_?'split_vec takes a tplot variablewith vector or array data tocreate new tplot variables
containing each component of
the vector/array data.

21

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterChange the time range of a plot
Select a time period by mouse-clicks on the plot window
ERG> tlimit
Specify a time period explicitly

ERG> tlimit, '2017-05-29/03:30' , '2017-05-29/08:30'
Back to the last plot period
ERG> tlimit, /last

Restore the original plot periodthat was set by timespan
ERG> tlimit, /full

22

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterChange the vertical scale of a plot
ylim, varname, ymin, ymax, logflag

varname : variable name(s)ymin/ymax : lower/upper limit along vertical axis
set both to 0 (zero) for plotting with auto-scale
logflag : set 0 (zero) for plotting on a linear scale, or 1 for a log scale

ERG> ylim, 'erg_mgf_l2_mag_8sec_gse_x', 180,250,
ERG> tplot

0

Zoomed in a more limited
range in the vertical scale.

Tips:
Putting 0 for both ymin and ymax
sets the y range to auto-scale.
ERG> ylim, 'thg_mag_atha_x', 0, 0

23

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterDump to png, postscript, and Ascii files
To a png file or postscript file
ERG> cwd;Display the current directory
CWD(25): Directory changed to: /yyyy/xxxx
ERG> tplot, 'erg_mgf_l2_mag_8sec_gse_?'
ERG> makepng, 'erg_mgf_plot';à erg_mgf_plot.png/yyyy/xxxx/erg_mgf_plot.png

ERG> popen, 'erg_mgf_plot'
ERG> tplot;Redo the last plot
ERG> pclose; à erg_mgf_plot.ps

Dump the data content of a tplot variable to a Ascii file
ERG> tplot_ascii, 'erg_mgf_l2_mag_8sec_gse';--> erg_mgf_l2_mag_8sec_gse.txt

24

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

SPEDAS manual viewed by web browsers}

Open/YOUR_SPEDAS_DIR/idl/_spd_doc.html

with your web browser to view
the automatically generated
documents for SPEDAS
routines.

25

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterBasics of SPEDAS:
Various filtering routines for tplot data

26

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Centerboxcar-average data– avg_data –avg_data, 'varname', timebin
varname: tplot variable names or index numbers
timebin : a time window in sec with which the boxcar-averaging is applied to the data
ERG> del_data, '*'Remove all tplot variables
ERG> timespan, '2017-05-29-03:30',70,/minand reload the data
ERG> erg_load_mgf
ERG> split_vec, 'erg_mgf_l2_mag_8sec_gse'
ERG> avg_data, 'erg_mgf_l2_mag_8sec_gse_x' , 600.
ERG> tplot, ['erg_mgf_l2_mag_8sec_gse_x', 'erg_mgf_l2_mag_8sec_gse_x_avg' ]The data boxcaraveraged with a timebin of 600 second
As a result, the number of data points
is reduced to every 600 s.

27

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSmoothing data – tsmooth_in_time –tsmooth_in_time, 'varname', timebin
varname : tplot variable name(s)timebin : time window in second for running average

ERG> tsmooth_in_time, 'erg_mgf_l2_mag_8sec_gse_x', 600.
ERG> tplot_names… … … …
19 erg_mgf_l2_mag_8sec_gse_x… … … …
23 erg_mgf_l2_mag_8sec_gse_x_smoothed
ERG> tplot, [ 19 , 23 ]The data is running-averaged with atime window of 600 second. We canuse this as a rough low-pass filter.
Note that the number of data points
is conserved.
28

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

High-pass filter in time – thigh_pass_filter –thigh_pass_filter, 'varname', timebin
varname : tplot variable name(s)timebin : time window in second for running average

ERG> thigh_pass_filter, 'erg_mgf_l2_mag_8sec_gse', 600.
ERG> tplot_names… … … …
2 erg_mgf_l2_mag_8sec_gse… … … …
24 erg_mgf_l2_mag_8sec_gse_hpfilt

ERG> tplot, [ 2 , 24 ]Time variations with periods shorter
than 600 sec are shown.
Actually this command just subtracts
the low-pass-filtered values derived
with tsmooth_in_time from theoriginal data, not uses any digital
filtering process such as FFT.
29

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterBasics of SPEDAS:
Frequency analysis of tplot data

30

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Dynamics spectra – tdpwrspc–
tdpwrspc, 'varname'varname : tplot variable name(s)ERG> tdpwrspc, 'erg_mgf_l2_mag_8sec_gse_hpfilt'
ERG> tplot_names… … … …
25 erg_mgf_l2_mag_8sec_gse_hpfilt_x… … … …
28 erg_mgf_l2_mag_8sec_gse_hpfilt_ _x_dpwrspc
ERG> tplot, [ 25, 28 ]ERG> tlimit,'2017-05-29/03:00','2017-05-29/08:00'

FFT with the hanning window
is applied to derive dynamic
frequency spectra of the data.

31

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterWavelet analysis – wav_data –wav_data, 'varname'varname : tplot variable name(s)wav_data accepts data with less than 32768
samples. The number of data points is
reduced as done with avg_data in this case.

ERG> wav_data, 'erg_mgf_l2_mag_8sec_gse_hpfilt_x'
STORE_DATA(260): Creating tplot variable: 31 erg_mgf_l2_mag_8sec_gse_hpfilt_x_wv_pow
ERG> zlim, 31, 1, 1000, 1
ERG> tplot,['erg_mgf_l2_mag_8sec_gse_hpfilt_x','erg_mgf_l2_mag_8sec_gse_hpfilt_x_wv_pow']

Wavelet analysis is applied toderive dynamic spectra of the data.
zlim is similar to "ylim"
command, but set the lower/upper
limit of the color scale for aspectrum-type plot.

32

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Other information sources for SPEDAS}SPEDAS wiki}

http://spedas.org/wiki/index.php?title=Main_Page}}

Change log of the source repository for the bleeding edge of SPEDAS}}

http://spedas.org/changelog/

Crib sheets for TPLOT in Your_SPEDAS_dir/idl/general/examples/
}
}
}
}
}
}

}

User's guide, Plug-in developer's guide, tips and tricks, The list of available crib sheets, …

crib_tplot.pro -- basic tplot intro
crib_tplot_annotation.pro -- How to control annotations in tplot (labels, text,
etc...)
crib_tplot_export_print.pro -- How to export tplot data and tplot plots
crib_tplot_layout.pro -- How to control tplot plot layouts
crib_tplot_range.pro -- How to control the range and scaling of tplot plots
crib_tplot_ticks.pro -- How to control tplot plot ticks. (location, size, etc...)SPEDAS-J wiki (for Japanese SPEDAS user)}

33

https://github.com/spedas-j/member_contrib/wiki
SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Other information sources for Arase} ERG-SC web page (incl. ERG plug-in and data download

pages.)}

https://ergsc.isee.nagoya-u.ac.jp} ERG-SC wiki}

34

https://ergsc.isee.nagoya-u.ac.jp/mw/index.php/Main_Page

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSample cases of ERG data analysis

35

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Data analysis:
3-day plot of HEP data and geomag. indices
ERG> timespan, '2017-06-16', 3, /dayLoad HEP data

ERG> erg_load_hep, datatype='omniflux'
Load other index data

ERG> omni_hro_load, /res5min
ERG> tplot,[ 'OMNI_HRO_5min_SYM_H' , 'OMNI_HRO_5min_AL_INDEX' ,'erg_hep_l2_FEDO_*' ]36

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOnboard instrument data:

Coordinate transformation of MGF data
Coordinate transformation (SGA, SGI, DSI, J2000)
From J2000 to the geophysical coordinates -------> using “cotrans”

ERG> timespan, '2017-03-28' & erg_load_orb & erg_load_mgf
ERG> erg_cotrans, 'erg_mgf_l2_mag_8sec_dsi', 'mgf_j2000',in_coord='dsi',

out_coord='j2000'

Coordinate transformation (SM<-->J2000)

ERG> spd_cotrans, 'mgf_j2000', 'mgf_gsm', in_coord='j2000', out_coord='gsm'
ERG> tplot, ['mgf_gsm', 'erg_orb_l2_pos_blocal']

37

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Data analysis:
Frequency analysis of MGF data
Please prepare a tplot variable "mgf_sm" containing the magnetic field
vectors in SM coordinates for March 28 (hint: See the prev. page!)
ERG> timespan, '2017-03-28', 1, /dayDynamic spectra by FFT with the Hanning window
ERG> tdpwrspc, 'mgf_sm'
ERG> wav_data, 'mgf_sm_z' Dynamic spectra by a wavelet analysis
ERG> tplot,'mgf_sm_z*'

Use tlimit to zoom in aperiod between perigee
points!

38

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOnboard instrument data:
Level-2 particle omni-flux data;; Set the time spantimespan, '2017-04-19';; Load data
erg_load_xep, datatype='omniflux'
erg_load_hep, datatype='omniflux'
erg_load_mepe, datatype='omniflux'
erg_load_lepe, datatype='omniflux'
erg_load_mepi_nml, datatype='omniflux'
erg_load_lepi_nml, datatype='omniflux'
tplot_names
tplot,[ 'erg_xep_l2_FEDO_SSD', $'erg_hep_l2_FEDO_H','erg_hep_l2_FEDO_L', $'erg_mepe_l2_omniflux_FEDO', $'erg_lepe_l2_omniflux_FEDO', $'erg_mepi_l2_omniflux_FPDO', $'erg_lepi_l2_omniflux_FPDO'

39]

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterChange the time range of a plot: tlimit
Select a time period by mouse-clicks on the plot window
ERG> tlimit
Specify a time period explicitly

ERG> tlimit, '2017-04-19/00:00' , '2017-04-19/08:00'
Back to the last plot period
ERG> tlimit, /last

Restore the original plot periodthat was set by timespan
ERG> tlimit, /full

40

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOnboard instrument data:
Add MGF data with /add keyword
Load MGF data and add it to the pre-existing particle plot

ERG> erg_load_mgf
ERG> tplot, 'erg_mgf_l2_mag_8sec_sm' , /add

41

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOrbit data:
Set time range and load ERG orbit data
Setup the time range (‘YYYY-MM-DD/hh:mm:ss’)

ERG> del_data,’*'ERG> timespan,'2017-03-28/00:00:00',3,/day
Load orbit data

ERG> erg_load_orb
ERG> tplot_names(*) Using the IGRF model("erg_orb_l2" means ERG Level-2 orbit data)42

pos_gse/gsm/sm

s/c position [Re] in GSE, GSM, SM coordinates

pos_rmlatmlt

Radial distance [Re], magnetic latitude [deg], local time [hr]of s/c position

pos_eqs/c position mapped to the magnetic equator

pos_iono_north/south

Geographic latitude and longitude [deg] of s/c footprints at
100 km altitude in the northern/southern hemisphere

pos_blocal / blocal_mag

model B-field vector (blocal) and B-field strength(blocal_mag) [nT] at s/c position

pos_beq / beq_mag

model B-field vector (beq) and B-field strength (beq_mag)[nT] at s/c position mapped to the magnetic equator

pos_Lm

McIlwain's L-parameter of s/c position for pitch angles of90, 60, and 30 deg

vel_gse/gsm/sm

s/c orbital velocity [km/s] in GSE, GSM, and SM

man_prep/man_on/eclipse_flag

flag for maneuver preparation (man_prep), maneuveron/off (man _on), and solar eclipse (eclipse)

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOrbit data:
Definitive orbit as a time series plot: tplot,

tplotxy

Plot orbit time series data

ERG> tplot, 'erg_orb_l2_pos_gsm'
Plot orbit data in the X-Y plane.

ERG> tplotxy, 'erg_orb_l2_pos_gsm'

43

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterSeparate a tplot variable with vector data:

split_vec

ERG> split_vec, 'erg_orb_l2_pos_rmlatmlt'
STORE_DATA(264): Creating tplot variable: ...
STORE_DATA(264): Creating tplot variable: ...
STORE_DATA(264): Creating tplot variable: ...
ERG> tplot, 'erg_orb_l2_pos_rmlatmlt_?'

split_vec takes a tplot variablewith vector or array data tocreate new tplot variables
containing each component of
the vector/array data.

44

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterOrbit data:
Insert orbit values below a time-series plot
ERG> set_erg_var_label
ERG> tplot, 'erg_orb_l2_pos_gsm'

Using subroutine to add labels(Lm,MLT,MLAT) with time

ERG> split_vec, 'erg_orb_l2_pos_rmlatmlt'
ERG> options, 'erg_orb_l2_pos_rmlatmlt_x', ytitle='R'
ERG> options, 'erg_orb_l2_pos_rmlatmlt_y', ytitle='MLAT'
ERG> options, 'erg_orb_l2_pos_rmlatmlt_z', ytitle='MLT'
ERG> tplot_options, var_label=['erg_orb_l2_pos_rmlatmlt_z','erg_orb_l2_pos_rmlatmlt_y', 'erg_orb_l2_pos_rmlatmlt_x']

An example to add
new labels(R,MLAT,MLT)

ERG> tplot ;just type "tplot" to replot the previous panels(Lm, MLAT, MLT)

45

(R, MLT, MLAT)SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterAppendix 1:
Access the data structure in a tplot variable andcreate a new tplot variable (get_data, store_data)

46

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterAccess the data structure in a tplot variable– get_data –ERG> get_data, 'thg_mag_atha', data=data, dlimits=dlimits, lim=lim
data: the data structure is stored
dlimits: most of metadata are stored
lim: some plot properties are stored
ERG> help, data.x , data.y"get_data" extracts the data
structure of a tplot variable andsaves in a structure "data" of IDL
session in the above case, so thatusers can access them by referring
to as "data.x" or "data.y", forexample.
47

The information on the original CDF
data file (CDF) and metadata, andvarious plot properties are extracted
into a structure "dlimits".

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Create a new tplot variable– store_data –ERG> store_data, 'varname' , data = { x:timearr, y:datarr }varname: name of a newly created tplot variabletimearr: 1-D array containing time values in SPEDAS time of time-series datadatarr: 1-D or 2-D array containing the data values of time-series data. The size of 1st
dimension should be identical to that of timearr.

}}}

SPEDAS time is the UNIX time in double-precision floating-point values. UNIX timeis the elapsed second since 00:00 UTC on January 1, 1970.
Usually we use time_double() function to calculate a SPEDAS time value from atime string such as '2017-06-16/12:30:00'.
SPEDAS time values can easily be converted to time strings with time_string()
function.

Please refer to the SPEDAS wiki at
http://spedas.org/wiki/index.php?title=Time_handlingfor more details of the time handling in SPEDAS.

48

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science CenterAppendix 2:
Various options for SPEDAS use

49

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center

Options for SPEDAS use}

Using SPEDAS source code
}
}
}
}

}

Using SPEDAS save file
}
}
}
}

}

binary files working with the IDL virtual machine (IDL-VM) environment
IDL-VM can be downloaded for free from Exelis/Harris Geospatial.
No command-line tools: only GUI is available.
only plug-ins implemented to the save file are available for use. Somelatest plug-ins may not be included yet.

Using SPEDAS executable files}}

All SPEDAS IDL source code including both the command-line tools
and graphical user interface (GUI) tools.
To use it, you need to have IDL installed with a proper license.
The latest plug-ins can be used by installing by yourself.
Users can develop, edit, and run their own scripts.

A package bundling IDL-VM and the SPEDAS save file, basicallyequivalent to the above.

We use the source code version in this training session.
50

SPEDAS training session, PWING-ERG conference @online

Mar. 8, 2021

© 2021 ERG Science Center