Open winash12 opened 7 years ago
I would absolutely accept a pull request implementing such a function somewhere in the metpy.calc
package. I can also add it myself, but make no promises as to when that would climb to the top of my todo list.
Either way, we'd need a solid reference (not some random web page) to include in the documentation and on which to base the implementation.
Actually, the only thing missing from MetPy is density. NumPy has gradient
and diff
, and we have a wrapper for gradient
to handle units.
Density was added in #337
Working on project implementing eq. 2.2 from this paper: http://journals.ametsoc.org/doi/pdf/10.1175/1520-0493(1991)119%3C1929:PVDOC%3E2.0.CO;2
which is EPV using spherical coordinates. By the way, its not pi in that equation, it is something called the Exner function. Thought it might be a good addition to MetPy and it is related to this issue.
Would the ideal function interface (in relation to other EPV types) be something like:
epv(..., kind='spherical')
or
spherical_epv(...)
Trying to figure out if can be generalized.
I would argue for spherical_epv(...)
to keep the functions as simple and encapsulated as possible.
@ahaberlie happy to have the functionality
In my ideal world, this would be encapsulated by projection and coordinate information attached to the relevant variables. But:
While I agree with @jrleeman in principle, what about vertical vorticity? Advection? Geostrophic wind? Just a nasty rabbit hole.
Go with spherical_epv
for now, and we can revisit if/when a better solution presents itself.
For now, just use metpy's existing vorticity
implementation. We can go back and add support for map factors there (however we end up doing that) and everything will benefit.
I don't think they should need to be
If you pass the proper sign for the increment in the longitudinal direction, then the calculation should work correctly. (i.e. if the data are N-S oriented, the increments should be negative, and vice-versa for S-N oriented data)
Looks smooth. My question is: have you actually tried interpolating using T vs. ln P? Is the difference discernible?
EPV is a well known equation in meteorology. Any interest in adding it ?