Skip to content
Open
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
9 changes: 7 additions & 2 deletions workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ from urllib.parse import urlparse

CONFIG_ROOT = Path("config").resolve()
OUT_ROOT = Path(config["locations"]["output_root"])
TRUTH_LABEL = config["truth"]["label"]

DATETIME_FORMAT = "%Y-%m-%dT%H:%M"
HASH_LENGTH = 4
Expand Down Expand Up @@ -273,10 +274,14 @@ def resolve_baseline_id(label: str) -> str:
def collect_experiment_participants():
participants = {}
for base in BASELINE_CONFIGS.keys():
participants[base] = OUT_ROOT / f"data/baselines/{base}/verif_aggregated.nc"
participants[base] = (
OUT_ROOT / f"data/baselines/{base}/verif_aggregated_{TRUTH_LABEL}.nc"
)
for exp in RUN_CONFIGS.keys():
if RUN_CONFIGS[exp].get("_is_candidate", False):
participants[exp] = OUT_ROOT / f"data/runs/{exp}/verif_aggregated.nc"
participants[exp] = (
OUT_ROOT / f"data/runs/{exp}/verif_aggregated_{TRUTH_LABEL}.nc"
)
return participants


Expand Down
9 changes: 5 additions & 4 deletions workflow/rules/verification.smk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ rule verification_metrics_baseline:
truth=config["truth"]["root"],
eckit_grids=rules.data_download_eckit_geo_grids.output,
output:
OUT_ROOT / "data/baselines/{baseline_id}/{init_time}/verif.nc",
OUT_ROOT
/ f"data/baselines/{{baseline_id}}/{{init_time}}/verif_{TRUTH_LABEL}.nc",
log:
OUT_ROOT / "logs/verification_metrics_baseline/{baseline_id}-{init_time}.log",
resources:
Expand Down Expand Up @@ -67,7 +68,7 @@ rule verification_metrics:
truth=config["truth"]["root"],
eckit_grids=rules.data_download_eckit_geo_grids.output,
output:
OUT_ROOT / "data/runs/{run_id}/{init_time}/verif.nc",
OUT_ROOT / f"data/runs/{{run_id}}/{{init_time}}/verif_{TRUTH_LABEL}.nc",
log:
OUT_ROOT / "logs/verification_metrics/{run_id}-{init_time}.log",
resources:
Expand Down Expand Up @@ -120,7 +121,7 @@ rule verification_metrics_aggregation:
allow_missing=True,
),
output:
OUT_ROOT / "data/runs/{run_id}/verif_aggregated.nc",
OUT_ROOT / f"data/runs/{{run_id}}/verif_aggregated_{TRUTH_LABEL}.nc",
log:
OUT_ROOT / "logs/verification_metrics_aggregation/{run_id}.log",
resources:
Expand All @@ -142,7 +143,7 @@ use rule verification_metrics_aggregation as verification_metrics_aggregation_ba
allow_missing=True,
),
output:
OUT_ROOT / "data/baselines/{baseline_id}/verif_aggregated.nc",
OUT_ROOT / f"data/baselines/{{baseline_id}}/verif_aggregated_{TRUTH_LABEL}.nc",
log:
OUT_ROOT / "logs/verification_metrics_aggregation_baseline/{baseline_id}.log",

Expand Down
2 changes: 2 additions & 0 deletions workflow/scripts/verification_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ def main(args: ScriptConfig):
)

# save results to NetCDF
results.attrs["truth_label"] = args.truth_label
results.attrs["truth_root"] = str(args.truth)
args.output.parent.mkdir(parents=True, exist_ok=True)
results.earthkit.to_netcdf(args.output)
LOG.info("Saved verification results to %s", args.output)
Expand Down
Loading