Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 74 additions & 6 deletions src/CSET/cset_workflow/meta/verification/rose-meta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ sort-key=sc-ts-3

[template variables=SCORES_TIMESERIES_PC]
ns=Verification/ScoresTimeseries
title=Pearsons Correlation
title=Pearson’s Correlation
description=SCORES COUNTINOUS METRIC.
Plots a timeseries plot of the Pearson’s Correlation Coefficient between two models.
The computation is implemented by the scores package.
Expand Down Expand Up @@ -262,7 +262,12 @@ ns=Verification
description=If selected, all model vs obs scores shown below will be calculated.
type=python_boolean
trigger=template variables=SCORES_SPATIAL_RMSE_MODEL_VS_OBS: False;
template variables=SCORES_SPATIAL_MAE_MODEL_VS_OBS: False;
template variables=SCORES_SPATIAL_AB_MODEL_VS_OBS: False;
template variables=SCORES_TIMESERIES_RMSE_MODEL_VS_OBS: False;
template variables=SCORES_TIMESERIES_MAE_MODEL_VS_OBS: False;
template variables=SCORES_TIMESERIES_AB_MODEL_VS_OBS: False;
template variables=SCORES_TIMESERIES_PC_MODEL_VS_OBS: False;
compulsory=true
sort-key=scores1_model_vs_obs

Expand All @@ -277,15 +282,51 @@ title=Model vs obs scores timeseries

[template variables=SCORES_TIMESERIES_RMSE_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresTimeseries
title=Root Mean Square Error Model Vs Obs
description=SCORES COUNTINOUS METRIC.
title=Root Mean Square Error Model Vs Obs timeseries
description=SCORES CONTINUOUS METRIC.
Plots a timeseries plot of the RMSE between models and observations.
The computation is implemented by the scores package.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-ts-1
sort-key=sc-ts-1_model_vs_obs

[template variables=SCORES_TIMESERIES_MAE_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresTimeseries
title=Mean Absolute Error Model Vs Obs timeseries
description=SCORES CONTINUOUS METRIC.
Plots a timeseries plot of the MAE between models and observations.
The computation is implemented by the scores package.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-ts-2_model_vs_obs

[template variables=SCORES_TIMESERIES_AB_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresTimeseries
title=Additive Bias Model Vs Obs timeseries
description=SCORES CONTINUOUS METRIC.
Plots a timeseries plot of the additive bias between models and observations.
The computation is implemented by the scores package.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-ts-3_model_vs_obs

[template variables=SCORES_TIMESERIES_PC_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresTimeseries
title=Pearson’s Correlation Model Vs Obs timeseries
description=SCORES CONTINUOUS METRIC.
Plots a timeseries plot of the Pearson’s Correlation between models and observations.
The computation is implemented by the scores package.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-ts-4_model_vs_obs

#################################################

Expand All @@ -309,8 +350,8 @@ sort-key=sc-sp-0_model_vs_obs
[template variables=SCORES_SPATIAL_RMSE_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresSpatial
title=Root Mean Square Error
description=SCORES COUNTINOUS METRIC.
Plots a 2D spatial plot of the RMSE between two models.
description=SCORES CONTINUOUS METRIC.
Plots a 2D spatial plot of the RMSE between observations and models.
The computation is implemented by the scores package.
For the time coordinate, the method(s) set in
SPATIAL_SCORES_FIELD_METHOD will be used.
Expand All @@ -320,6 +361,33 @@ type=python_boolean
compulsory=true
sort-key=sc-sp-1_model_vs_obs

[template variables=SCORES_SPATIAL_MAE_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresSpatial
title=Mean Absolute Error
description=SCORES COUNTINOUS METRIC.
Plots a 2D spatial plot of the MAE between observations and models.
The computation is implemented by the scores package.
For the time coordinate, the method(s) set in
SPATIAL_SCORES_FIELD_METHOD will be used.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-sp-2_model_vs_obs

[template variables=SCORES_SPATIAL_AB_MODEL_VS_OBS]
ns=Verification/ModelVsObsScoresSpatial
title=Additive Bias
description=SCORES CONTINUOUS METRIC.
Plots a 2D spatial plot of the additive bias between observations and models.
The computation is implemented by the scores package.
For the time coordinate, the method(s) set in
SPATIAL_SCORES_FIELD_METHOD will be used.
help=This computes the metric using the scores package. Details of this can
be found at https://scores.readthedocs.io/en/stable/included.html#continuous
type=python_boolean
compulsory=true
sort-key=sc-sp-3_model_vs_obs

#####

Expand Down
5 changes: 5 additions & 0 deletions src/CSET/cset_workflow/rose-suite.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,15 @@ SCORES_CRPS_FOR_ENSEMBLE=False
SCORES_RMSE_VERTICAL_PROFILES_SEQUENCE=False
SCORES_RMSE_VERTICAL_PROFILES=False
SCORES_TIMESERIES_RMSE_MODEL_VS_OBS=False
SCORES_TIMESERIES_MAE_MODEL_VS_OBS=False
SCORES_TIMESERIES_AB_MODEL_VS_OBS=False
SCORES_TIMESERIES_PC_MODEL_VS_OBS=False
SCORES_SPATIAL_AB=False
SCORES_SPATIAL_MAE=False
SCORES_SPATIAL_RMSE=False
SCORES_SPATIAL_RMSE_MODEL_VS_OBS=False
SCORES_SPATIAL_MAE_MODEL_VS_OBS=False
SCORES_SPATIAL_AB_MODEL_VS_OBS=False
SCORES_TIMESERIES_AB=False
SCORES_TIMESERIES_MAE=False
SCORES_TIMESERIES_PC=False
Expand Down
47 changes: 23 additions & 24 deletions src/CSET/loaders/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ def _get_scores_timeseries_methods_model_vs_obs(conf):

if conf.SCORES_TIMESERIES_RMSE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_timeseries_methods_model_vs_obs.append("RMSE")
# TODO: uncomment remainder when backend code has been written
# if conf.SCORES_TIMESERIES_AB_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
# scores_timeseries_methods_model_vs_obs.append("additive_bias")
# if conf.SCORES_TIMESERIES_MAE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
# scores_timeseries_methods_model_vs_obs.append("MAE")
# if conf.SCORES_TIMESERIES_PC_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
# scores_timeseries_methods_model_vs_obs.append("correlation_pearsonr")
if conf.SCORES_TIMESERIES_AB_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_timeseries_methods_model_vs_obs.append("additive_bias")
if conf.SCORES_TIMESERIES_MAE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_timeseries_methods_model_vs_obs.append("MAE")
if conf.SCORES_TIMESERIES_PC_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_timeseries_methods_model_vs_obs.append("correlation_pearsonr")
return scores_timeseries_methods_model_vs_obs


Expand All @@ -83,11 +82,10 @@ def _get_scores_spatial_methods_model_vs_obs(conf):
scores_spatial_methods_model_vs_obs = []
if conf.SCORES_SPATIAL_RMSE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_spatial_methods_model_vs_obs.append("RMSE")
# TODO: uncomment remainder when backend code has been written
# if conf.SCORES_SPATIAL_AB_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
# scores_spatial_methods_model_vs_obs.append("additive_bias")
# if conf.SCORES_SPATIAL_MAE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
# scores_spatial_methods_model_vs_obs.append("MAE")
if conf.SCORES_SPATIAL_AB_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_spatial_methods_model_vs_obs.append("additive_bias")
if conf.SCORES_SPATIAL_MAE_MODEL_VS_OBS or conf.SCORES_ALL_MODEL_VS_OBS:
scores_spatial_methods_model_vs_obs.append("MAE")
return scores_spatial_methods_model_vs_obs


Expand Down Expand Up @@ -219,21 +217,22 @@ def load(conf: Config):
scores_spatial_methods_model_vs_obs,
):
preserved_coords = ["time", "latitude", "longitude"]
scores_method_case = "CASE"
scores_coords_case = ["latitude", "longitude"]
recipe_method = method
if scores_method == "RMSE" and method == "CASE":
if scores_method == "RMSE" and method == scores_method_case:
preserved_coords = ["latitude", "longitude"]
recipe_method = ""
# TODO include these when backend code is added
# if scores_method == "MAE" and method == scores_method_case:
# Set the preserved coords and collapse method required
# to produce MAE spatial plot over an entire case study.
# preserved_coords = scores_coords_case
# method = method_null
# if scores_method == "additive_bias" and method == scores_method_case:
# Set the preserved coords and collapse method required
# to produce ME additive bias spatial plot over an entire case study.
# preserved_coords = scores_coords_case
# method = method_null
if scores_method == "MAE" and method == scores_method_case:
# Set the preserved coords and collapse method required
# to produce MAE spatial plot over an entire case study.
preserved_coords = scores_coords_case
recipe_method = ""
if scores_method == "additive_bias" and method == scores_method_case:
# Set the preserved coords and collapse method required
# to produce ME additive bias spatial plot over an entire case study.
preserved_coords = scores_coords_case
recipe_method = ""

yield RawRecipe(
recipe=f"surface_scores_model_vs_obs_{scores_method}.yaml",
Expand Down