Skip to content

Add functions for loading spatial nodes and visualization#17

Merged
yyexela merged 1 commit into
mainfrom
new-dataset-msfr
Apr 17, 2026
Merged

Add functions for loading spatial nodes and visualization#17
yyexela merged 1 commit into
mainfrom
new-dataset-msfr

Conversation

@Steriva
Copy link
Copy Markdown
Contributor

@Steriva Steriva commented Apr 17, 2026

This pull request adds new visualization capabilities for spatial data, particularly for datasets with 2D spatial structure, and introduces a utility for loading mesh/node information. The main changes are the addition of spatial average and 2D contour plotting functions, along with support for overlaying a "blanket" region for the MSFR dataset.

Visualization enhancements:

  • Added plot_spatial_averages and plot_2d_contours methods to the Visualizer class in visualization_module.py to enable plotting of spatial averages over time and 2D contour comparisons between truth and predictions. This includes logic for handling multiple fields and predictions, as well as flexible configuration options.
  • Updated the plot_from_batch method to support new plot types: "spatial_averages" and "contour2d", including loading mesh nodes and handling dataset-specific overlays.
  • Added add_blanket_msfr function to overlay a white rectangle representing the blanket region in the MSFR dataset on 2D contour plots.

Data loading utility:

  • Introduced a new load_nodes function in data_module.py to load spatial mesh/node data (nodes.npy) for a given dataset, raising an error if the file is missing.

@Steriva Steriva requested a review from yyexela April 17, 2026 15:33
@yyexela
Copy link
Copy Markdown
Collaborator

yyexela commented Apr 17, 2026

Looks good to me! Ran naive baseline and verified all plots generated and looked ok. Thanks Stefano!

@yyexela yyexela merged commit 57aba2f into main Apr 17, 2026
3 checks passed
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.

2 participants