esmvaltool/preprocessor/_derive.py
def calc_tropoz(cubes):
    """Compute tropospheric column ozone.
    From ozone mol fraction on pressure levels.

    - The surface pressure is used as a lower integration bound.
    - A fixed upper-integration bound of tropopause pressure in Pa is used.

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               , ptp_cube (trospopause_air_pressure),
               , ps_cube  (surface_air_pressure)

    Returns
    -------
        Cube containing tropospheric column ozone.

    """

    tro3_cube = cubes.extract_strict(
        Constraint(name='mole_fraction_of_ozone_in_air'))
    ptp_cube = cubes.extract_strict(Constraint(name='tropopause_air_pressure'))
    ps_cube = cubes.extract_strict(Constraint(name='surface_air_pressure'))
    p_layer_widths = _pressure_level_widths(tro3_cube,
                                            ps_cube, top_limit=ptp_cube)
    #==========================================================================
    # note that here it is needed an update of function _pressure_level_widths
    # tropoz = (tro3_cube * p_layer_widths
    #          / g_cte.value * mw_O3_cte.value
    #          / mw_air_cte.value)
    # tropoz = tropoz.collapsed('air_pressure', iris.analysis.SUM)
    # tropoz = tropoz / mw_O3 * Avogadro_const
    # tropoz.units = (tro3_cube.units * p_layer_widths.units
    #                / g_cte.units * mw_O3_cte.units
    #                / mw_air_cte.units)
    # Convert from kg m^-2 to Dobson unit (2.69e20 m^-2 ) 
    #tropoz = tropoz / mw_O3_cte.value * avo_cte.value
    #tropoz.units = tropoz.units / mw_O3_cte.units * avo_cte.units
    #==========================================================================

    tropoz = tro3_cube * p_layer_widths / g * mw_O3 / mw_air
    tropoz = tropoz.collapsed('air_pressure', iris.analysis.SUM)
    tropoz.units = (tro3_cube.units * p_layer_widths.units
                    / g_unit * mw_O3_unit / mw_air_unit)
    tropoz = tropoz / mw_O3 * Avogadro_const
    tropoz.units = tropoz.units / mw_O3_unit * Avogadro_const_unit
    tropoz.convert_units(Dobson_unit)
    tropoz.data = np.ma.array(tropoz.data, dtype=np.dtype('float32'))
    return tropoz
Compute tropospheric column ozone.
    From ozone mol fraction on pressure levels.

    - The surface pressure is used as a lower integration bound.
    - A fixed upper-integration bound of tropopause pressure in Pa is used.

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               , ptp_cube (trospopause_air_pressure),
               , ps_cube  (surface_air_pressure)

    Returns
    -------
        Cube containing tropospheric column ozone.

    
Compute tropospheric column ozone.
From ozone mol fraction on pressure levels.

The surface pressure is used as a lower integration bound.
A fixed upper-integration bound of tropopause pressure in Pa is used.

Arguments



Returns

Cube containing tropospheric column ozone.
Compute tropospheric column ozone . From ozone mol fraction on pressure levels . The surface pressure is used as a lower integration bound . A fixed upper - integration bound of tropopause pressure in Pa is used . Arguments Returns Cube containing tropospheric column ozone .
def calc_tropoz(cubes):
    tro3_cube = cubes.extract_strict(
        Constraint(name='mole_fraction_of_ozone_in_air'))
    ptp_cube = cubes.extract_strict(Constraint(name='tropopause_air_pressure'))
    ps_cube = cubes.extract_strict(Constraint(name='surface_air_pressure'))
    p_layer_widths = _pressure_level_widths(tro3_cube,
                                            ps_cube, top_limit=ptp_cube)
    tropoz = tro3_cube * p_layer_widths / g * mw_O3 / mw_air
    tropoz = tropoz.collapsed('air_pressure', iris.analysis.SUM)
    tropoz.units = (tro3_cube.units * p_layer_widths.units
                    / g_unit * mw_O3_unit / mw_air_unit)
    tropoz = tropoz / mw_O3 * Avogadro_const
    tropoz.units = tropoz.units / mw_O3_unit * Avogadro_const_unit
    tropoz.convert_units(Dobson_unit)
    tropoz.data = np.ma.array(tropoz.data, dtype=np.dtype('float32'))
    return tropoz
def calc_tropoz ( cubes ) : tro3_cube = cubes . extract_strict ( Constraint ( name = 'mole_fraction_of_ozone_in_air' ) ) ptp_cube = cubes . extract_strict ( Constraint ( name = 'tropopause_air_pressure' ) ) ps_cube = cubes . extract_strict ( Constraint ( name = 'surface_air_pressure' ) ) p_layer_widths = _pressure_level_widths ( tro3_cube , ps_cube , top_limit = ptp_cube ) tropoz = tro3_cube * p_layer_widths / g * mw_O3 / mw_air tropoz = tropoz . collapsed ( 'air_pressure' , iris . analysis . SUM ) tropoz . units = ( tro3_cube . units * p_layer_widths . units / g_unit * mw_O3_unit / mw_air_unit ) tropoz = tropoz / mw_O3 * Avogadro_const tropoz . units = tropoz . units / mw_O3_unit * Avogadro_const_unit tropoz . convert_units ( Dobson_unit ) tropoz . data = np . ma . array ( tropoz . data , dtype = np . dtype ( 'float32' ) ) return tropoz
Compute tropospheric column ozone.
Compute tropospheric column ozone .
"""Compute tropospheric column ozone.
    From ozone mol fraction on pressure levels.

    - The surface pressure is used as a lower integration bound.
    - A fixed upper-integration bound of tropopause pressure in Pa is used.

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               , ptp_cube (trospopause_air_pressure),
               , ps_cube  (surface_air_pressure)

    Returns
    -------
        Cube containing tropospheric column ozone.

    """ #========================================================================== # note that here it is needed an update of function _pressure_level_widths # tropoz = (tro3_cube * p_layer_widths #          / g_cte.value * mw_O3_cte.value #          / mw_air_cte.value) # tropoz = tropoz.collapsed('air_pressure', iris.analysis.SUM) # tropoz = tropoz / mw_O3 * Avogadro_const # tropoz.units = (tro3_cube.units * p_layer_widths.units #                / g_cte.units * mw_O3_cte.units #                / mw_air_cte.units) # Convert from kg m^-2 to Dobson unit (2.69e20 m^-2 )  #tropoz = tropoz / mw_O3_cte.value * avo_cte.value #tropoz.units = tropoz.units / mw_O3_cte.units * avo_cte.units #==========================================================================
cubes