-
Notifications
You must be signed in to change notification settings - Fork 415
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
xarray parcel functions #1968
base: main
Are you sure you want to change the base?
xarray parcel functions #1968
Conversation
Timothy Raupach seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This is an impressive rewrite of the thermodynamic parcel calculations! While I wouldn't foresee this as likely to be included in MetPy as-is (see below discussion), this PR will be a tremendous asset as progress is made on MetPy's parcel calculations for vectorizability and performance improvements. Thank you for putting forward your work here! While the following points may sound critical, please don't take them as anything against what you've done. Instead, these are just my thoughts on where this implementation (which I assume was built to meet your needs rather than be fully generalized) differs from MetPy's usual philosophy, so as to set the stage for later incorporation of approaches used here into MetPy itself.
|
Thanks for the kind comments Jon!
Yes exactly, I built this because I needed to calculate some values more quickly and that's why it differs from the usual MetPy philosophy in several areas. It's also why, as you noted, there is no multiple EL/LFC functionality. You're correct on all the points you raise and I agree that they will need to be addressed before this code could be considered for inclusion in MetPy. I hope that in the meantime it will serve as a useful resource/source of ideas for what an xarray implantation of parcel functions could look like. |
Description Of Changes
Here are suggested xarray-enabled implementations of air parcel functions that can be run over 3D data much faster than looping existing functions over 1D profiles. The functions are not yet integrated with the rest of MetPy and notably do not use any Pint quantities. Unit tests are provided but aren't yet integrated properly with the testing framework.
For performance, moist lapse rates are not exactly calculated but rather are approximated using a lookup table. For more information about these functions and their use, including a demonstration in a Jupyter notebook, see xarray_parcel.
Checklist