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
Keeping track of issues encountering when converting between iris Cubes and xarray DataArrays:
Round trip conversion (xarray -> iris -> xarray) of integer DataArrays causes either a TypeError for xarray < v2023.06 or RuntimeWarning for xarray >= v2023.06. This is due to the core data being converted to a masked array when converting to an iris Cube, and then xarray trying to fill said array with np.nan when converting back
Workaround: copy cube with array-like core_data when converting from xarray to iris: cube = da.to_iris().copy(da.data)
dims without coords get converted to default unnamed dim names during round trip conversion (xarray -> iris -> xarray)
e.g. ("x", "y") -> ("dim_0", "dim_1")
Need to save origin dim names and remap back after output
For #354, I'm working on a modification to the decorators that passes an optional hidden kwarg that notes whether an iris->xarray conversion occurred, to hopefully help with some of these issues.
Sounds like a good plan. Would it make sense to split the decorator changes into a separate branch/PR so they can be worked on concurrently with converting other sections of the code to xarray?
Also most of the conversion issues seem to affect converting from xarray to iris and then back again, so long term hopefully these should be less of an issue once the internals are switched to xarray
Sounds like a good plan. Would it make sense to split the decorator changes into a separate branch/PR so they can be worked on concurrently with converting other sections of the code to xarray?
Sounds like a good plan. Would it make sense to split the decorator changes into a separate branch/PR so they can be worked on concurrently with converting other sections of the code to xarray?
Keeping track of issues encountering when converting between
iris
Cubes andxarray
DataArrays:xarray
->iris
->xarray
) of integer DataArrays causes either aTypeError
forxarray < v2023.06
orRuntimeWarning
forxarray >= v2023.06
. This is due to the core data being converted to a masked array when converting to an iris Cube, and then xarray trying to fill said array with np.nan when converting backcube = da.to_iris().copy(da.data)
xarray
->iris
->xarray
)("x", "y")
->("dim_0", "dim_1")
xarray
uses coordvar_name
, whereasiris
usesstandard_name
standard_name
is not necessarily unique, which can cause problems in tobac. e.g. GOES ABI dataxr.CFTimeIndex(features["time"].to_numpy()).to_datetimeindex()
iris
cannot handle sub-second (e.g. ns) time valuesnp.datetime64[s]
before converting toiris
Please add any more issues that crop up
The text was updated successfully, but these errors were encountered: