Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.25k stars 416 forks source link

Option to return full (cumulative) profile from thickness_hydrostatic functions #1312

Open andreas-h opened 4 years ago

andreas-h commented 4 years ago

It would be useful if one could calculate the thickness of layers of the full atmosphere in one go, i.e., if thickness_hydrostatic_from_relative_humidity() and thickness_hydrostatic() would (optionally) not only return the full thickness (i.e., between bottom and top) but instead all the layer thicknesses individually.

To explain more technically: The current return value (the full thickness) would then be the top layer of the cumsum of the individual thicknesses.

jthielen commented 3 years ago

This would help clean up some of https://github.com/Unidata/MetPy/pull/2064.

brianmapes commented 2 years ago

+1 in 2022

Z-Richard commented 1 year ago

I want to give this implementation a shot but I am a bit confused about what the interface should be. IMO, the interface should be a combination of several types of usages of the function:

It can be quite difficult to specify these three parameters in a single function, i.e., thickness_hydrostatic, as the rich behavior provided by a combination of these parameters can confuse the user. I think it would be better to implement a new function, e.g., thickness_hydrostatic_each_layer, to return the thickness of individual layers, but would also like to know what others think the correct approach should be.