Skip to content

Unable to load mas data with Psipy #119

Description

@vreville

Hi,

Since quite recently, I have been unable to load MAS data (from https://www.predsci.com/mhdweb/data_access.php) using pispy. The error message that I get is the following :

 File "/Users/vreville/Projets/MAS/mascoro_test.py", line 63, in <module>
    d=mas_as_pluto(directory)
  File "/Users/vreville/Projets/MAS/mascoro_test.py", line 35, in mas_as_pluto
    F=mas_output[ff]
      ~~~~~~~~~~^^^^
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/psipy/model/base.py", line 64, in __getitem__
    data = self.load_file(var)
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/psipy/model/mas.py", line 77, in load_file
    return read_mas_file(self.path, var)
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/psipy/io/mas.py", line 57, in read_mas_file
    data = [_read_mas(f, var) for f in files]
            ~~~~~~~~~^^^^^^^^
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/psipy/io/mas.py", line 77, in _read_mas
    data = xr.Dataset({var: xr.DataArray(data=data, coords=coords, dims=dims)})
                            ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/xarray/core/dataarray.py", line 487, in __init__
    coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
                   ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/vreville/env3.13/lib/python3.13/site-packages/xarray/core/dataarray.py", line 192, in _infer_coords_and_dims
    raise ValueError(
    ...<2 lines>...
    )
ValueError: different number of dimensions on data and dims: 3 vs 4

However, the code is still working for previously downloaded MAS cube, so I suspect the product itself has changed recently.

Any help appreciated !

Victor

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions