mpas_analysis.shared.climatology.add_years_months_days_in_month¶
- 
mpas_analysis.shared.climatology.add_years_months_days_in_month(ds, calendar=None)[source]¶ Add
year,monthanddaysInMonthas data arrays inds. The number of days in each month ofdsis computed either using thestartTimeandendTimeif available or assuminggregorian_noleapcalendar and ignoring leap years.yearandmonthare computed accounting correctly for the the calendar.- Parameters
 ds (
xarray.Datasetorxarray.DataArrayobject) – A data set with aTimecoordinate expressed as days since 0001-01-01calendar ({'gregorian', 'gregorian_noleap'}, optional) – The name of one of the calendars supported by MPAS cores, used to determine
yearandmonthfromTimecoordinate
- Returns
 ds (object of same type as
ds) – The data set withyear,monthanddaysInMonthdata arrays added (if not already present)