Closed nickssl closed 5 months ago
To reproduce the second error:
swe_vars = load(trange=['2014-10-18', '2014-10-19'], instrument='swea') print(swe_vars) tplot('diff_en_fluxes')
Traceback (most recent call last):
File "
The first (specplot) issue may have been fixed now, after Jim M's recent pytplot changes. With the latest version of pytplot, I get no errors (but the plot is blank?).
I'm still getting an error for the second case (which is also probably supposed to be a specplot...it's no longer trying to plot it as lines). But it's a different error:
['diff_en_fluxes']
Traceback (most recent call last):
File "/Users/jwl/PycharmProjects/pyspedas/venv/lib/python3.9/site-packages/IPython/core/interactiveshell.py", line 3550, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-3-d9ef76b8f56f>", line 3, in <module>
tplot('diff_en_fluxes')
File "/Users/jwl/PycharmProjects/PyTplot/pytplot/tplot.py", line 158, in tplot
return mpl_tplot(name, var_label=var_label,
File "/Users/jwl/PycharmProjects/PyTplot/pytplot/MPLPlotter/tplot.py", line 131, in tplot
temp_dq = pytplot.tplot_utilities.reduce_spec_dataset(name=variable)
File "/Users/jwl/PycharmProjects/PyTplot/pytplot/tplot_utilities.py", line 718, in reduce_spec_dataset
coordinate_to_plot = da.attrs['plot_options']['extras']['spec_dim_to_plot']
KeyError: 'spec_dim_to_plot'
I think this is also due to Jim's recent changes. Maybe we need to set this option in cdf_to_tplot? Is there a good default, or can we figure out what it needs to be in cdf_to_tplot?
Two different problems, one in specplot.py the other in lineplot.py.
To reproduce the first error:
from pyspedas.maven.spdf import load from pytplot import tplot sta_vars = load(trange=['2020-12-30', '2020-12-31'], instrument='static', datatype='c0-64e2m') print(sta_vars) tplot('bkg')
Traceback (most recent call last): File "", line 1, in
File "C:\work\github\PyTplot\pytplot\tplot.py", line 158, in tplot
return mpl_tplot(name, var_label=var_label,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\work\github\PyTplot\pytplot\MPLPlotter\tplot.py", line 370, in tplot
plot_created = specplot(var_data, var_times, this_axis, yaxis_options, zaxis_options, plot_extras, colorbars, axis_font_size, fig, variable, time_idxs=time_idxs, style=style)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\work\github\PyTplot\pytplot\MPLPlotter\specplot.py", line 103, in specplot
spec_options['norm'] = mpl.colors.LogNorm(vmin=np.nanmin(var_data.v), vmax=np.nanmax(var_data.v))
^^^^^^^^^^
AttributeError: 'variable' object has no attribute 'v'. Did you mean: 'v1'?