SciQLop / speasy

Space Physics made EASY! A simple Python package to deal with main Space Physics WebServices (CDA,SSC,AMDA,..)
Other
24 stars 7 forks source link

amda ace imf column names #132

Closed nicolasaunai closed 5 months ago

nicolasaunai commented 5 months ago

Description

Can't reproduce a plot of the documentation

What I Did

import matplotlib.pyplot as plt
from datetime import datetime
%matplotlib widget

plt.figure()
ace_mag = spz.get_data(spz.inventories.data_tree.amda.Parameters.ACE.MFI.ace_imf_all.imf, datetime(2016,6,2), datetime(2016,6,5))
ace_mag.plot()
plt.tight_layout()
plt.show()

I get :

image

Column names are ['bx', 'by', 'bz'] whereas they are imf[0] etc. on documentation.

nicolasaunai commented 5 months ago

tested the documentation page on Binder, gives me bx, by bz too. AMDA web GUI seems to propose also bx, by bz

Weird thing that pushed me to write this issue is that Vincent G. has imf[0] etc:

spz.get_data('amda/imf', "2016-6-2", "2016-6-5",disable_cache=True, disable_proxy=True ).columns
Out[83]: ['imf[0]', 'imf[1]', 'imf[2]']
nicolasaunai commented 5 months ago

automagically "solved" with pip install --user --upgrade --force-reinstall speasy weird.

jeandet commented 5 months ago
In [2]: spz.get_data('amda/imf', "2016-6-2", "2016-6-5",disable_cache=True, disable_proxy=True ).columns
Out[2]: ['bx', 'by', 'bz']

In [3]: spz.get_data('amda/imf', "2016-6-2", "2016-6-5",disable_cache=True, disable_proxy=True, output_format='ASCII').columns
/home/jeandet/Documents/prog/speasy/speasy/webservices/amda/utils.py:80: FutureWarning: The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use ``sep='\s+'`` instead
  data = pds.read_csv(fd, comment='#', delim_whitespace=True,
Out[3]: ['imf[0]', 'imf[1]', 'imf[2]']

In [4]: 

If an update/reinstall solved the issue then it means that @vgenot was still using a Speasy version below 1.2.0. Reinstalling Speasy won't change user settings.

vgenot commented 5 months ago

strangely @nicolasaunai and myself yesterday had spz.version = 1.1.2 after reinstall I have spz.version = 1.2.7

nicolasaunai commented 5 months ago

yeah well I think I made a typo, I had 1.2.2 :/ So the reinstall did indeed solved your "issue" (which really was not an issue but just that you had an older version than 1.2.0 installed).