-
Notifications
You must be signed in to change notification settings - Fork 443
Add mean pressure weighted equation #2144
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
Add mean pressure weighted equation #2144
Conversation
dopplershift
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.
Thanks for the contribution! Just a few minor commments.
Daviology38
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.
Sorry for the encoding issues, my editor screwed it up completely. Looks fixed now on my end.
Also, changed the variable from 'MWP' to 'A' as suggested, makes more sense overall.
|
Actually, I was suggesting using |
|
|
Sorry about that, still new to the GitHub workflow when pushing commits, so I accidentally close this one and reopened it. As for the changes, that makes more sense, I completely glossed over having used '( )' for the variable placeholder. I have made the recommended changes. |
dopplershift
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.
Is there any reference source that actually gives a proper definition of weighted mean?
Daviology38
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.
Removed the references to Holton2012 in place of Holton2004 and updated docstrings to add the space before the ending
|
This looks like it's gotten a little messy for some reason and it's a little hard to review. Do you think you could rebase on current the current |
69e7480 to
f378768
Compare
|
I did the rebase and force pushed the branch, hopefully that makes things easier to understand. If not, let me know any other steps I could take, still learning the ins and outs of github, but it's all starting to come together. |
c6f1f80 to
192abe1
Compare
|
Sorry, I had to do some |
Added in function for weighted_continuous_average and reverted mean_pressure_weighted changes. Adapted test for mean_pressure_weighted function to weighted_continuous_average. This new function finds the weighted continuous average of a variable over a pressure level as described in Holton.
192abe1 to
bfa45a3
Compare
This currently errors out with temperature units due to hgrecco/pint#1593.
bfa45a3 to
bdcd48e
Compare
|
Sorry this languished so long! It should be good to go now if all the tests pass. |
| def test_weighted_continuous_average_temperature(): | ||
| """Test pressure-weighted mean temperature function with vertical interpolation.""" | ||
| data = get_upper_air_data(datetime(2016, 5, 22, 0), 'DDC') | ||
| t, = weighted_continuous_average(data['pressure'], |
Check notice
Code scanning / CodeQL
Unused local variable
|
Congratulations on your first merged PR to MetPy! 🎉 We hope to see you around in the future! |
Description Of Changes
This pull request fixes #2094 by adding in the function for pressure-weighted vertical average from Holton 5th Edition 2012 page 86. The reference to Holton 2012 was also added into the references sheet.
Checklist