pressure_derivative
- pressure_derivative(f[, p])
New in Metview version 5.13.0.
Computes the vertical pressure derivative.
- Parameters
- Return type
same type as
f
or None
The result is the vertical pressure derivative in */Pa units. The following rules are applied when
f
is aFieldset
:if
f
is a pressure levelFieldset
nop
is neededif
f
is defined on ECMWF model levels (hybrid/eta)p
must be either a single LNSP (logarithm of surface pressure, identified by paramId=152) field or aFieldset
defining the pressure on the same levels asf
(seepressure()
)for other level types
p
must be aFieldset
defining the pressure on the same levels asf
.
In the computations, first the values are sorted by pressure, then a non-uniform central difference scheme (one-sided difference at the bottom and top) is used to estimate the derivatives. The results are then re-sorted to appear in the same order as in
f
. This allows for the following type of computations:import metview as mv # read fields defined on the same set of, potentially unsorted, # pressure levels. I.e. the fields in f1 and f2 are properly lined # up in terms of pressure. f1 = mv.read("data1.grib") f2 = mv.read("data2.grib") # the fields are still lined up for computing r since # pressure_derivative() keeps the original field ordering r = f2 * mv.pressure_derivative(f1)