SciTools / iris

A powerful, format-agnostic, and community-driven Python package for analysing and visualising Earth science data
https://scitools-iris.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
635 stars 283 forks source link

More calendars than just 'standard', '360-day' and '365-day' #5378

Open HoWol76 opened 1 year ago

HoWol76 commented 1 year ago

https://github.com/SciTools/iris/blob/5b42f47e71fbeb7861a9df59c8bd8c0be9a340e3/lib/iris/fileformats/pp_load_rules.py#L551

My code just fails as it tries to read in a file with a calendar type 'proleptic_gregorian'

cf_units has several calendars:

CALENDAR_STANDARD = "standard"
CALENDAR_GREGORIAN = "gregorian"
CALENDAR_PROLEPTIC_GREGORIAN = "proleptic_gregorian"
CALENDAR_NO_LEAP = "noleap"
CALENDAR_JULIAN = "julian"
CALENDAR_ALL_LEAP = "all_leap"
CALENDAR_365_DAY = "365_day"
CALENDAR_366_DAY = "366_day"
CALENDAR_360_DAY = "360_day"

I just have this issue when I try to load an orography file, which has set the year to 0.

rcomer commented 1 year ago

I think this might be part of the same problem as #3561, and I have an open pull request for that at #5138. @HoWol76 are you able to try loading your file with my branch? The original issue is rather old, so we have been unsure how to test my change in a real-world situation.

Edit: we have instructions for installing Iris from a git checkout at https://scitools-iris.readthedocs.io/en/latest/installing.html#installing-from-source-with-conda-developers

trexfeathers commented 1 year ago

From @SciTools/peloton:

@HoWol76 do you think you could try out the changes in #5138 to see whether they would fix your issue?

If not, please could you provide us with a way of replicating your problem? Thanks