API reference#

Core functionality#

The climepi package provides an accessor class for xarray.Dataset objects, which can be used by chaining the climepi attribute to a Dataset. For example, the sel_geo() method can be used to select a named location from a dataset containing data with latitude and longitude coordinates (named “lat” and “lon”, respectively) as follows:

import xarray as xr
import climepi

ds = xr.open_dataset("path/to/dataset.nc")
ds.climepi.sel_geo("London")

Classes#

climepi.ClimEpiDatasetAccessor(xarray_obj)

Accessor class for xarray datasets accessed through the .climepi attribute.

Methods#

Dataset.climepi.ensemble_stats([data_var, ...])

Compute a range of ensemble statistics for a data variable.

Dataset.climepi.monthly_average([data_var])

Compute the monthly mean of a data variable.

Dataset.climepi.plot_map([data_var, ...])

Generate a map plot of a data variable.

Dataset.climepi.plot_time_series([data_var])

Generate a time series plot of a data variable.

Dataset.climepi.plot_uncertainty_interval_decomposition([...])

Plot contributions of climate uncertainty sources to uncertainty intervals.

Dataset.climepi.plot_variance_decomposition([...])

Plot decomposition of variance from different climate uncertainty sources.

Dataset.climepi.run_epi_model(epi_model, ...)

Run the epidemiological model on a climate dataset.

Dataset.climepi.sel_geo(location[, lon, lat])

Get data for the nearest grid point(s) to a specified location(s).

Dataset.climepi.temporal_group_average([...])

Compute the group average of a data variable.

Dataset.climepi.uncertainty_interval_decomposition([...])

Decompose uncertainty interval contributions.

Dataset.climepi.variance_decomposition([...])

Decompose variance contributions from different climate uncertainty sources.

Dataset.climepi.yearly_average([data_var])

Compute the yearly mean of a data variable.

Dataset.climepi.yearly_portion_suitable([...])

Calculate the portion of each year that is suitable given suitability data.

Climate data subpackage#

Methods for downloading and accessing climate projection data are contained in the climdata subpackage:

from climepi import climdata

Methods#

climdata.get_climate_data(data_source[, ...])

Retrieve and download climate projection data from a remote server.

climdata.get_climate_data_file_names([...])

Retrieve file names of formatted climate data files.

climdata.get_example_dataset(name[, ...])

Retrieve an example climate dataset.

Epidemiological model subpackage#

Classes and methods for running climate-sensitive epidemiological models are contained in the epimod subpackage:

from climepi import epimod

Classes#

epimod.EpiModel()

Base class for epidemiological models.

epimod.SuitabilityModel([temperature_range, ...])

Generic class for suitability models.

Methods#

epimod.get_example_model(name)

Get an example climate-sensitive epidemiological model.

Front-end application subpackage#

A method to run the front-end application is contained in the app subpackage:

from climepi import app
app.run_app()

See Front-end application for information on how to run the application from the command line.

Methods#

app.run_app([clim_dataset_example_base_dir, ...])

Run the climepi front-end application locally.