Simon Peatman
unread,Nov 18, 2020, 10:22:53 AM11/18/20Sign 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 Dhirendra,
I would do the following:
import iris.coord_categorisation
iris.coord_categorisation.add_year(cube, 'time')
iris.coord_categorisation.add_day_of_year(cube, 'time')
daily_mean = cube.aggregated_by(['year', 'day_of_year'], iris.analysis.MEAN)
This adds two auxiliary coordinates, one showing the year and one showing the day number in the year. Then it computes the means by aggregating together any times with the same year and day number.
Simon