Skip to content

Commit d1ed4da

Browse files
committed
Add station obs from peakweather
1 parent f670d25 commit d1ed4da

File tree

5 files changed

+134
-249
lines changed

5 files changed

+134
-249
lines changed

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ dependencies = [
2424
"earthkit-plots",
2525
"marimo>=0.16.5",
2626
"geopandas>=0.14.0",
27+
"peakweather",
2728
]
2829

2930
[project.optional-dependencies]
@@ -58,3 +59,6 @@ packages = [
5859
"src/verification",
5960
"src/data_input"
6061
]
62+
63+
[tool.uv.sources]
64+
peakweather = { git = "https://github.com/MeteoSwiss/PeakWeather.git" }

uv.lock

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

workflow/rules/data.smk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ if "extract_cosmo1e" in config.get("include-optional-rules", []):
5656
--steps {params.steps} \
5757
> {log} 2>&1
5858
"""
59+
60+
61+
rule download_obs_from_peakweather:
62+
localrule: True
63+
output:
64+
peakweather=directory(OUT_ROOT / "data/observations/peakweather"),
65+
run:
66+
from peakweather.dataset import PeakWeatherDataset
67+
68+
# Download the data from Huggingface
69+
ds = PeakWeatherDataset(root=output.peakweather)

workflow/rules/plot.smk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rule plot_meteogram:
2626
inference_okfile=rules.execute_inference.output.okfile,
2727
analysis_zarr=config["analysis"].get("analysis_zarr"),
2828
baseline_zarr=lambda wc: _use_first_baseline_zarr(wc),
29+
peakweather_dir=rules.download_obs_from_peakweather.output.peakweather,
2930
output:
3031
OUT_ROOT / "showcases/{run_id}/{init_time}/{init_time}_{param}_{sta}.png",
3132
# localrule: True
@@ -42,13 +43,13 @@ rule plot_meteogram:
4243
export ECCODES_DEFINITION_PATH=$(realpath .venv/share/eccodes-cosmo-resources/definitions)
4344
python {input.script} \
4445
--forecast {params.grib_out_dir} --analysis {input.analysis_zarr} \
45-
--baseline {input.baseline_zarr} \
46+
--baseline {input.baseline_zarr} --peakweather {input.peakweather_dir} \
4647
--date {wildcards.init_time} --outfn {output[0]} \
4748
--param {wildcards.param} --station {wildcards.sta}
4849
# interactive editing (needs to set localrule: True and use only one core)
4950
# marimo edit {input.script} -- \
5051
# --forecast {params.grib_out_dir} --analysis {input.analysis_zarr} \
51-
# --baseline {input.baseline_zarr} \
52+
# --baseline {input.baseline_zarr} --peakweather {input.peakweather_dir} \
5253
# --date {wildcards.init_time} --outfn {output[0]} \
5354
# --param {wildcards.param} --station {wildcards.sta}
5455
"""

0 commit comments

Comments
 (0)