Metric Calculations API¶
Metric calculations used in RCMIP
-
class
pyrcmip.metric_calculations.
CalculatorTCR
¶ Bases:
pyrcmip.metric_calculations.base.Calculator
Calculator 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
-
classmethod
-
class
pyrcmip.metric_calculations.
CalculatorTCRE
¶ Bases:
pyrcmip.metric_calculations.base.Calculator
Calculator 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
-
classmethod
Base class for metric calculations
-
class
pyrcmip.metric_calculations.base.
Calculator
¶ Bases:
abc.ABC
Base 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
-
classmethod