Stream: python-questions
Topic: skewt params: Showalter index
Orhan Eroglu (Jan 25 2021 at 23:10):
Anyone has an understanding of Showalter Index?
We are currently implementing a function in GeoCAT-comp to provide skewt
parameters. Most of such parameters are simply outputted as a call to MetPy's existing functions; however, one significant contribution of our function would be the calculation of Showalter Index (i.e. shox).
To demonstrate our function's results, we are comparing against NCL'S skewt_2_2 (https://www.ncl.ucar.edu/Applications/Images/skewt_2_2_lg.png), but we are having significant difference between ours and NCL (NCL shox
=3, ours= -7).
The details of our implementation, what we are struggling currently, and what our findings are can be seen in this PR: https://github.com/NCAR/geocat-comp/pull/96
Briefly, NCL function seems to have a number of assumptions when calculating shox
, which is likely the reason of the difference with the results. We couldn't decide how to proceed further with our implementation (either apply NCL-like hard-coded assumptions to the data, or get rid of such assumptions at the risk of generating much different results than NCL), we would appreciate a scientific perspective here.
cc: @Matt Long
Matt Long (Jan 26 2021 at 00:13):
Perhaps @Ryan May has some useful perspective?
Ryan May (Jan 26 2021 at 18:05):
I don't have anything to offer with regards to GeoCAT vs. NCL, but I will say that adding Showalter Index to MetPy has been an open issue for awhile: https://github.com/Unidata/MetPy/issues/630
The main holdup was waiting on MetPy's improved xarray integration so that we can have a straightforward interface for it in MetPy. I think at this point it should be a straightforward calculation to implement in MetPy.
Orhan Eroglu (Jan 26 2021 at 19:14):
Thank you @Ryan May
We had found this open issue and thought that it wouldn't be implemented in the future since issue was old and there was no much conversation in it. It's good news for us to know it would be done in the future.
That being said, for showalter index, we can provide our own implementation to the user for now, and when it is implemented in MetPy, we can just convert it to a function call from upstream.
Ryan May (Jan 26 2021 at 19:43):
We try to make sure that if an issue is still open on MetPy it's very much still relevant. If you're feeling ambitious, you could open a Pull Request with your own implementation. We're always happy to have community contributions to MetPy, and that would help ensure it's implemented in MetPy sooner rather than later.
Orhan Eroglu (Jan 26 2021 at 19:56):
Yeah, this sounds good; we would like to make upstream contributions. I will talk to our teammate who made the implementation. Thanks!
Michaela Sizemore (Jan 26 2021 at 22:04):
@Ryan May Orhan spun me up on this conversation, but I just wanted to let you know that I'm going to refine what we have currently with respect to calculating Showalter and create a PR on the MetPy repo. If there's anything else I need to know before submitting that PR, please feel free to send me a DM!
Ryan May (Jan 26 2021 at 22:38):
Excellent! We have a Contributor's Guide that may be helpful: https://github.com/Unidata/MetPy/blob/master/CONTRIBUTING.md One thing up front is that we'd want to have a simple test or two that we can run to validate that the calculation is working, and making sure we don't break it in the future (see this test for precipitable water https://github.com/Unidata/MetPy/blob/9ed0829f308bb86374f389994d0bfe9ed2303159/tests/calc/test_indices.py#L89-L96)
Otherwise, don't worry about making sure the PR is perfect or anything--PRs are generally a good collaborative, iterative process. Thanks for considering contributing!
Last updated: Jan 30 2022 at 12:01 UTC