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
Psychrometric RH #345
Psychrometric RH #345
Conversation
Should we have a separate test for passing a kwarg to |
b6ededf
to
a6d3c2e
Compare
Thoughts on the CLA? We can blast past it since the original PR was pre CLA or since I've rewritten it all, we can nuke that cherry pick. |
Nuke the commit, but credit the idea in the commit message. |
a6d3c2e
to
e104496
Compare
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.
Just fix the spelling of vapor 😁
Good job digging up some firm references.
metpy/calc/thermo.py
Outdated
Returns | ||
------- | ||
`pint.Quantity` | ||
Vapour pressure |
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.
Vapour?
e104496
to
7667377
Compare
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.
Sorry I didn't catch this before.
metpy/calc/thermo.py
Outdated
saturation_vapor_pressure | ||
""" | ||
return (saturation_vapor_pressure(web_bulb_temperature) - psychrometer_coefficient * | ||
pressure * (dry_bulb_temperature.to('kelvin') - web_bulb_temperature.to('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.
Verify that these explicit conversions are actually necessary--I don't think they are.
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.
We can ditch them if we enforce that the psychrometer coefficient is in units of 1/K. Otherwise is someone throws a 1/degF coefficient at it, everything blows up. Thoughts?
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.
Here's a few examples - I think we may even need to enforce that the coefficient be in 1/K manually:
coefficient = 6.0 / units.degK
T1 = 70 * units.degF
T2 = 13 * units.degC
print(coefficient*(T1-T2))
print(coefficient*((T1-T2).to('degK')))
87.5999976000002 delta_degF / kelvin
48.66666533333344 dimensionless
coefficient = 6.0 / units.degC # or degF, same behavior
T1 = 70 * units.degF
T2 = 13 * units.degC
print(coefficient*(T1-T2))
print(coefficient*((T1-T2).to('degK')))
OffsetUnitCalculusError: Ambiguous operation with offset unit (1 / degF, delta_degF).
1045e92
to
7b5f765
Compare
The unit modification works with the coefficient in |
7b5f765
to
c8ce8f2
Compare
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.
Let's squish these commits down a bit, then I'd say we're good to go!
c8ce8f2
to
1103b18
Compare
Add capability to calculate the vapor pressure and relative humidity from wet and dry bulb temperatures. Supersedes #155