OceanParcels/Parcels

Reconsider the order of (trajectory, obs) in the zarr output file?

erikvansebille opened this issue · 3 comments

In Parcels, we've followed the CF-convention on trajectory data. The downside of this convention is that the data is ordered as (trajectory, obs) and that a simple script to load and plot trajectories requires a transpose operator

ds = xr.open_zarr(filename)
plt.plot(ds.lon.T, ds.lat.T)

For users, I can imagine it would be much easier if they could simply call plt.plot(ds.lon, ds.lat) (so without the .T), but this requires swapping the dimension order of all the variables in the zarr output to (obs, trajectory).

While of course it's good to keep to standards as much as possible, I thus propose we at least consider whether we want to swap the dimension order to (obs, trajectory). Note that this will be a breaking change, so can only happen in Parcels v4 (if we even want it).

Opinions/feedback welcome!

Sorry for the delay (I was traveling), but it strikes me that maintaining CF compliance is more important.

I also think adherence to CF is more important, and also means that our output is easier to integrate with other software. I think that the mention in parcels_tutorial is sufficient?

OK, thanks for the very clear and unequivocal responses, @JamiePringle and @VeckoTheGecko. Let's then keep the dimension ordering we have now in Parcels