-
Notifications
You must be signed in to change notification settings - Fork 1
99 Plot Raw Input Maps #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Reviewing this |
|
I'm currently getting an error when I try to run this - the environment won't load: It looks like it relates to the fact that Do you get the same error @LydiaFrance? |
|
Okay, conflicts with main now resolved and tests are now passing on Github actions. Good to go for checking on Baskerville @IFenton 🎉 🎈 |
|
Excellent. I'll test it out. In the meantime, my initial comments were:
|
|
Seems to be running fine for me locally, though I still need to test it on Baskerville (I'll do that tomorrow). It does occur to me thought that currently it will overwrite plots with the same name. Do we want to add a date stamp to the name? Or save them to a particular folder for that run? |
Yay!
I think if you're plotting related to a run, you should use the wandb workflow as part of evaluate and plot it that way. You can find them inside media>images>raw_plots or media>videos>raw_plots with unique identifiers. The local saving should really just be for "I want some pretty pictures for my presentation and just want it locally right now without trying to evaluate the model". |
I hadn't noticed it also saved in the wandb run. I wonder if you should set the |
Yes, that's up to the user about where they want their files/if it is saved locally. |
Thanks for spotting these @IFenton, I have fixed both now. You can have scientific notation on your colour bars now if you like, I personally don't like that so I have also provided suitable decimal places for the q_ humidity plots (commented out). Check out |
IFenton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this both locally and on Baskerville and it works fine.
However, not all the config options work as I expected (I don't know if that is because I misinterpreted them, or because they aren't working properly). I've added notes to the yaml with my queries.
| Plot raw input variables from the test dataset: | ||
|
|
||
| ```bash | ||
| uv run zebra visualisations plot-raw-inputs --config-name <your local config>.yaml --sample-idx 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe explain what the sample-idx argument is doing? Is it the same as the timestep_index?
| raw_inputs: | ||
| # Callback to plot raw input variables (ERA5 data, etc.) | ||
| _target_: ice_station_zebra.callbacks.RawInputsCallback | ||
| frequency: null # Plot once; set N to repeat every N batches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running through evaluate, the files are to be overwritten, so you end up with only the final batch in the folder / on wandb. It doesn't seem to do anything when I run it with the visualisation command
| # Callback to plot raw input variables (ERA5 data, etc.) | ||
| _target_: ice_station_zebra.callbacks.RawInputsCallback | ||
| frequency: null # Plot once; set N to repeat every N batches | ||
| timestep_index: 0 # Which history timestep to plot (0 = most recent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working as I would expect with evaluate, but the plotting date in the title isn't changing, so it's a bit hard to be certain. It doesn't seem to do anything when run through visualisation
| video_fps: 2 # Frames per second for animations | ||
| video_format: gif # mp4 or gif | ||
| video_save_dir: ./raw_input_animations # Directory to save animations (null to skip disk save) | ||
| max_animation_frames: null # Limit frames (null = unlimited; 30 ≈ 1 month daily data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works as expected, by for some reason, if I create the videos using visualisation it seems to default to 27 days, whereas using evaluate it defaults to 14 days
| # Plot specification (colourmap, hemisphere, etc.) | ||
| plot_spec: | ||
| _target_: ice_station_zebra.types.PlotSpec | ||
| variable: "raw_inputs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't work out how to use this (maybe because I had the wrong format of the variable name)? Or is it just that this is in contrast to predictions? Maybe add a comment explaining
| plot_spec: | ||
| _target_: ice_station_zebra.types.PlotSpec | ||
| variable: "raw_inputs" | ||
| colourmap: "viridis" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this didn't seem to do anything, maybe because all the colour maps are already specified below?
New callback and CLI for visualising raw input variables.
Static Images (a selection)
Animation (e.g. temp)
Running
Or as part of the evaluate command:
If you have options like this in your local yaml file:
Also improves plotting and metadata handling, and enhances configuration options for evaluation and visualisation.
Copilot's Summary
Visualisation Features
RawInputsCallbackfor plotting and animating raw input variables during evaluation, with detailed configuration for styling and output. This includes a new YAML config (raw_inputs.yaml), updates to the default callbacks, and CLI integration for visualisation commands. [1] [2] [3] [4] [5] [6] [7] [8]input_variable_namesandvariable_namesproperties to dataset classes for robust variable handling and naming in visualisations. [1] [2]Plotting and Metadata Improvements
PlotSpecand plotting callbacks to support hemisphere and metadata subtitle detection, auto-titling, and enhanced footer metadata control. [1] [2] [3] [4] [5] [6] [7]Animation and Plotting Infrastructure
animation_helper.pyto manage matplotlib animation lifecycle and prevent garbage collection issues during video saving.Configuration and Linting
.pre-commit-config.yamlto ensure filenames are passed to Ruff linter and formatter for correct operation.Documentation
README.mdwith clear instructions for new visualisation features, including plotting and animating raw inputs.