nctoolkit.DataSet.select

DataSet.select(self, \*\*kwargs)

A method for subsetting datasets to specific variables, years, longitudes etc. Operations are applied in the order supplied.

Parameters

*kwargs

Possible arguments: variables, years, months, seasons, timesteps, lon, lat

Note: this uses partial matches. So year, month, var etc. will also work

Each kwarg works as follows:

variablesstr or list

A variable or list of variables to select

seasonsstr

Seasons to select. One of “DJF”, “MAM”, “JJA”, “SON”.

monthslist, range or int

Month(s) to select.

yearslist,range or int

Years(s) to select. These should be integers

timestepslist or int

time step(s) to select. For example, if you wanted the first time step set times=0.

lonlist

A list [lon_min, lon_max] giving the maximum and minimum latitude required.

latlist

A list [lat_min, lat_max] giving the maximum and minimum latitude required.

A usage example is the following:

data.select(variables = “var”)