-
Notifications
You must be signed in to change notification settings - Fork 10
Basic conversion operators for humidity, temperature and pressure #1865
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
Open
daflack
wants to merge
91
commits into
main
Choose a base branch
from
1852_conversion_operators
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
9e232ee
Basic conversion operators for humidity, temperature and pressure
daflack c072a26
Add mixing ratio to specific humidity operator
daflack 191ac7c
Add standard atmospheric constants
daflack 2dc4795
Add vapour pressure conversion
daflack f6ca912
Add vapour pressure if dewpoint unknown
daflack b49f776
Update naming convections for vapour pressures
daflack cef08a9
Calculate saturation mixing ratio and specific humidity
daflack 9cf07b2
Rename vapour_pressure_if_dewpoint_unknown to vapour_pressure_from_RH
daflack 80b08f6
Add mixing ratio from relative humidity conversion
daflack 3d87c7a
Add specific humidity from RH conversion
daflack bff14ae
Add relative humidity conversions from mixing ratio and specific
daflack 7be43e7
Add dewpoint temperature calculation
daflack 678d89c
Add virtual temperature calculation
daflack d258924
Update atmospheric constants with kappa
daflack a925103
Add potential temperature and exner pressure convertors
daflack 68ea438
Adds virtual potential temperature convertor
daflack 4084822
Adds equivalent potential temperature conversion and fixes unit assig…
daflack d9f1d0c
Remove if loop for RH and switch to convert units
daflack ae72d4e
Adds wet-bulb temperature convertor
daflack 4fe1e39
Adds relevant references for temperature calculations where required
daflack e7d7297
Adds wet-bulb potential temperature convertor
daflack dfe7657
Adds saturation equivalent potential temperature convertor
daflack 1c6fef4
Adds to init file and updates name for atmospheric constants
daflack 2e0bd49
Update argument names in specific humidity to mixing ratio and vice
daflack a1a9fd0
Uses convert_units for pressure consistency
daflack be0eb2d
Adds names to humidity cubes where missing
daflack cdecfc5
Correct units
daflack 127fecb
Adds tests data and fixtures
daflack db88423
Update copyright year
daflack 19d63be
Add tests for vapour pressure
daflack 51da41f
Update to assignment in pressure convertors
daflack 25ebb9b
Rename vapour_pressure_from_RH to relative_humidity_to_vapour_pressure
daflack 5251814
Adds tests for relative_humidity_to_vapour_pressure
daflack dea81b0
Adds tests for exner pressure
daflack 9041869
Uses atmospheric constants in tests
daflack 26dccaf
Change to vapour pressure from relative humidity as more intuitive
daflack 3a7a197
Update aming convention to be x_from_y rather than y_from_x
daflack 3a46b54
Update operators in temperature for correct conversion name
daflack 7d78260
Adds test data and fixtures for humidity convertors
daflack 6b420f5
Adds tests for specific humidity and mixing ratio conversions
daflack 95386b0
Adds tests for saturation mixing ratio
daflack 00e4039
Adds tests for saturation specific humidity
daflack 2c7c267
Adds tests for mixing ratio from relative humidity
daflack bdd90eb
Adds tests for specific humidity from relative humidity
daflack 6e8ed4f
Adds tests for relative humidity from mixing ratio
daflack 3a5ec8d
Update tests for relative humidity from mixing ratio and correct RH
daflack 4f65220
Adds tests for relative humidity from specific humidity
daflack 21671c8
Adds tests and fixes calculation for dewpoint temperature
daflack 0bbed29
Adds tests for virtual temperature
daflack 201a187
Adds tests for wet-bulb temperature conversions
daflack c4e383c
Adds tests for potenital temperature
daflack 4c59f41
Adds tests for virtual potential temperature
daflack a0a3fe1
Adds tests for equivalent potential temperature
daflack a6535a2
Adds tests for saturation equivalent potenital temperature
daflack 9809d46
Adds tests for wet-bulb potential temperature and fixes its calculation
daflack e1098fb
Add documentation to _atomspheric_constants.py
daflack b8918a2
Update copyright years
daflack 1370f60
Add documentation to exner pressure and fix brackets in beaufort scale
daflack fe67c08
Adds documentation for vapour pressure conversion
daflack 8ef9d26
Adds documentation for vapour_pressure_from_relative_humidity
daflack 8457637
Adds documentation for specific humidity and mixing ratio conversions
daflack 3f43d06
Adds documentation for specific humidity and mixing ratio from RH
daflack 9b4a4cf
Adds documentation for relative humidity conversions from different
daflack 1523c50
Adds documentation for dewpoint temperature
daflack 743f30b
Fix documentaiton
daflack 469eda7
Adds documentation for virtual temperature
daflack e772aac
Adds documentation for wet-bulb temperature
daflack fb0f655
Adds further documentation to wet-bulb temperature
daflack 4752491
Adds potential temperature documentation
daflack d2499e1
Adds virtual potential temperature documentation
daflack 52b6e34
Adds documentation for wet-bulb potential temperature
daflack 3dccf83
Adds equivalent potenital temperature documentation
daflack 472b289
Adds clarification to theta_e documentation
daflack 24d6e6a
Adds saturation equivalent potenital temperature documentation
daflack 0f9eaae
Update copyright years
daflack d192448
Update humidity.py
Sylviabohnenstengel 7266f67
Update humidity.py
Sylviabohnenstengel 5421039
Update humidity.py
Sylviabohnenstengel 6de578c
Update humidity.py
Sylviabohnenstengel bb9e6b5
Update humidity.py
Sylviabohnenstengel 081e872
Update humidity.py
Sylviabohnenstengel 01240c6
Update pressure.py
Sylviabohnenstengel dae1ab5
Update pressure.py
Sylviabohnenstengel 4d59531
Update pressure.py
Sylviabohnenstengel fe3aaba
Update temperature.py
Sylviabohnenstengel afde16f
Update temperature.py
Sylviabohnenstengel 7d439b1
Update temperature.py
Sylviabohnenstengel d503287
Update temperature.py
Sylviabohnenstengel a0e81cd
Update temperature.py
Sylviabohnenstengel 1e3e9fc
Update temperature.py
Sylviabohnenstengel fd29736
Update temperature.py
Sylviabohnenstengel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # © Crown copyright, Met Office (2022-2026) and CSET contributors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| """Constants for the atmosphere.""" | ||
|
|
||
| # Reference pressure. | ||
| P0 = 1000.0 # hPa. | ||
|
|
||
| # Specific gas constant for dry air. | ||
| RD = 287.0 # J/kg/K. | ||
|
|
||
| # Specific gas constant for water vapour. | ||
| RV = 461.0 # J/kg/K. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 461.52? |
||
|
|
||
| # Specific heat capacity for dry air. | ||
| CPD = 1005.7 # J/kg/K. | ||
|
|
||
| # Latent heat of vaporization. | ||
| LV = 2.501e6 # J/kg/K. | ||
|
|
||
| # Reference vapour pressure. | ||
| E0 = 6.1078 # hPa. | ||
|
|
||
| # Reference temperature. | ||
| T0 = 273.15 # K. | ||
|
|
||
| # Ratio between mixing ratio of dry and moist air. | ||
| EPSILON = 0.622 | ||
|
|
||
| # Ratio between specific gas constant and specific heat capacity. | ||
| KAPPA = RD / CPD | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
change to 287.05?