nctoolkit.DataSet.tmax#

DataSet.tmax(over='time', align='right')#

tmax: Calculate the temporal maximum of all variables.

Useful for: monthly maximum, annual/yearly maximum, seasonal maximum, daily maximum, daily climatology, monthly climatology, seasonal climatology

Parameters:
  • over (str or list) – Time periods to average over. Options are ‘year’, ‘month’, ‘day’. This operates in a similar way to the groupby method in pandas or the tidyverse in R, with over acting as the grouping.

  • str (align =) – This determines whether the output time is at the left, centre or right hand side of the time window. Options are “left”, “centre” and “right”

Examples

If you want to calculate maximum over all time steps. Do the following:

>>> ds.tmax()

If you want to calculate the maximum for each year in a dataset, do this:

>>> ds.tmax("year")

If you want to calculate the maximum for each month in a dataset, do this:

>>> ds.tmax("month")

If you want to calculate the maximum for each month in each year in a dataset, do this:

>>> ds.tmax(["year", "month"])

This method will also let you easily calculate climatologies. So, if you wanted to calculate a monthly climatological max, you would do this:

>>> ds.tmax( "month")

A daily climatological maximum would be the following:

>>> ds.tmax( "day")