setup_mva_plot
setup_mva_plot (data:xarray.core.dataarray.DataArray,
tstart:datetime.datetime, tstop:datetime.datetime,
mva_tstart:datetime.datetime=None,
mva_tstop:datetime.datetime=None)
source
time_stamp
time_stamp (ts)
Return POSIX timestamp as float.
Code
def format_candidate_title(candidate: dict):
def format_float(x):
return rf"$\bf {x:.2f} $" if isinstance(x, (float, int)) else rf"$\bf {x} $"
base_line = rf'$\bf {candidate.get("type", "N/A")} $ candidate (time: {candidate.get("time", "N/A")}) with index '
index_line = rf'i1: {format_float(candidate.get("index_std", "N/A"))}, i2: {format_float(candidate.get("index_fluctuation", "N/A"))}, i3: {format_float(candidate.get("index_diff", "N/A"))}'
info_line = rf'$B_n/B$: {format_float(candidate.get("BnOverB", "N/A"))}, $dB/B$: {format_float(candidate.get("dBOverB", "N/A"))}, $(dB/B)_{{max}}$: {format_float(candidate.get("dBOverB_max", "N/A"))}, $Q_{{mva}}$: {format_float(candidate.get("Q_mva", "N/A"))}'
title = rf"""{base_line}
{index_line}
{info_line}"""
return title
source
plot_candidate
plot_candidate (event:dict, data:xarray.core.dataarray.DataArray,
add_ids_properties=True, plot_current_density=False,
plot_fit_data=False, add_timebars=True,
add_plasma_params=False, **kwargs)