pressure_derivative
- pressure_derivative(f[, p])
New in Metview version 5.13.0.
Computes the vertical pressure derivative.
- Parameters
- Return type
same type as
for None
The result is the vertical pressure derivative in */Pa units. The following rules are applied when
fis aFieldset:if
fis a pressure levelFieldsetnopis neededif
fis defined on ECMWF model levels (hybrid/eta)pmust be either a single LNSP (logarithm of surface pressure, identified by paramId=152) field or aFieldsetdefining the pressure on the same levels asf(seepressure())for other level types
pmust be aFieldsetdefining 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)