Esempio n. 1
0
def ex_spectra():
    # Delete any existing pytplot variables
    pytplot.del_data()
    # Download THEMIS data for 2015-12-31
    pyspedas.load_data('themis', ['2015-12-31'], ['tha'], 'sst', 'l2')
    # Specify options
    pytplot.tplot_options('title', 'tha_psif_en_eflux 2015-12-31')
    pytplot.ylim('tha_psif_en_eflux', 10000.0, 10000000.0)
    pytplot.options('tha_psif_en_eflux', 'colormap', 'viridis')
    # Plot spectrogram
    pytplot.tplot(['tha_psif_en_eflux'])
Esempio n. 2
0
def ex_omni():
    # Print the installed version of pyspedas
    pyspedas.version()
    # Delete any existing pytplot variables
    pytplot.del_data()
    # Download OMNI data for 2015-12-31
    pyspedas.load_data('omni', ['2015-12-31 00:00:00', '2016-01-01 23:59:59'],
                       '', '', '1min')

    # Plot
    pytplot.tplot_options('title', 'OMNI flow_speed 2015-12-31 to 2016-01-01')
    pytplot.tplot(['flow_speed'])
Esempio n. 3
0
def ex_analysis():
    # Print the installed version of pyspedas
    pyspedas.version()
    # Delete any existing pytplot variables
    pytplot.del_data()
    # Download THEMIS state data for 2015-12-31
    pyspedas.load_data('themis', '2015-12-31', ['tha'], 'state', 'l1')
    # Use some analysis functions on tplot variables
    pyspedas.subtract_average('tha_pos')
    pyspedas.subtract_median('tha_pos')
    # Plot
    pytplot.tplot(["tha_pos", "tha_pos-d", "tha_pos-m"])
Esempio n. 4
0
def ex_basic():
    # Delete any existing pytplot variables
    pytplot.del_data()
    # Download THEMIS state data for 2015-12-31
    time_range = ['2015-12-31 00:00:00', '2016-01-01 12:00:00']
    pyspedas.load_data('themis', time_range, ['tha'], 'state', 'l1')
    # Get data into python variables
    alldata = pytplot.get_data("tha_pos")
    time = alldata[0]
    data = alldata[1]
    # Store a new pytplot variable
    pytplot.store_data("tha_position", data={'x': time, 'y': data})
    # Define the y-axis limits
    pytplot.ylim('tha_pos', -23000.0, 81000.0)
    pytplot.ylim('tha_position', -23000.0, 81000.0)
    pytplot.ylim('tha_vel', -8.0, 12.0)
    # Plot position and velocity using the pyqtgraph library (default)
    pytplot.tplot(["tha_pos", "tha_position", "tha_vel"])
Esempio n. 5
0
def ex_gmag():
    # Delete any existing pytplot variables
    pytplot.del_data()
    # Define list of dates
    time_list = ['2015-12-31']
    # Get a list of EPO gmag stations
    sites = pyspedas.gmag_list(group='epo')
    # Download gmag files and load data into pytplot variables
    pyspedas.load_data('gmag', time_list, sites, '', '')
    # Get a list of loaded sites
    sites_loaded = pyspedas.tplot_names()
    # Subtact mean values
    pyspedas.subtract_average(sites_loaded, '')
    # Download AE index data
    pyspedas.load_data('gmag', time_list, ['idx'], '', '')
    # Plot
    sites_loaded = pyspedas.tplot_names()
    pytplot.tplot_options('title', 'EPO GMAG 2015-12-31')
    pytplot.tplot(sites_loaded)
Esempio n. 6
0
# and the version of the installed pyspedas package, using the function version().
version()

####################################################################################
# Delete any existing pytplot variables
del_data()

####################################################################################
# Define a time range. Here, we pick a time range that spans one and a half day.
time_range = ['2015-12-31 00:00:00', '2016-01-01 12:00:00']

####################################################################################
# Download THEMIS state data and store it into the pytplot object.
# This following function downloads all the necessary files, loads data,
# and time-clips data to the specified time range.
load_data('themis', time_range, ['tha'], 'state', 'l1')

####################################################################################
# Get data from pytplot object into python variables.
# This is useful when we want to work on the data using standard python libraries.
alldata = get_data("tha_vel")
time = alldata[0]
data = alldata[1]

####################################################################################
# After working with the data, we can store a new pytplot variable.
# We can store any data in the pytplot object.
store_data("tha_new_vel", data={'x': time, 'y': data})

####################################################################################
# Preparing for the plots, we define the y-axis limits.