Skip to content

Basic conversion operators for humidity, temperature and pressure#1865

Open
David Flack (daflack) wants to merge 92 commits intomainfrom
1852_conversion_operators
Open

Basic conversion operators for humidity, temperature and pressure#1865
David Flack (daflack) wants to merge 92 commits intomainfrom
1852_conversion_operators

Conversation

@daflack
Copy link
Copy Markdown
Collaborator

@daflack David Flack (daflack) commented Jan 2, 2026

Creates a series of basic conversion operators, not worrying about grid staggering or vertical levels at this point. The humidity, pressure, and temperature are all treated together due to the fact that they are strongly linked to each other and require the mix of code to be calculated.

Fixes #1852.

Contribution checklist

Aim to have all relevant checks ticked off before merging. See the developer's guide for more detail.

  • Documentation has been updated to reflect change.
  • New code has tests, and affected old tests have been updated.
  • All tests and CI checks pass.
  • Ensured the pull request title is descriptive.
  • Conda lock files have been updated if dependencies have changed.
  • Attributed any Generative AI, such as GitHub Copilot, used in this PR.
  • Marked the PR as ready to review.

@daflack David Flack (daflack) self-assigned this Jan 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 2, 2026

Coverage

@daflack
Copy link
Copy Markdown
Collaborator Author

David Flack (daflack) commented Jan 2, 2026

Conversions required, once basic code is done (excluding tests and full documentation will tick off)

A set of conversion operators for different humidity variables to be stored under humidity.py:

  • specific humidity to mixing ratio
  • mixing ratio to specific humidity
  • specific humidity to relative humidity
  • mixing ratio to relative humidity
  • relative humidity to specific humidity
  • relative humidity to mixing ratio

A set of derived temperature operators in 'temperature.py':

  • Virtual temperature
  • Dewpoint temperature
  • Wet-bulb temperature
  • Potential temperature
  • Equivalent potential temperature
  • Virtual potential temperature
  • Saturation potential temperature
  • Wet-bulb potential temperature

A set of derived pressure operators in 'pressure.py':

  • Vapour pressure
  • Vapour pressure from RH
  • Exner pressure

@daflack David Flack (daflack) force-pushed the 1852_conversion_operators branch 2 times, most recently from 5be21d9 to e917bd6 Compare January 5, 2026 13:43
@daflack
Copy link
Copy Markdown
Collaborator Author

David Flack (daflack) commented Jan 5, 2026

Once full documentation done, will tick off.

A set of conversion operators for different humidity variables to be stored under humidity.py:

  • specific humidity to mixing ratio
  • mixing ratio to specific humidity
  • specific humidity to relative humidity
  • mixing ratio to relative humidity
  • relative humidity to specific humidity
  • relative humidity to mixing ratio

A set of derived temperature operators in 'temperature.py':

  • Virtual temperature
  • Dewpoint temperature
  • Wet-bulb temperature
  • Potential temperature
  • Equivalent potential temperature
  • Virtual potential temperature
  • Saturation potential temperature
  • Wet-bulb potential temperature

A set of derived pressure operators in 'pressure.py':

  • Vapour pressure
  • Vapour pressure from RH
  • Exner pressure

@daflack
Copy link
Copy Markdown
Collaborator Author

David Flack (daflack) commented Jan 5, 2026

Once tests done, will tick off.

A set of conversion operators for different humidity variables to be stored under humidity.py:

  • specific humidity to mixing ratio
  • mixing ratio to specific humidity
  • specific humidity to relative humidity
  • mixing ratio to relative humidity
  • relative humidity to specific humidity
  • relative humidity to mixing ratio

A set of derived temperature operators in 'temperature.py':

  • Virtual temperature
  • Dewpoint temperature
  • Wet-bulb temperature
  • Potential temperature
  • Equivalent potential temperature
  • Virtual potential temperature
  • Saturation potential temperature
  • Wet-bulb potential temperature

A set of derived pressure operators in 'pressure.py':

  • Vapour pressure
  • Vapour pressure from RH
  • Exner pressure

@daflack
Copy link
Copy Markdown
Collaborator Author

Recommendation is for a technical review and a science review. Suggested approach is to either review by commits or do each operator in turn as you see fit/as is easiest for you.

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.

Thank you for coding up this long list of conversions. I only have made few changes and happy to approve once a technical review has been conducted. I have put the emphasis of the review on the operators incl unit checks, equation checks etc. The tests look sensible to me i.e. checking metadata and physics, but i have not checked them in detail.

@Sylviabohnenstengel
Copy link
Copy Markdown
Member

David Flack (@daflack) James Frost (@jfrost-mo) I have done the review and included a number of minor commits. Over to you James Frost (@jfrost-mo) for science and technical review and then happy to approve. Thank David Flack (@daflack) for coding up the long list of conversions!

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.

Basic conversion operators

3 participants