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

Add CAP Strength Calculation to MetPy #3452

Open
geofflewen opened this issue Mar 23, 2024 · 5 comments
Open

Add CAP Strength Calculation to MetPy #3452

geofflewen opened this issue Mar 23, 2024 · 5 comments
Labels
Area: Calc Pertains to calculations good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Feature New functionality

Comments

@geofflewen
Copy link

What should we add?

It would be useful to add some measure of cap strength to sounding analysis in MetPy. In my application, I compute Carlson's Lid Strength Index, but occasionally I would like to check my value of the Lid Strength term against SharpPy's CAP value. (Trying to port SharpPy's algorithm to MetPy is giving me some odd results so for the one-off check on Lid Strength, I just get the CAP directly from SharpPy.)

Failing this, a literature reference to the specific method used in SharpPy would allow me to develop my own.

Thank you.

Reference

No response

@geofflewen geofflewen added the Type: Feature New functionality label Mar 23, 2024
@dopplershift dopplershift added the Area: Calc Pertains to calculations label Mar 25, 2024
@dopplershift
Copy link
Member

I'd be happy for someone to contribute either/both of those methods.

Someone would definitely need to do a literature review to understand what SharpPy is doing.

@dopplershift dopplershift added the good first issue Straightforward issues suitable for new and inexperienced contributors to the project label Mar 25, 2024
@geofflewen
Copy link
Author

geofflewen commented Mar 26, 2024

@dopplershift I have searched extensively for an article or paper that could have served as the basis for the calculation, with no success. There is a SharpPy issue calling the SharpPy CAP strength code into question, but it has been open since 2021.

There is a difference between the SharpPy params.py code and GEMPAK NSHARP skparams.c code, so if the GEMPAK version should be considered authoritative, the implication is that the SharpPy code has a bug.

I don't mind taking a crack at it, but if someone with better Python skills would prefer to do it, I would defer to them.

@dopplershift
Copy link
Member

The code in SharpPy looks buggy. The code in NSHARP looks straightforward: loop over the profile and compute the max difference between the environment and the parcel temp. A citation for that would be nice, but it's simple enough that we can live with it (though helpful if we could at least link to NSHARP docs somewhere).

@geofflewen
Copy link
Author

Since the algorithm assumes a lifted parcel level as input, and a bounded layer for the calculation (presumably to limit the CAP output value, for instance, if the LFC is absent), there are details related to "common usage" that would be nice to know. I'm motivated to look into this in the meantime.

@geofflewen
Copy link
Author

geofflewen commented Mar 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations good first issue Straightforward issues suitable for new and inexperienced contributors to the project Type: Feature New functionality
Projects
None yet
Development

No branches or pull requests

2 participants