spaemis.scaling

Scalers

A scaler is an object that performs some kind of scaling upon a dataset (typically inventory data). This scaling operation is generally to update data for a variable/sector to some future time-base.

A number of different scalers exist with the most simple of all being a ConstantScaler. This constant scaler is will apply some static scale factor to the underlying data.

spaemis.scaling.base

Base class for scaling emissions

spaemis.scaling.constant

Constant scaler

spaemis.scaling.exclude

Exclude scaler

spaemis.scaling.point_source

Point source scaler

spaemis.scaling.proxy

Proxy scaler

spaemis.scaling.relative_change

Scale using the relative change seen in input4MIPs

spaemis.scaling.timeseries

Proxy scaler

get_scaler

get_scaler(name)[source]

Get a scaler by name

Parameters:

name (str) –

Name of the scaler

#TODO: Update docs

Options include: * “constant”: Apply a constant multiplier * “exclude”: All nans * “relative_change”: Use the relative change between two data sets to scale * “proxy”: Downscaler the quantities from CEDS using an arbitrary proxy * “point_source”: Apply a quantity of emissions across a number of point sources * “timeseries”: Use a timeseries and a proxy to scale results

Raises:

ValueError: – An unknown scaler is requested

Returns:

type[spaemis.scaling.base.BaseScaler] – The class of the scaler of interest

get_scaler_by_config

get_scaler_by_config(method)[source]

Create a scaler from configuration

Parameters:

method (typing.Union[spaemis.config.ExcludeScaleMethod, spaemis.config.ProxyMethod, spaemis.config.RelativeChangeMethod, spaemis.config.ConstantScaleMethod, spaemis.config.TimeseriesMethod, spaemis.config.PointSourceMethod]) – Configuration which includes information about which scaler to use and how to initialise it.

Returns:

spaemis.scaling.base.BaseScalerA scaler ready for use