Skip to content
Snippets Groups Projects
Commit 3d3f497f authored by lukas leufen's avatar lukas leufen
Browse files

Merge branch 'lukas_issue286_feat_performance-measures' into 'develop'

log clim skill scores too

See merge request toar/mlair!262
parents c0b307cc 4b6e0f72
No related branches found
No related tags found
6 merge requests!319add all changes of dev into release v1.4.0 branch,!318Resolve "release v1.4.0",!283Merge latest develop into falcos issue,!264Merge develop into felix_issue287_tech-wrf-datahandler-should-inherit-from-singlestationdatahandler,!262log clim skill scores too,!259Draft: Resolve "WRF-Datahandler should inherit from SingleStationDatahandler"
Pipeline #61994 passed with warnings
This commit is part of merge request !318. Comments created here will be created in the context of that merge request.
......@@ -108,6 +108,7 @@ class PostProcessing(RunEnvironment):
skill_score_competitive, skill_score_climatological, errors = self.calculate_error_metrics()
self.skill_scores = (skill_score_competitive, skill_score_climatological)
self.report_error_metrics(errors)
self.report_error_metrics(skill_score_climatological)
# plotting
self.plot()
......@@ -716,6 +717,10 @@ class PostProcessing(RunEnvironment):
path_config.check_path_and_create(report_path)
metric_collection = {}
for station, station_errors in errors.items():
if isinstance(station_errors, xr.DataArray):
dim = station_errors.dims[0]
sel_index = [sel for sel in station_errors.coords[dim] if "CASE" in str(sel)]
station_errors = {str(i.values): station_errors.sel(**{dim: i}) for i in sel_index}
for metric, vals in station_errors.items():
if metric == "n":
continue
......@@ -726,7 +731,9 @@ class PostProcessing(RunEnvironment):
metric_collection[metric] = mc
for metric, error_df in metric_collection.items():
df = error_df.sort_index()
if "total" in df.index:
df.reindex(df.index.drop(["total"]).to_list() + ["total"], )
column_format = tables.create_column_format_for_tex(df)
tables.save_to_tex(report_path, f"error_report_{metric}.tex", column_format=column_format, df=df)
tables.save_to_md(report_path, f"error_report_{metric}.md", df=df)
file_name = f"error_report_{metric}.%s".replace(' ', '_')
tables.save_to_tex(report_path, file_name % "tex", column_format=column_format, df=df)
tables.save_to_md(report_path, file_name % "md", df=df)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment