ESA-VirES / VirES-Python-Client

viresclient is a Python package for easy access to Swarm & Aeolus products as xarray.Dataset
https://viresclient.readthedocs.io
MIT License
14 stars 1 forks source link

Error in xarray reshare #67

Closed Ensase closed 2 years ago

Ensase commented 2 years ago

Hello everyone! I have a problem with 05b1_Solar-Wind-to-Ground.ipynb on step Ground observatory data. Run fetch_ground_obs return error on line ds = data.as_xarray(reshape=True): TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property. ... Changing to ds = data.as_xarray() in the function fetch_ground_obs solve the problem, but "IAGA_code" field not become a new axis. output

smithara commented 2 years ago

Thank you for the report! I just tested it quickly and it looks like the problem only occurs with the latest version of xarray (0.19.0). Can you confirm you are using that version?

It looks like it should be easy to fix but in the meantime you can downgrade xarray, e.g. pip install xarray==0.18.2

Ensase commented 2 years ago

Thank you for quick answer! Yes, it was xarray 0.19, error fixed by downgrade to 0.18.2