esmvaltool/preprocessor/_derive.py
def _pressure_level_widths(tro3_cube, ps_cube, top_limit=0):
    """Create a cube with pressure level widths.

    This is done by taking a 2D surface pressure field as lower bound.

    @R. Checa-Garcia: I would not name the cube here as tro3_cube
    as formally it could be other variable. Also with an extension
    considering that top_limit could be a cube this function would
    be useful for stratospheric and tropospheric ozone column.

    Arguments
    ---------
        tro3_cube: Cube containing mole_fraction_of_ozone_in_air
        ps_cube: Surface air pressure cube.
        top_limit: Pressure in Pa.

    Returns
    -------
        Cube of same shape as tro3_cube containing pressure level widths.

    """
    print(tro3_cube)
    assert ps_cube.units == 'Pa'
    assert tro3_cube.coord('air_pressure').units == 'Pa'

    pressure_array = _create_pressure_array(tro3_cube, ps_cube, top_limit)

    data = _apply_pressure_level_widths(pressure_array)
    p_level_widths_cube = tro3_cube.copy(data=data)
    p_level_widths_cube.rename('pressure level widths')
    p_level_widths_cube.units = ps_cube.units

    return p_level_widths_cube
Create a cube with pressure level widths.

    This is done by taking a 2D surface pressure field as lower bound.

    @R. Checa-Garcia: I would not name the cube here as tro3_cube
    as formally it could be other variable. Also with an extension
    considering that top_limit could be a cube this function would
    be useful for stratospheric and tropospheric ozone column.

    Arguments
    ---------
        tro3_cube: Cube containing mole_fraction_of_ozone_in_air
        ps_cube: Surface air pressure cube.
        top_limit: Pressure in Pa.

    Returns
    -------
        Cube of same shape as tro3_cube containing pressure level widths.

    
Create a cube with pressure level widths.
This is done by taking a 2D surface pressure field as lower bound.
Create a cube with pressure level widths . This is done by taking a 2D surface pressure field as lower bound .
def _pressure_level_widths(tro3_cube, ps_cube, top_limit=0):
    print(tro3_cube)
    assert ps_cube.units == 'Pa'
    assert tro3_cube.coord('air_pressure').units == 'Pa'
    pressure_array = _create_pressure_array(tro3_cube, ps_cube, top_limit)
    data = _apply_pressure_level_widths(pressure_array)
    p_level_widths_cube = tro3_cube.copy(data=data)
    p_level_widths_cube.rename('pressure level widths')
    p_level_widths_cube.units = ps_cube.units
    return p_level_widths_cube
def _pressure_level_widths ( tro3_cube , ps_cube , top_limit = 0 ) : print ( tro3_cube ) assert ps_cube . units == 'Pa' assert tro3_cube . coord ( 'air_pressure' ) . units == 'Pa' pressure_array = _create_pressure_array ( tro3_cube , ps_cube , top_limit ) data = _apply_pressure_level_widths ( pressure_array ) p_level_widths_cube = tro3_cube . copy ( data = data ) p_level_widths_cube . rename ( 'pressure level widths' ) p_level_widths_cube . units = ps_cube . units return p_level_widths_cube
Create a cube with pressure level widths.
Create a cube with pressure level widths .
"""Create a cube with pressure level widths.

    This is done by taking a 2D surface pressure field as lower bound.

    @R. Checa-Garcia: I would not name the cube here as tro3_cube
    as formally it could be other variable. Also with an extension
    considering that top_limit could be a cube this function would
    be useful for stratospheric and tropospheric ozone column.

    Arguments
    ---------
        tro3_cube: Cube containing mole_fraction_of_ozone_in_air
        ps_cube: Surface air pressure cube.
        top_limit: Pressure in Pa.

    Returns
    -------
        Cube of same shape as tro3_cube containing pressure level widths.

    """
tro3_cube
ps_cube
top_limit
Garcia
I would not name the cube here as tro3_cube
as formally it could be other variable. Also with an extension
considering that top_limit could be a cube this function would
be useful for stratospheric and tropospheric ozone column.

Arguments

Cube containing mole_fraction_of_ozone_in_air
ps_cube: Surface air pressure cube.
top_limit: Pressure in Pa.

Returns

Cube of same shape as tro3_cube containing pressure level widths.
I would not name the cube here as tro3_cube as formally it could be other variable . Also with an extension considering that top_limit could be a cube this function would be useful for stratospheric and tropospheric ozone column . Arguments Cube containing mole_fraction_of_ozone_in_air ps_cube : Surface air pressure cube . top_limit : Pressure in Pa . Returns Cube of same shape as tro3_cube containing pressure level widths .