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
EL calculation #338
EL calculation #338
Conversation
metpy/calc/tests/test_thermo.py
Outdated
@@ -190,3 +190,12 @@ def test_equivalent_potential_temperature(): | |||
t = 288. * units.kelvin | |||
ept = equivalent_potential_temperature(p, t) | |||
assert_almost_equal(ept, 315.9548 * units.kelvin, 3) | |||
|
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.
Missed a blank line (for pep8)
metpy/calc/tests/test_thermo.py
Outdated
|
||
def test_el(): | ||
"""Test equilibrium layer calculation.""" | ||
levels = np.array([959., 779.2, 751.3, 724.3, 700., 269.]) * units.mbar |
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.
These are indented at 5 spaces.
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.
What the!?
Should we have a test for the no EL case as well? Seems like a good idea. |
I think that's an important edge case to verify it works--have you even tried that? The existing 3 May 1999 data should suffice for this. |
Yes, I did try it on real data with no problems. I'll add a test now. |
73b17d4
to
f2151c1
Compare
Weird about appveyor--I guess you need to resolve the merge conflict? |
8bb3df6
to
ee564f2
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.
Minor nitpick, otherwise this looks good.
metpy/calc/thermo.py
Outdated
# If there is only one intersection, it's the LFC and we return None. | ||
if len(x) <= 1: | ||
return None, None | ||
|
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.
Can we nuke the extra blank line?
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 found something to improve in the docs.
metpy/calc/thermo.py
Outdated
r"""Calculate the equilibrium level. | ||
|
||
This works by finding the last intersection of the ideal parcel path and | ||
the measured parcel temperature. If there is one or fewer intersections, there is |
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.
measured environmental temperature
Pulls out the EL calculation from #322