mpas_analysis.shared.climatology.compute_climatology
- mpas_analysis.shared.climatology.compute_climatology(ds, monthValues, calendar=None, maskVaries=True)[source]
- Compute a monthly, seasonal or annual climatology data set from a data set. The mean is weighted but the number of days in each month of the data set, ignoring values masked out with NaNs. If the month coordinate is not present, a data array - monthwill be added based on- Timeand the provided calendar.- Parameters:
- ds (xarray.Dataset or xarray.DataArray) – A data set with a - Timecoordinate expressed as days since 0001-01-01 or- monthcoordinate
- monthValues (int or array-like of ints) – A single month or an array of months to be averaged together 
- calendar ({'gregorian', 'noleap'}, optional) – The name of one of the calendars supported by MPAS cores, used to determine - monthfrom- Timecoordinate, so must be supplied if- dsdoes not already have a- monthcoordinate or data array
- maskVaries (bool, optional) – If the mask (where variables in - dsare- NaN) varies with time. If not, the weighted average does not need make extra effort to account for the mask. Most MPAS fields will have masks that don’t vary in time, whereas observations may sometimes be present only at some times and not at others, requiring- maskVaries = True.
 
- Returns:
- climatology (object of same type as - ds) – A data set without the- 'Time'coordinate containing the mean of ds over all months in monthValues, weighted by the number of days in each month.