Step-by-step guide
You need to use the ml_to_hl() function. It needs the geopotential field on model levels as an input, which can be computed with the mvl_geopotential_on_ml() function. The following example shows how these two functions can be used together:
import metview as mv # computes geopotential on model levels # requires temperature (t), specific humidity(q), log surface pressure (lnsp) # and surface geopotential (zs) fields z = mv.mvl_geopotential_on_ml(t, q, lnsp, zs) # interpolates the t field onto a list of height levels above sea level hlevs = [1000, 2000, 3000, 4000, 5000] th = mv.ml_to_hl (t, z, nil, hlevs, "sea", "linear")