Skip to content

161 spatial metrics - #177

Merged
havardhhaugen merged 30 commits into
mainfrom
161-spatial-metrics
Sep 16, 2025
Merged

161 spatial metrics#177
havardhhaugen merged 30 commits into
mainfrom
161-spatial-metrics

Conversation

@havardhhaugen

@havardhhaugen havardhhaugen commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

This pr implements a new output class Spatial, from which specific spatial outputs can subclass. The Spatial class is intended for outputs which do some sort of spatial operation, and it writes outputs as netcdf files with dimensions (time, leadtime, ensemble_member, *metric_specific_dimensions).

So far I have implemented two spatial outputs:

  • powerspectrum_global (used for global grids)
  • powerspectrum_gridded (used for regular projected grids)

Example config

routing:
  - decoder_index: 0
    domain_index: 0
    outputs:
      - powerspectrum_global:
          filename: ${ps_dst_folder}/ps_n320_ws.nc
          variable: ws

Introduces a new dependency pyshtools (used to calculate spherical harmonics fourier transform)

@havardhhaugen havardhhaugen linked an issue Sep 12, 2025 that may be closed by this pull request
@havardhhaugen

Copy link
Copy Markdown
Contributor Author

Tests failing because pyshtools is missing from the test environment, I don't know where to fix that.

@ways

ways commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Tests failing because pyshtools is missing from the test environment, I don't know where to fix that.

Added.

@ways ways left a comment

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.

No comments. I'd love a tox test (with config and necessary test data). For debugging, avoiding regressions and as example usage.

@havardhhaugen

Copy link
Copy Markdown
Contributor Author

No comments. I'd love a tox test (with config and necessary test data). For debugging, avoiding regressions and as example usage.

I made unit tests for the two new outputs, and I'll update the documentation once this has been merged.

Comment thread bris/outputs/spatial.py Outdated
Comment thread bris/outputs/spatial.py Outdated
Comment thread bris/outputs/spatial.py Outdated
Comment thread bris/outputs/spatial.py
@havardhhaugen

Copy link
Copy Markdown
Contributor Author

Good to merge this?

@havardhhaugen
havardhhaugen merged commit f24db4e into main Sep 16, 2025
1 check 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.

Spatial metrics

3 participants