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

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

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               and ptp_cube (trospopause_air_pressure).

    Returns
    -------
        Cube containing stratospheric 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'))

    p_layer_widths = _pressure_level_widths(tro3_cube, ptp_cube, top_limit=0)

    #==========================================================================
    # stratoz = (tro3_cube * p_layer_widths
    #           / g_cte.value * mw_O3_cte.value
    #           / mw_air_cte.value)
    # stratoz = stratoz.collapsed('air_pressure', iris.analysis.SUM)
    # stratoz.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 )    
    # stratoz = stratoz / mw_O3_cte.value * avo_cte.value
    # stratoz.units = stratoz.units / mw_O3_cte.value * avo_cte.value
    #==========================================================================

    stratoz = tro3_cube * p_layer_widths / g * mw_O3 / mw_air
    stratoz = stratoz.collapsed('air_pressure', iris.analysis.SUM)
    stratoz.units = (tro3_cube.units * p_layer_widths.units
                    / g_unit * mw_O3_unit / mw_air_unit)
    stratoz = stratoz / mw_O3 * Avogadro_const
    stratoz.units = stratoz.units / mw_O3_unit * Avogadro_const_unit
    stratoz.convert_units(Dobson.units)
    stratoz.data = np.ma.array(stratoz.data, dtype=np.dtype('float32'))

    return stratoz
Compute stratospheric column ozone.
       From ozone mol fraction on pressure levels.

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

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               and ptp_cube (trospopause_air_pressure).

    Returns
    -------
        Cube containing stratospheric column ozone.

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

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

Arguments



Returns

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

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

    Arguments
    ---------
        cubes: cubelist containing tro3_cube (mole_fraction_of_ozone_in_air)
               and ptp_cube (trospopause_air_pressure).

    Returns
    -------
        Cube containing stratospheric column ozone.

    """ #========================================================================== # stratoz = (tro3_cube * p_layer_widths #           / g_cte.value * mw_O3_cte.value #           / mw_air_cte.value) # stratoz = stratoz.collapsed('air_pressure', iris.analysis.SUM) # stratoz.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 )     # stratoz = stratoz / mw_O3_cte.value * avo_cte.value # stratoz.units = stratoz.units / mw_O3_cte.value * avo_cte.value #==========================================================================
cubes