pl_to_pl ============= .. py:function:: pl_to_pl(fs, pressures, [method]) *New in Metview version 5.17.0*. Interpolates ``fs`` from pressure levels onto a set of pressure levels defined by ``pressures``. :param fs: fieldset to be interpolated (must contain pressure levels!). Does not have to be sorted by level. :type fs: :class:`Fieldset` :param pressures: target pressure levels in hPa. Does not have to be sorted. :type pressures: list or ndarray :param str method: specifies the interpolation method. The possible values are "linear" and "log". If it is not specified linear interpolation is used. :rtype: :class:`Fieldset` The input data (``fs``) must contain one field per pressure level only. It means that e.g. data containing multiple timesteps cannot be used as an input. At gridpoints where the interpolation is not possible a missing value is returned. It happens where the target pressure is outside the pressure level range in ``fs``. :Example: This code illustrates how to use :func:`pl_to_pl` with data retrieved from MARS: .. code-block:: python import metview as mv # get pressure level fields from MARS f = mv.retrieve(type="an", date=-1, time=12, levelist=[1000, 925, 850, 700], param="t", grid=[1,1]) # interpolate onto a list of pressure levels p_levels = [965, 850, 815, 723.5] r = mv.pl_to_pl(f, p_levels) .. mv-minigallery:: pl_to_pl