Get data

Code
%load_ext autoreload
%autoreload 2
from discontinuitypy.plot import tsplot_Alvenicity
from space_analysis.utils.speasy import to_dataarrays
import speasy as spz
from speasy.core.requests_scheduling.request_dispatch import init_cdaweb
import importlib.util
import matplotlib.pyplot as plt
from beforerr.matplotlib import PlotOpts, process_figure, easy_save
import holoviews as hv
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload
Code
hv.extension('matplotlib')
 
if importlib.util.find_spec("scienceplots") is not None:
    importlib.import_module("scienceplots")
    plt.style.use(["science", "nature", "notebook"])
init_cdaweb()
Code
plot_opts = PlotOpts(
    sync_legend_colors=True,
    hide_legend_lines=True
)
Code
coord = "gsm"
thm_products = [
    "cda/THB_L2_FGM/thb_fgs_gsm",
    "cda/THB_L2_MOM/thb_peim_velocity_gsmQ",
    "cda/THB_L2_MOM/thb_peim_densityQ",
]
thm_tr = ["2016-05-20T17:47:00", "2016-05-20T17:53:40"]

psp_products = [
    "cda/PSP_FLD_L2_MAG_RTN/psp_fld_l2_mag_RTN",
    "cda/PSP_SWP_SPI_SF00_L3_MOM/VEL_SC",
    "cda/PSP_SWP_SPI_SF00_L3_MOM/DENS"
]
psp_tr = ["2021-01-17T13:54:17", "2021-01-17T13:54:32"]

wi_products = [
    "cda/WI_H2_MFI/BGSE",
    "cda/WI_PM_3DP/P_VELS",
    "cda/WI_PM_3DP/P_DENS"
]
wi_tr = ["2011-08-26T21:26:00", "2011-08-26T21:27:30"]
Code
def temp(products, timerage):
    d = spz.get_data(products, timerage)
    das = to_dataarrays(d)
    plot = tsplot_Alvenicity(*das)
    for subplot in plot:
        subplot.opts(legend_position='right')
    plot[-1].opts(show_legend=False)
    return plot
Code
configs = [
    (thm_products, thm_tr),
    (psp_products, psp_tr),
    (wi_products, wi_tr)
]
ps = [temp(*c) for c in configs]
20-Aug-24 10:33:47: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future

20-Aug-24 10:33:47: Can't get THB_L2_MOM/thb_peim_velocity_gsmQ without web service, switching to web service
20-Aug-24 10:33:47: Can't get THB_L2_MOM/thb_peim_densityQ without web service, switching to web service
2024-08-20 10:33:47.438 | INFO     | space_analysis.ds.tplot.formulary:ts_Alfven_speed:22 - Time of B and density are not the same, interpolating density to B
20-Aug-24 10:33:47: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future

2024-08-20 10:33:47.871 | INFO     | space_analysis.ds.tplot.formulary:ts_Alfven_speed:22 - Time of B and density are not the same, interpolating density to B
20-Aug-24 10:33:48: DeprecationWarning: parsing timezone aware datetimes is deprecated; this will raise an error in the future

2024-08-20 10:33:48.124 | INFO     | space_analysis.ds.tplot.formulary:ts_Alfven_speed:22 - Time of B and density are not the same, interpolating density to B
Code
def render_p(p, name):
    p.opts(fig_size=150, tight=True, sublabel_format=None)
    fig = hv.render(p)
    process_figure(fig, plot_opts)
    easy_save(name, fig)
Code
names = ["THB", "PSP", "Wind"]
for p, name in zip(ps,names):
    render_p(p, name)
20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:12: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:13: MatplotlibDeprecationWarning: Passing label as a length 92 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:14: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 4394 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:15: MatplotlibDeprecationWarning: Passing label as a length 5 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:16: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 978 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.

20-Aug-24 10:34:17: MatplotlibDeprecationWarning: Passing label as a length 29 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.