You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main processing script expects data variables to have (lat, lon, time) as the dimension order and currently raises an error if not. It may be possible to leverage xarray to re-orient the data in-place so this data wrangling step is handled by the script. We used to do this utilizing NCO but that approach was abandoned after so many issues for Windows users. @jamaa has suggested an elegant solution to this problem via the usage of xarray's transpose function:
Is it not possible to reorder dimensions as needed using xarray? The following to me looks like it produces what is needed (using the example dataset from above):
# maybe only one of the below lines is even enough?ds2=ds.transpose("lat", "lon", "time") # transpose the data variable's dimensionsds2=ds2[["lat", "lon", "time", "ppt"]] # select data in desired dimension orderprint(ds2)
The main processing script expects data variables to have (lat, lon, time) as the dimension order and currently raises an error if not. It may be possible to leverage xarray to re-orient the data in-place so this data wrangling step is handled by the script. We used to do this utilizing NCO but that approach was abandoned after so many issues for Windows users. @jamaa has suggested an elegant solution to this problem via the usage of xarray's
transpose
function:If I'm not overlooking something, this could be easily built-in to climate_indices to allow for different dimension orders in the input?
Originally posted by @jamaa in #548 (comment)
The text was updated successfully, but these errors were encountered: