fair.tools package

Submodules

fair.tools.constrain module

fair.tools.constrain.hist_temp(Tobs, Tmodel, years, inflate=True, CI=0.9)

Checks to see whether model-derived temperatures fall in observational uncertainty.

Uses the method of Thompson et al., 2015, also used in IPCC AR5 to derive temperature trends which includes autocorrelation. The regression slope of the observations is compared to the regression slope of the model. If the trend of the model is within observational uncertainty, the test passes.

Reference: J. Climate, 28, 6443-6456 10.1175/JCLI-D-14-00830.1

inputs:
Tobs: observed temperature time series. Numpy array Tmodel: modelled temperature time series. Numpy array years: Numpy array of years covered by Tobs and Tmodel
keywords:
inflate: True (default) if the uncertainty bounds should be inflated
for lag-1 autocorrelation - as used in Thompson.
CI: confidence interval around the mean regression slope to count as
constrained. Default 0.9.
returns:
accept: True if ensemble member agrees with observations else False. slope_m: regression slope of modelled temperature intercept_m: intercept of modelled temperature slope_o: regression slope of observed temperature intercept_o: intercept of observed temperature

fair.tools.magicc module

fair.tools.magicc.scen_open(filename, include_cfcs='rcp45', startyear=1765, harmonise=None)

Opens a MAGICC6 .SCEN file and extracts the data. Interpolates linearly between non-consecutive years in the SCEN file. Fills in chlorinated gases from a specified RCP scenario or from custom emissions.

Inputs:
filename: the .SCEN file to open
Keywords:
include_cfcs: string, False, or nt x 16 numpy array
MAGICC files do not come loaded with CFCs (indices 24-39). They are given in the harmonised files at http://www.pik-potsdam.de/~mmalte/rcps/. - Specify ‘rcp3pd’, ‘rcp45’, ‘rcp6’ or ‘rcp85’ to use these RCPs. - Use False to ignore and create a 24-species emission file. - Provide an array to tack your own chlorinated gases onto the SCEN
startyear: First year of output file. If before first year of the SCEN
file, use RCP4.5 to fill
harmonise: None, or year
Linearly interpolate between 2000 in the RCP file and the specified year. If None, do not harmonise
Returns:
nt x 40 numpy emissions array
nt is defined as <last year of SCEN file> -
<earlier of startyear and first year of SCEN file> + 1

It is assumed that the .SCEN files follow the formatting convention on the MAGICC wiki at http://wiki.magicc.org/index.php?title=Creating_MAGICC_Scenario_Files.

Module contents