Skip to content
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

Merged
merged 2 commits into from Mar 21, 2017
Merged

Psychrometric RH #345

merged 2 commits into from Mar 21, 2017

Conversation

jrleeman
Copy link
Contributor

Add capability to calculate the vapor pressure and relative humidity from wet and dry bulb temperatures. Supersedes #155

@jrleeman
Copy link
Contributor Author

Should we have a separate test for passing a kwarg to relative_humidity_wet_psychrometric ?

@jrleeman jrleeman force-pushed the Psychrometric_RH branch 2 times, most recently from b6ededf to a6d3c2e Compare March 13, 2017 20:06
@jrleeman
Copy link
Contributor Author

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.

@dopplershift
Copy link
Member

Nuke the commit, but credit the idea in the commit message.

@dopplershift dopplershift modified the milestone: 0.5.0 Mar 16, 2017
@dopplershift dopplershift added Area: Calc Pertains to calculations Type: Feature New functionality labels Mar 16, 2017
Copy link
Member

@dopplershift dopplershift left a 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.

Returns
-------
`pint.Quantity`
Vapour pressure
Copy link
Member

Choose a reason for hiding this comment

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

Vapour?

Copy link
Member

@dopplershift dopplershift left a 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.

saturation_vapor_pressure
"""
return (saturation_vapor_pressure(web_bulb_temperature) - psychrometer_coefficient *
pressure * (dry_bulb_temperature.to('kelvin') - web_bulb_temperature.to('kelvin')))
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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).

@jrleeman jrleeman force-pushed the Psychrometric_RH branch 3 times, most recently from 1045e92 to 7b5f765 Compare March 17, 2017 16:14
@jrleeman
Copy link
Contributor Author

The unit modification works with the coefficient in 1/K, 1/delta_degC, and 1/delta_degF for those who must try those.

Copy link
Member

@dopplershift dopplershift left a 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!

@dopplershift dopplershift merged commit 3839f8e into Unidata:master Mar 21, 2017
@jrleeman jrleeman deleted the Psychrometric_RH branch April 4, 2017 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants