climepi.epimod.SuitabilityModel#
- class climepi.epimod.SuitabilityModel(temperature_range=None, suitability_table=None, suitability_var_name=None, suitability_var_long_name=None)[source]#
Generic class for suitability models.
- temperature_range#
A list or tuple of two floats defining the temperature range of suitability (in degrees Celsius). Only defined if the parameter
temperature_rangeis provided.
- suitability_table#
A dataset containing suitability values defined for different temperature values or temperature/precipitation combinations. Only defined if the parameter
suitability_tableis provided.- Type:
- Parameters:
temperature_range (
listortupleoftwo floats, optional) – A list or tuple of two floats defining the temperature range of suitability (in degrees Celsius), where suitability is assumed to be 1 for temperatures within the range and 0 otherwise. Default isNone. Only one oftemperature_rangeandsuitability_tableshould be provided.suitability_table (
xarray.Dataset, optional) – A dataset containing suitability values defined for different temperature values or temperature/precipitation combinations. The dataset should have a single data variable (with any desired name) with dimension(s) ‘temperature’ and, optionally, ‘precipitation’. Temperatures should be in degrees Celsius and precipitation values in mm/day. Equispaced temperature and (where applicable) precipitation values should be provided, and nearest neighbor interpolation is used to calculate suitability values away from grid points (this is for performance reasons). Suitability values can be either binary (0 or 1) or continuous. Suitability is assumed to take the nearest endpoint value for temperature and/or precipitation values outside the provided range(s). May also have an additional dimension named ‘sample’ indexing equally likely possible suitability tables, or a dimension ‘suitability_quantile’ indexing quantiles of the suitability values. Default isNone. Only one oftemperature_rangeandsuitability_tableshould be provided.suitability_var_name (
str, optional) – The name of the suitability variable. Should not be provided ifsuitability_tableis provided (in this case, the name of the single data variable in the suitability table will be used instead). Ifsuitability_tableis not provided, the name will default to ‘suitability’.suitability_var_long_name (
str, optional) – The long name of the suitability variable, used to label axes in plots. If not provided and ifsuitability_tableis provided, the long name will be taken from the suitability table (either via the ‘long_name’ attribute of the suitability variable, if it exists, or otherwise by capitalizing the suitability variable name). Ifsuitability_tableis not provided, the long name will default to ‘Suitability’.
- __init__(temperature_range=None, suitability_table=None, suitability_var_name=None, suitability_var_long_name=None)[source]#
Methods
__init__([temperature_range, ...])Return the maximum suitability value.
plot_suitability(**kwargs)Plot suitability against temperature and (if relevant) precipitation.
reduce([suitability_threshold, stat, ...])Get a summary suitability model.
run(ds_clim[, ...])Run the epidemiological model on a given climate dataset.