Usage examples

From SPEDAS Wiki
Revision as of 21:24, 7 April 2016 by Nikos (talk | contribs)
Jump to navigation Jump to search

Some introductory scripts that you can use with IDL and SPEDAS.


MMS data analysis using SPEDAS: an introduction

This video shows a step-by-step introduction on how to use SPEDAS to make a simple plot:

http://www.youtube.com/watch?v=390FguKn7w4

This is the script that can be run in IDL:

pro test_mms1

 mms_init
 
 ; Select a time range
 trange = ['2015-09-01/21:15', '2015-09-01/21:25']

 ; Select a probe
 probe = 1

 ; Load FGM data
 mms_load_fgm, probe=probe, trange=trange, level='l2'

 ; Load position data
 mms_load_mec, probe=probe, trange=trange, level='l2'

 ; Select quantities to plot
 vars = ['mms1_fgm_b_gsm_srvy_l2', 'mms1_mec_r_gsm']

 ; Plot data
 tplot, vars

end

MMS multi-instrument plots

This video shows how to create multi-panel plots with SPEDAS and how to load data from multiple satellite probes:

http://www.youtube.com/watch?v=yV2NJeiIQsw

The scripts in this video are here:

Pro multiple_plot_test

 mms_init
 trange = ['2015-09-01/21:15', '2015-09-01/21:25']
 probes=['1']
 mms_load_fgm, probes=probes, trange=trange, level='l2'
 mms_load_fpi, probes=probes, trange=trange, level='l2', datatype=['des-moms', 'dis-moms'], data_rate='brst'

 join_vec, 'mms1_des_bulk'+['x', 'y', 'z']+'_dbcs_brst', 'mms1_des_bulk_vel_dbcs'
 join_vec, 'mms1_dis_bulk'+['x', 'y', 'z']+'_dbcs_brst', 'mms1_dis_bulk_vel_dbcs'

 store_data, 'mms1_des_temps_brst', data=['mms1_des_temppara_brst', 'mms1_des_tempperp_brst']
 store_data, 'mms1_dis_temps_brst', data=['mms1_dis_temppara_brst', 'mms1_dis_tempperp_brst']
 store_data, 'mms1_numberdensity_dbcs_brst', data='mms1_d'+['i', 'e']+'s_numberdensity_dbcs_brst'

 window, 1
 tplot, window=1, title='MMS data - Sept 1, 2015', ['mms1_fgm_b_gsm_srvy_l2', 'mms1_des_bulk_vel_dbcs', 'mms1_des_temps_brst', $
    'mms1_dis_temps_brst', 'mms1_numberdensity_dbcs_brst', 'mms1_des_energyspectr_omni_avg', 'mms1_dis_energyspectr_omni_avg']

 tlimit, trange, window=1
 makepng, "C:\mms\mms_2a", window=1

End

Loading and ploting data from multiple probes:

Pro multiple_plot_test2

 mms_init
 trange = ['2015-09-01/21:15', '2015-09-01/21:25']
 probes = ['1','2','3','4']

 mms_load_fpi, probes=probes, trange=trange, level='l2', datatype=['des-moms'], data_rate='brst'

 window, 1
 tplot, window=1, title='MMS data - Sept 1, 2015', ['mms1_des_energyspectr_omni_avg', $ 
     'mms2_des_energyspectr_omni_avg', 'mms3_des_energyspectr_omni_avg', 'mms4_des_energyspectr_omni_avg']

 tlimit, trange, window=1
 makepng, "C:\mms\mms_2b", window=1

End