New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loading cubes with differing units for time and time_bounds #1801
Comments
Hi @andreas-h. Interesting. The CF spec states:
So whilst it doesn't explicitly rule them out (the word "necessary" is ambiguous), it is not a usecase we've needed to handle before. Is this something that is a one-off? If so, I think you should be able to use a callback to convert the bound units. Something like:
|
thanks, @pelson Yes, it's a one-off thing, and actually, I forgot the way to prevent this issue from occurring in the first place (in case you're interested, see pydata/xarray#540). |
maybe raising a warning/exception in iris when the units of a coord and its bounds don't match would be useful, though. |
This situation does now seem to have been ruled out in the CF conventions:
|
Thanks @rcomer! Based on this, @SciTools/peloton have agreed that we should raise an Perhaps ditto with other bounds attributes, too. |
@SciTools/peloton think this could be tolerant. Similar idea mentioned in #5020 |
We'll aim to get this into 3.8 with the approach suggested by @pp-mo along with a warning. |
I have a .nc file where the
time
variable has different units fromtime_bnds
:When I load this cube in Iris 1.8.1, the time
coord
is wrong:It seems like the units of the time_bnds variable are applied to both
time
andtime_bnds
points.The text was updated successfully, but these errors were encountered: