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

Added thermo calculations #337

Merged
merged 6 commits into from
Mar 6, 2017
Merged

Added thermo calculations #337

merged 6 commits into from
Mar 6, 2017

Conversation

nawendt
Copy link
Contributor

@nawendt nawendt commented Mar 3, 2017

Virtual temperature, virtual potential temperature, and density
calculations were added to the thermo module. This addresses need for
a density calculation to allow for computation of EPV. Tests for these
calculations were also added.

See also: #231

Virtual temperature, virtual potential temperature, and density
calculations were added to the thermo module. This addresses need for
a density calculation to allow for computation of EPV.

See also: #231
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.

This is great--just a few minor stylistic nits that I've pointed out (there are a few more caught by Travis/AppVeyor--they're all the same. See here for instance.)

Big kudos for adding references and the equations in as well.

@@ -9,7 +9,8 @@
from metpy.calc import (dewpoint, dewpoint_rh, dry_lapse, equivalent_potential_temperature,
lcl, lfc, mixing_ratio, moist_lapse, parcel_profile,
potential_temperature, saturation_mixing_ratio,
saturation_vapor_pressure, vapor_pressure)
saturation_vapor_pressure, vapor_pressure, virtual_temperature,
virtual_potential_temperature, density)
Copy link
Member

Choose a reason for hiding this comment

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

Can you move density to the front of the list (it's kept alphabetical)?

"""
return temperature * ((mixing + molecular_weight_ratio)/(molecular_weight_ratio * (1 + mixing)))

@exporter.export
Copy link
Member

Choose a reason for hiding this comment

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

Can you add an extra blank line?

@dopplershift
Copy link
Member

Can you click next to clahub above and electronically sign our Contributor License Agreement? See here for the rationale behind it.

@dopplershift dopplershift self-assigned this Mar 3, 2017
@dopplershift
Copy link
Member

@jrleeman will this virtual temperature function be compatible with you CAPE work?

Nathan Wendt added 3 commits March 3, 2017 19:46
Clean up code to match metpy/PEP8 style in thermo module
See also: #337
Fixed white space and import order in thermo module and tests
See also: #337
A previous fix to the test_thermo module led to an incidental double
import. This has been fixed. Small PEP8 whitespace issue also fixed.
See also: #337
@nawendt
Copy link
Contributor Author

nawendt commented Mar 4, 2017

Looks like I fixed the style issues. Let me know if you find anything else to take care of.

@jrleeman
Copy link
Contributor

jrleeman commented Mar 4, 2017

Thanks! I'll have a look and make sure the virtual temperature calculation jives with one on a branch currently and let you know. This is great work!

Copy link
Contributor

@jrleeman jrleeman left a comment

Choose a reason for hiding this comment

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

A really minor thing for the doc build.


Notes
-----
.. math:: T_v = T \frac{\textsl{w} + \epsilon}{\epsilon\,(1 + \textsl{w})}
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind changing the \textsl to \text? The documentation build doesn't know \textsl and it renders poorly on the online docs. Thanks!


Notes
-----
.. math:: \Theta_v = \Theta \frac{\textsl{w} + \epsilon}{\epsilon\,(1 + \textsl{w})}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same \textsl issue

Removed latex \textsl command causing rendering issues in docs

See also: #337
@jrleeman
Copy link
Contributor

jrleeman commented Mar 6, 2017

@nawendt - One last thing if you don't mind (if you want we can take care of it on this end as well). The new functions need to be added to the documentation build. In docs/api/thermo.rst simply add the following below equivalent_potential_temperature:

virtual_temperature
virtual_potential_temperature
density

Sphinx-generated docs needed hooks to included newest thermo functions

See also: #337
@jrleeman jrleeman merged commit 50fa1d0 into Unidata:master Mar 6, 2017
@dopplershift
Copy link
Member

Congratulations on your first Metpy PR--thanks for the contribution!

@dopplershift dopplershift modified the milestone: Spring 2017 Mar 10, 2017
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.

3 participants