Skip to content

Configurable showcases#144

Open
cosunae wants to merge 26 commits into
mainfrom
general_meteogram
Open

Configurable showcases#144
cosunae wants to merge 26 commits into
mainfrom
general_meteogram

Conversation

@cosunae
Copy link
Copy Markdown
Contributor

@cosunae cosunae commented May 1, 2026

The idea is to make the generation of showcases configurable.
In the config we can now specify:

  • whether we activate the generation of showcase animations and/or meteograms:
  • a list of locations
  • the region, by name a custom configured extent/projection
  • the parameters

An example

showcase:
  params:
    - T_2M
    - SP_10M
    - TOT_PREC
  meteograms: false
  animations: true
  regions:
    - europe
    - switzerland
    - name: alpine_arc
      extent: [-16.0, 25.0, 30.0, 65.0]
      projection: orthographic

  stations: [JUN, COV, GOR, WFJ, SAE, SAM, DAV, ZER, ANT, VSBAS, BRT, LTB, GOS, CEV, BIA]


Comment thread workflow/Snakefile Outdated
Copy link
Copy Markdown
Contributor

@jonasbhend jonasbhend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good (from looking at it). Will test once balfrin is back online. Could you please include the example config in the code base (e.g. in interpolators-ich1.yaml), otherwise it might be lost.

Comment thread config/interpolators-ich1.yaml Outdated
@cosunae
Copy link
Copy Markdown
Contributor Author

cosunae commented May 6, 2026

@jonasbhend did you have the chance to look at it?

Copy link
Copy Markdown
Contributor

@jonasbhend jonasbhend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cosunae, really nice. I have a minor discussion point (not sure whether we want to do this at all) and there seems to be something wrong with the precipitation scaling in the example config (run as is for meteograms only):

Image

Comment thread config/interpolators-ich1.yaml Outdated
Comment on lines +58 to +72
showcase:
params:
- T_2M
- SP_10M
- TOT_PREC
meteograms: false
animations: true
domains:
- europe
- switzerland
- name: alpine_arc
extent: [3.0, 17.0, 43.5, 48.5]
projection: orthographic

stations: [JUN] #, COV, GOR, WFJ, SAE, SAM, DAV, ZER, ANT, VSBAS, BRT, LTB, GOS, CEV, BIA]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the idea of a showcase section in the config (and as @dnerini pointed out, we should probably do that for experiments too). What I am not sure is if a more hierarchical approach would be more user-friendly, e.g.:

showcase:
    meteograms:
        plot: true
        stations: [JUN, BAS, BER]
    animations:
        plot: true
        domains: ...

Then the question is, if you want params as top level (under showcase) or params per meteogram and animations separately. Easy enough to produce one after the other, so probably no need to replicate params in both.

fyi: @frazane

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that makes lot of sense. let me refactor the config alone the lines. Concerning the question, yes, do not have much opinion, probably more in favor of as you said not duplicate too much in order to not clutter much the config with replicated params

Comment thread workflow/rules/plot.smk
python {input.script} \
--input {params.grib_out_dir} --date {wildcards.init_time} --outfn {output[0]} \
--param {wildcards.param} --leadtime {wildcards.leadtime} --region {wildcards.region} \
{params.region_extra} \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK we are running a separate job for each region in the config. As showcases are already quite slow (due to the large volume of plots being generated), wouldn't it be more efficient to plot all the regions in one call, such that we have to load the data only once?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, this is probably too hard due to the multiple outputs issue.

Copy link
Copy Markdown
Contributor Author

@cosunae cosunae May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes lot of sense. I was already thinking alone those lines, for meteograms.
Currently with snakemake we are generating rules per params x stations x runs. Each launch an individual script and re-loads the data.
Similar to your comment, I think we could re-structure the granularity, and have python scripts that handle multiple regions, or multiple locations. And perhaps params.
But yes, I think that will be a considerable refactoring. I can take a look at after this PR?

@jonasbhend jonasbhend changed the title General meteogram Configurable showcases May 7, 2026
@jonasbhend jonasbhend mentioned this pull request May 7, 2026
1 task
@cosunae
Copy link
Copy Markdown
Contributor Author

cosunae commented May 7, 2026

Thanks @cosunae, really nice. I have a minor discussion point (not sure whether we want to do this at all) and there seems to be something wrong with the precipitation scaling in the example config (run as is for meteograms only):

Image

thanks @jonasbhend , not sure I understood what would you do here?
It looks like CH2 shows very weird values probably due to the remapping of the grids and the nature of precip, but not sure what you would do with the scale?
Other examples look more reasonable... ?

202503270600_TOT_PREC_JUN

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants