Skip to content

Feature: volume and mass integration utilities, prism-volume test and notebook examples - #9

Merged
kjnam merged 6 commits into
mainfrom
feature/volume-and-mass-calculations
Aug 3, 2026
Merged

Feature: volume and mass integration utilities, prism-volume test and notebook examples#9
kjnam merged 6 commits into
mainfrom
feature/volume-and-mass-calculations

Conversation

@aesgeorges

Copy link
Copy Markdown
Contributor

This PR introduces new grid-integration utilities for volume and mass calculations, adds a focused synthetic unit test for prism-volume behavior, and extends the example subset notebook with end-to-end usage and comparison plots between the two volume calculation functions implemented.

What was added?

  1. Integration routines in integrate.py:
  • projected prism-volume calculation (public entry point): calc_volumes_from_projected
  • uxarray-based spherical volume calculations
  • mass caulcation using TEOS-10 density equations via gsw
  1. Added synthetic test in test_volume.py
  2. Added examples in example_subset.ipynb:
  • compares projected vs uxarray volume calculations
  • includes mass calculation example
  1. Added gsw>=3.6 dependency for density-to-mass calculations.

Alexandre Georges added 4 commits July 27, 2026 10:10
…te.py

Two functions are implemented, one using planar coordinates extending Suxarray nodal integration routies (`_calculate_prism_volumes`) and one leveraging a uxarray based routine (`_calculate_volumes_uxarray`). One of these two methods may be dropped at a later time. The mass calculation function (`_calculate_mass`) may also be temporary. It uses the TEOS-10 equations for calculating density and uses the gsw package.
For volume calculations, both methods `calc_volumes_from_projected` and `_calculate_volumes_uxarray` are used and their results compared.
@aesgeorges
aesgeorges requested a review from kjnam July 27, 2026 17:25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@aesgeorges We can leave garbage values for unused layers. Also, we do not want to integrate with zeros later. We can discuss about this later while we are moving forward with this.

@kjnam
kjnam merged commit 7fc548d into main Aug 3, 2026
2 checks passed
@kjnam
kjnam deleted the feature/volume-and-mass-calculations branch August 4, 2026 18:42
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