geocat.comp.climatologies.month_to_season#

geocat.comp.climatologies.month_to_season(dset, season, time_coord_name=None)#

Computes a user-specified three-month seasonal mean.

This function takes an xarray dataset containing monthly data spanning years and returns a dataset with one sample per year, for a specified three-month season.

Parameters
  • dset (xarray.Dataset, xarray.DataArray) – The data on which to operate

  • season (str) – A string representing the season to calculate: e.g., “JFM”, “JJA”. Valid values are:

    • DJF {December, January, February}

    • JFM {January, February, March}

    • FMA {February, March, April}

    • MAM {March, April, May}

    • AMJ {April, May, June}

    • MJJ {May, June, July}

    • JJA {June, July, August}

    • JAS {July, August, September}

    • ASO {August, September, October}

    • SON {September, October, November}

    • OND {October, November, Decmber}

    • NDJ {November, Decmber, January}

  • time_coord_name (str, optional) – Name for time coordinate to use. Defaults to None and infers the name from the data.

Returns

computed_dset (xarray.Dataset, xarray.DataArray) – The computed data

Notes

This function requires the number of months to be a multiple of 12, i.e. full years must be provided. Time stamps are centered on the season. For example, seasons=’DJF’ returns January timestamps. If a calculated season’s timestamp falls outside the original range of monthly values, then the calculated mean is dropped. For example, if the monthly data’s time range is [Jan-2000, Dec-2003] and the season is “DJF”, the seasonal mean computed from the single month of Dec-2003 is dropped.

See also

Related NCL Functions: month_to_season