Skip to content

Commit

Permalink
Add test exercising alternate varlable implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswilburlewis committed Jan 8, 2025
1 parent a8172fd commit 9c593b6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pyspedas/utilities/tests/plot_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,5 +468,31 @@ def test_save_with_plot_objects(self):
tplot('tha_pos',display=global_display,return_plot_objects=True, save_png='ret_plot_objs.png')
self.assertTrue(os.path.exists('ret_plot_objs.png'))

def test_erg_tplot_vlabels(self):
# Test alternate varlabel implementation from Tomo Hori
del_data("*")
import pyspedas

from pyspedas.projects.erg import mgf, orb
mgf()
orb()
from pytplot import tplot_options, options, tplot_names, split_vec, get_data, tplot_opt_glob, tnames

split_vec('erg_orb_l2_pos_rmlatmlt')
split_vec('erg_orb_l2_pos_Lm')
options('erg_orb_l2_pos_rmlatmlt_x', 'ytitle', 'R')
options('erg_orb_l2_pos_rmlatmlt_y', 'ytitle', 'Mlat')
options('erg_orb_l2_pos_rmlatmlt_z', 'ytitle', 'MLT')

var_label = ['erg_orb_l2_pos_Lm_x', 'erg_orb_l2_pos_rmlatmlt_x', 'erg_orb_l2_pos_rmlatmlt_y',
'erg_orb_l2_pos_rmlatmlt_z']
# tplot_options('var_label', var_label)

plot_vars = ['erg_mgf_l2_mag_8sec_sm', 'erg_mgf_l2_igrf_8sec_sm', 'erg_orb_l2_pos_Lm_x']

from pytplot import tplot_vl
fig = tplot_vl(plot_vars, var_label=var_label, display=global_display, save_png='erg_varlabel.png')


if __name__ == '__main__':
unittest.main()

0 comments on commit 9c593b6

Please sign in to comment.