Metric Calculations API
Metric calculations used in RCMIP
- class pyrcmip.metric_calculations.CalculatorAirborneFraction18501920
Bases:
CalculatorCalculator of the airborne fraction from 1850 to 1920
- classmethod calculate_metric(assessed_ranges, res_calc, norm_period, evaluation_period, unit)
Calculate metric
- Parameters:
assessed_ranges (
pyrcmip.assessed_ranges.AssessedRanges) – Assessed ranges instanceres_calc (
scmdata.ScmRun) – Results from which the metric is to be derivednorm_period (list) – Years to use for normalising the data before calculating the metric
evaluation_period (list) – Years to use when evaluating the metric
unit (str) – Unit in which the metric should be returned
- Returns:
Metric values with other relevant model metadata
- Return type:
pd.DataFrame- Raises:
NoDataForMetricError – No data is available to calculate the given metric
DimensionalityError – The units of the data cannot be converted to the desired units or the units of the data are incompatible with the metric calculation
- class pyrcmip.metric_calculations.CalculatorAirborneFraction18501990
Bases:
CalculatorAirborneFraction18501920Calculator of the airborne fraction from 1850 to 1990
- classmethod calculate_metric(assessed_ranges, res_calc, norm_period, evaluation_period, unit)
Calculate metric
- Parameters:
assessed_ranges (
pyrcmip.assessed_ranges.AssessedRanges) – Assessed ranges instanceres_calc (
scmdata.ScmRun) – Results from which the metric is to be derivednorm_period (list) – Years to use for normalising the data before calculating the metric
evaluation_period (list) – Years to use when evaluating the metric
unit (str) – Unit in which the metric should be returned
- Returns:
Metric values with other relevant model metadata
- Return type:
pd.DataFrame- Raises:
NoDataForMetricError – No data is available to calculate the given metric
DimensionalityError – The units of the data cannot be converted to the desired units or the units of the data are incompatible with the metric calculation
- class pyrcmip.metric_calculations.CalculatorTCR
Bases:
_CalculatorTCRTCREBaseCalculator of the transient climate response (TCR)
- classmethod calculate_metric(assessed_ranges, res_calc, norm_period, evaluation_period, unit)
Calculate metric
- Parameters:
assessed_ranges (
pyrcmip.assessed_ranges.AssessedRanges) – Assessed ranges instanceres_calc (
scmdata.ScmRun) – Results from which the metric is to be derivednorm_period (list) – Years to use for normalising the data before calculating the metric
evaluation_period (list) – Years to use when evaluating the metric
unit (str) – Unit in which the metric should be returned
- Returns:
Metric values with other relevant model metadata
- Return type:
pd.DataFrame- Raises:
NoDataForMetricError – No data is available to calculate the given metric
DimensionalityError – The units of the data cannot be converted to the desired units or the units of the data are incompatible with the metric calculation
- class pyrcmip.metric_calculations.CalculatorTCRE
Bases:
_CalculatorTCRTCREBaseCalculator of the transient climate response to emissions (TCRE)
- classmethod calculate_metric(assessed_ranges, res_calc, norm_period, evaluation_period, unit)
Calculate metric
- Parameters:
assessed_ranges (
pyrcmip.assessed_ranges.AssessedRanges) – Assessed ranges instanceres_calc (
scmdata.ScmRun) – Results from which the metric is to be derivednorm_period (list) – Years to use for normalising the data before calculating the metric
evaluation_period (list) – Years to use when evaluating the metric
unit (str) – Unit in which the metric should be returned
- Returns:
Metric values with other relevant model metadata
- Return type:
pd.DataFrame- Raises:
NoDataForMetricError – No data is available to calculate the given metric
DimensionalityError – The units of the data cannot be converted to the desired units or the units of the data are incompatible with the metric calculation
Base class for metric calculations
- class pyrcmip.metric_calculations.base.Calculator
Bases:
ABCBase class for metric calculations
- classmethod calculate_metric(assessed_ranges, res_calc, norm_period, evaluation_period, unit)
Calculate metric
- Parameters:
assessed_ranges (
pyrcmip.assessed_ranges.AssessedRanges) – Assessed ranges instanceres_calc (
scmdata.ScmRun) – Results from which the metric is to be derivednorm_period (list) – Years to use for normalising the data before calculating the metric
evaluation_period (list) – Years to use when evaluating the metric
unit (str) – Unit in which the metric should be returned
- Returns:
Metric values with other relevant model metadata
- Return type:
pd.DataFrame- Raises:
NoDataForMetricError – No data is available to calculate the given metric
DimensionalityError – The units of the data cannot be converted to the desired units or the units of the data are incompatible with the metric calculation