pycontrails.models.accf.ACCF¶
- class pycontrails.models.accf.ACCF(met, surface=None, params=None, **params_kwargs)¶
Bases:
Model
Compute Algorithmic Climate Change Functions (ACCF).
This class is a wrapper over the DLR / UMadrid library climaccf, DOI: 10.5281/zenodo.6977272
- Parameters:
met (
MetDataset
) – Dataset containing “air_temperature” and “specific_humidity” variablessurface (
MetDataset
, optional) – Dataset containing “surface_solar_downward_radiation” and “top_net_thermal_radiation” variables
References
- __init__(met, surface=None, params=None, **params_kwargs)¶
Methods
__init__
(met[, surface, params])downselect_met
()eval
([source])Evaluate accfs along flight trajectory or on meteorology grid.
get_source_param
(key[, default, set_attr])Get source data with default set by parameter key.
require_met
()Ensure that
met
is a MetDataset.require_source_type
(type_)Ensure that
source
istype_
.set_source
([source])Attach original or copy of input
source
tosource
.set_source_met
([optional, variable])Ensure or interpolate each required
met_variables
onsource
.transfer_met_source_attrs
([source])Transfer met source metadata from
met
tosource
.update_params
([params])Update model parameters on
params
.Attributes
Instantiated model parameters, in dictionary form
Meteorology data
Data evaluated in model
hash
Generate a unique hash for model instance.
interp_kwargs
Shortcut to create interpolation arguments from
params
.met_required
Require meteorology is not None on __init__()
Required meteorology pressure level variables.
processed_met_variables
Set of required parameters if processing already complete on
met
input.optional_met_variables
Optional meteorology variables
- default_params¶
alias of
ACCFParams
- eval(source=None, **params)¶
Evaluate accfs along flight trajectory or on meteorology grid.
- Parameters:
source (
GeoVectorDataset | Flight | MetDataset | None
, optional) – Input GeoVectorDataset or Flight. If None, evaluates at themet
grid points.**params (
Any
) – Overwrite model parameters before eval
- Returns:
GeoVectorDataset | Flight | MetDataArray
– Returns np.nan if interpolating outside meteorology grid.- Raises:
NotImplementedError – Raises if input
source
is not supported.
- long_name = 'algorithmic climate change functions'¶
- met¶
Meteorology data
- met_variables = (MetVariable(short_name='t', standard_name='air_temperature', long_name='Air Temperature', level_type='isobaricInhPa', ecmwf_id=130, grib1_id=11, grib2_id=(0, 0, 0), units='K', amip='ta', description='Air temperature is the bulk temperature of the air, not the surface (skin) temperature.'), MetVariable(short_name='q', standard_name='specific_humidity', long_name='Specific Humidity', level_type='isobaricInhPa', ecmwf_id=133, grib1_id=51, grib2_id=(0, 1, 0), units='kg kg**-1', amip='hus', description='Specific means per unit mass. Specific humidity is the mass fraction of water vapor in (moist) air.'), MetVariable(short_name='pv', standard_name='potential_vorticity', long_name='Potential vorticity (K m^2 / kg s)', level_type='isobaricInhPa', ecmwf_id=60, grib1_id=128, grib2_id=(0, 2, 14), units='K m**2 kg**-1 s**-1', amip='pvu', description='Potential vorticity is a measure of the capacity for air to rotate in the atmosphere.If we ignore the effects of heating and friction, potential vorticity is conserved following an air parcel.It is used to look for places where large wind storms are likely to originate and develop.Potential vorticity increases strongly above the tropopause and therefore, it can also be used in studiesrelated to the stratosphere and stratosphere-troposphere exchanges. Large wind storms develop when a columnof air in the atmosphere starts to rotate. Potential vorticity is calculated from the wind, temperature andpressure across a column of air in the atmosphere.'), MetVariable(short_name='z', standard_name='geopotential', long_name='Geopotential', level_type='isobaricInhPa', ecmwf_id=129, grib1_id=6, grib2_id=(0, 3, 4), units='m**2 s**-2', amip=None, description='Geopotential is the sum of the specific gravitational potential energy relative to the geoid and the specific centripetal potential energy.'), MetVariable(short_name='r', standard_name='relative_humidity', long_name='Relative Humidity', level_type='isobaricInhPa', ecmwf_id=157, grib1_id=52, grib2_id=(0, 1, 1), units='1', amip='hur', description='This parameter is the water vapour pressure as a percentage of the value at which the air becomes saturated liquid.'), MetVariable(short_name='v', standard_name='northward_wind', long_name='Northward Wind', level_type='isobaricInhPa', ecmwf_id=132, grib1_id=34, grib2_id=(0, 2, 3), units='m s**-1', amip='va', description='"Northward" indicates a vector component which is positive when directed northward (negative southward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component.'), MetVariable(short_name='u', standard_name='eastward_wind', long_name='Eastward Wind', level_type='isobaricInhPa', ecmwf_id=131, grib1_id=33, grib2_id=(0, 2, 2), units='m s**-1', amip='ua', description='"Eastward" indicates a vector component which is positive when directed eastward (negative westward). Wind is defined as a two-dimensional (horizontal) air velocity vector, with no vertical component.'))¶
Required meteorology pressure level variables. Each element in the list is a
MetVariable
or atuple[MetVariable]
. If element is atuple[MetVariable]
, the variable depends on the data source. Only one variable in the tuple is required.
- name = 'accr'¶
- params¶
Instantiated model parameters, in dictionary form
- path_lib = './'¶
- short_vars = frozenset({'pv', 'q', 'r', 'ssrd', 't', 'ttr', 'u', 'v', 'z'})¶
- source¶
Data evaluated in model
- sur_variables = (MetVariable(short_name='ssrd', standard_name='surface_solar_downward_radiation', long_name='Surface Solar Downward Radiation', level_type='surface', ecmwf_id=169, grib1_id=None, grib2_id=(0, 4, 7), units='J m**-2', amip=None, description='This parameter is the amount of solar radiation (also known as shortwave radiation) that reaches a horizontal plane at the surface of the Earth. This parameter comprises both direct and diffuse solar radiation.'), MetVariable(short_name='ttr', standard_name='top_net_thermal_radiation', long_name='Top of atmosphere net thermal (longwave) radiation', level_type='nominalTop', ecmwf_id=179, grib1_id=None, grib2_id=(0, 5, 5), units='J m**-2', amip=None, description='The thermal (also known as terrestrial or longwave) radiation emitted to space at the top of the atmosphere is commonly known as the Outgoing Longwave Radiation (OLR). The top net thermal radiation (this parameter) is equal to the negative of OLR.See https://www.ecmwf.int/sites/default/files/elibrary/2015/18490-radiation-quantities-ecmwf-model-and-mars.pdf'))¶