Max Coleman
unread,Aug 12, 2021, 10:27:01 AM8/12/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
Hi everyone,
I'm struggling to get some output from UM runs in .pp format, with a 360_day calendar, to load in iris. I want to load a file that has hourly output for one model year (2014) of a single diagnostic, but using iris.load (or load_cube or load_cubes) I get the error:
'ValueError: invalid day number provided in cftime.datetime(2014, 2, 29, 0, 0, 0, 0, calendar='gregorian')'
I've tried constraining the loading using a datetime interval iris.Constraint to get values on 29th Feb in the hope iris will then expect this date, but still returns the same error. I've also tried constraining to select a date permitted by a gregorian calendar (e.g. 28th Feb) but still get the same error. I haven't tried using a callback in the load function as I'm not familiar with their use, but guessing it also operates after the load function initially reads the file so will probably return the same error?
Having downloaded just a smaller portion of data (just first two days of Jan), which does load okay, I've checked and it confirms the data definitely should have a 360_day calendar: running print(cube.coord('time')) returns, among the other details, calendar = '360_day'
I assume there is some way to specify the calendar you are expecting the file to have, or that Iris should identify it automatically. I can't find in the documentation a way to specify the expected calendar of the file, but maybe I have missed something. I've tried following advice in related previous posts on here and on NCAS CMS helpdesk, but also no luck. I'm thinking i'm either missing something very obvious or something is not working as it's supposed to.
Thanks for any help you can give :)
Max