Add meteogram and centralise plot style#192
Conversation
- observations in red; x-axis as lead time (h), no rotated labels - dashed gridlines (24h major / 6h minor); larger fonts (13/16pt) - "Init time" in title; DD_10M drawn as markers on a 0-360 axis - fix baseline CLI key (baselines->baseline) so --baseline is honored - submit publication_meteogram via SLURM (compute node) instead of localrule
- one place for colors, markers, line styles, font sizes, and full variable names - palette: obs #4ecb8d, ICON-CH1 #008dff, ICON-CH2 #003a7d, Varda #d83034 - observations drawn as green dots; full-name panel labels (e.g. "2m temperature") - precip grey shading derived from axes tight bboxes (font-robust, no skew) - both publication_figures.py and publication_meteogram.py import the shared module
There was a problem hiding this comment.
Can't we reuse the existing MeteogramConfig class?
jonasbhend
left a comment
There was a problem hiding this comment.
Thanks for pushing this. Really like the suggested colours. I think we should adopt the matplotlib style sheets for better readability.
There was a problem hiding this comment.
I don't understand. Why do we need this on top of the meteogram functionality that is already available in the showcases module / part? Seems like an unnecessary duplication to me.
| if "SP_10M" in display_params and have_uv: | ||
| ds["SP_10M"] = wind_speed(ds["U_10M"], ds["V_10M"]) | ||
| if "DD_10M" in display_params and have_uv: | ||
| ds["DD_10M"] = wind_direction_deg(ds["U_10M"], ds["V_10M"]) |
There was a problem hiding this comment.
Should an error be raised if something we cannot compute wind speed and direction (but would like to)?
| """Flatten a single-station dataset to long form. | ||
|
|
||
| Returns columns [source, valid_time, param, value]. The time coordinate is | ||
| `valid_time` if present, else `time`. Params absent from `ds` are skipped. |
There was a problem hiding this comment.
Here again, should we raise an error if absent?
There was a problem hiding this comment.
I like the idea behind this. unfortunately I have only now discovered the matplotlib style sheets (https://matplotlib.org/stable/users/explain/customizing.html), that probably would be more suitable, what do you think?
| rule publication_all: | ||
| """Target rule for publication figures workflow.""" | ||
| input: | ||
| ( | ||
| rules.publication_figures.output | ||
| if config.get("publication", {}).get("enabled", False) | ||
| else [] | ||
| ), |
There was a problem hiding this comment.
All the other integral rules are in the top-level snakefile (e.g. experiment_all, ...). Is it necessary to move this one into the specific rule file?
AI-assisted implementation!
This PR adds meteograms for publication, centralises some ploting style things, uses long names for variables and tries out some colors :)
Any feedback and changes welcome!
To run only plotting:
Current version of the plots: