PlasmaFAIR / sdf-xarray

An xarray backend for reading SDF files from EPOCH
https://sdf-xarray.readthedocs.io
BSD 3-Clause "New" or "Revised" License
7 stars 1 forks source link

Opening multifile dataset with `separate_times=True` drops coordinates on particles #13

Open ZedThree opened 3 months ago

ZedThree commented 3 months ago

Opening single file:

<xarray.DataArray 'Particles/Px/proton' (ID_proton: 249998)> Size: 2MB
[249998 values with dtype=float64]
Coordinates:
    X_Particles/proton  (ID_proton) float64 2MB ...
    Y_Particles/proton  (ID_proton) float64 2MB ...
Dimensions without coordinates: ID_proton
Attributes:
    units:       kg.m/s
    point_data:  True

Multifiles:

<xarray.DataArray 'Particles/Px/proton' (time2: 1, ID_proton: 249998)> Size: 2MB
array([[2.97315578e-24, 1.60333919e-24, 1.94945397e-24, ...,
        2.13845478e-25, 1.39796206e-24, 4.85421167e-24]])
Coordinates:
  * time2    (time2) float64 8B 5.001e-14
Dimensions without coordinates: ID_proton
Attributes:
    units:       kg.m/s
    point_data:  True
JoelLucaAdams commented 1 week ago

@ZedThree From my understanding most people are using the xr.open_mfdataset function instead of the builtin one. Do we still need this after we completed the SDFPreprocess? Same applies to #14