MetPy icon indicating copy to clipboard operation
MetPy copied to clipboard

Option to return full (cumulative) profile from thickness_hydrostatic functions

Open andreas-h opened this issue 5 years ago • 3 comments

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.

andreas-h avatar Jan 29 '20 16:01 andreas-h

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

jthielen avatar Aug 30 '21 21:08 jthielen

+1 in 2022

brianmapes avatar Mar 31 '22 15:03 brianmapes

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:

  • The user can specify a bottom, and the depth defaults to the full profile;
  • The user can specify both a bottom and a depth (1000 - 500 hPa thickness)
  • The user can specify a depth, and bottom defaults to the bottom of the layer
  • The user can specify that they want the thickness of each individual layer. In this case, the bottom and depth are invalid parameters.

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.

Z-Richard avatar Nov 03 '22 16:11 Z-Richard