-
Notifications
You must be signed in to change notification settings - Fork 446
Saturation Vapor Pressure #532
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
Conversation
jrleeman
left a comment
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.
Some cleanup to do.
| Instead of temperature, dewpoint may be used in order to calculate | ||
| the actual (ambient) water vapor (partial) pressure. | ||
| The formula used is that from [Koutsoyiannis2012]_ for T in degrees Celsius: |
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.
No such reference in the docs.
| ####### | ||
| # This version uses MetPy constants with the Koutsoyiannis2012 formula | ||
| sat_pressure = 6.11657 * units.hPa | ||
| T0 = 273.16 * units.kelvin |
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.
273.15?
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.
IIRC, It's 0.01K above the freezing point
| The formula used is that from [Koutsoyiannis2012]_ for T in degrees Celsius: | ||
| .. math:: 6.112 e^\frac{17.67T}{T + 243.5} |
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.
Shouldn't this reflect the implementation in the function?
|
|
||
| ################### | ||
| # This is the same as above, but incorporates a variable Lv | ||
| sat_pressure = 6.11657 * units.hPa |
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.
Same comments as previous function
| # a formula plays havoc with units support. | ||
|
|
||
| ################### | ||
| # This is the same as above, but incorporates a variable Lv |
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.
Use a function name here - no guarantees as to function ordering being preserved.
|
|
||
| @exporter.export | ||
| @check_units('[temperature]') | ||
| def saturation_vapor_pressure_metpy_orig(temperature): |
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.
I don't know if this stays, but if it does the spelling will have to be determined.
|
Just to clarify, this is waiting for a determination of which method to go with. Then the others will be removed, docstring updated, and tests updated. |
|
I doubt a decision will be made before 0.6, but it's good to have this hanging around so we can move quickly when we have the cycles for it. |
|
@dopplershift Not a problem, just letting both of you know that a detailed code review is not really important at this stage. |
DWesl
left a comment
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.
Some suggestions for the pint decorators to ensure the units wind up how the function expects, though I had to guess at what those units actually were. Reading the referenced papers would likely help with those guesses.
#3726 seems to have similar ideas, if you want to poke at that.
|
|
||
|
|
||
| @exporter.export | ||
| @check_units('[temperature]') |
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.
| @check_units('[temperature]') | |
| @check_units('degC') |
Given the conversion to Kelvin, I think this would be the right units
|
|
||
|
|
||
| @exporter.export | ||
| @check_units('[temperature]') |
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.
| @check_units('[temperature]') | |
| @check_units('kelvin') |
I'm guessing, given the division
|
|
||
|
|
||
| @exporter.export | ||
| @check_units('[temperature]') |
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.
| @check_units('[temperature]') | |
| @check_units('kelvin') |
This one actually does specify
|
#3726 updated the calculation to use Ambaum (2020) and incorporate saturation over ice as well. The Ambaum (2020) formulation is very similar to the desired approach here, so we can close this. |
This contains implementations of the different methods of calculating saturation vapor pressure referenced in #508. When a method is chosen, the others can be removed from the thermo file and tests updated, along with better documentation.