pycontrails.models.apcemm.APCEMMParams

class pycontrails.models.apcemm.APCEMMParams(copy_source=True, interpolation_method='linear', interpolation_bounds_error=False, interpolation_fill_value=nan, interpolation_localize=False, interpolation_use_indices=False, interpolation_q_method=None, verify_met=True, downselect_met=True, met_longitude_buffer=(10.0, 10.0), met_latitude_buffer=(10.0, 10.0), met_level_buffer=(40.0, 40.0), met_time_buffer=(np.timedelta64(0, 'h'), np.timedelta64(0, 'h')), max_age=np.timedelta64(20, 'h'), dt_lagrangian=np.timedelta64(30, 'm'), lagrangian_sedimentation_rate=0.0, dt_input_met=np.timedelta64(1, 'h'), altitude_input_met=None, humidity_scaling=None, dz_m=200.0, aircraft_type='B738', engine_uid=None, aircraft_performance=<factory>, fuel=<factory>, waypoints=None, apcemm_root=None, overwrite=False, output_directory='out', apcemm_threads=1, n_jobs=1)

Bases: ModelParams

Default parameters for the pycontrails APCEMM interface.

__init__(copy_source=True, interpolation_method='linear', interpolation_bounds_error=False, interpolation_fill_value=nan, interpolation_localize=False, interpolation_use_indices=False, interpolation_q_method=None, verify_met=True, downselect_met=True, met_longitude_buffer=(10.0, 10.0), met_latitude_buffer=(10.0, 10.0), met_level_buffer=(40.0, 40.0), met_time_buffer=(np.timedelta64(0, 'h'), np.timedelta64(0, 'h')), max_age=np.timedelta64(20, 'h'), dt_lagrangian=np.timedelta64(30, 'm'), lagrangian_sedimentation_rate=0.0, dt_input_met=np.timedelta64(1, 'h'), altitude_input_met=None, humidity_scaling=None, dz_m=200.0, aircraft_type='B738', engine_uid=None, aircraft_performance=<factory>, fuel=<factory>, waypoints=None, apcemm_root=None, overwrite=False, output_directory='out', apcemm_threads=1, n_jobs=1)

Methods

__init__([copy_source, ...])

as_dict()

Convert object to dictionary.

Attributes

aircraft_type

ICAO aircraft identifier

altitude_input_met

Altitude coordinates [\(m\)] for meteorology in generated APCEMM input file.

apcemm_root

If defined, use to override input_background_conditions and input_engine_emissions in APCEMMInput assuming that apcemm_root points to the root of the APCEMM git repository.

apcemm_threads

Number of threads to use within individual APCEMM simulations.

copy_source

Copy input source data on eval

downselect_met

Downselect input MetDataset` to region around source.

dt_input_met

Time step of meteorology in generated APCEMM input file.

dt_lagrangian

Timestep for Lagrangian trajectory calculation

dz_m

Altitude difference for vertical derivative calculations [\(m\)]

engine_uid

Engine UID.

humidity_scaling

Humidity scaling

interpolation_bounds_error

If True, points lying outside interpolation will raise an error

interpolation_fill_value

Used for outside interpolation value if interpolation_bounds_error is False

interpolation_localize

Experimental.

interpolation_method

Interpolation method.

interpolation_q_method

Experimental.

interpolation_use_indices

Experimental.

lagrangian_sedimentation_rate

Sedimentation rate for Lagrangian trajectories [\(Pa/s\)]

max_age

Maximum contrail age

met_latitude_buffer

Latitude buffer for Lagrangian trajectory calculation [WGS84]

met_level_buffer

Level buffer for Lagrangian trajectory calculation [\(hPa\)]

met_longitude_buffer

Longitude buffer for Lagrangian trajectory calculation [WGS84]

met_time_buffer

Met time buffer for input to Flight.downselect_met() Only applies when downselect_met is True.

n_jobs

Number of individual APCEMM simulations to run in parallel.

output_directory

Name of output directory within run directory

overwrite

If True, delete existing run directories before running APCEMM simulations.

verify_met

Call _verify_met() on model instantiation.

waypoints

List of flight waypoints to simulate in APCEMM.

aircraft_performance

Aircraft performance model

fuel

Fuel type

aircraft_performance

Aircraft performance model

aircraft_type = 'B738'

ICAO aircraft identifier

altitude_input_met = None

Altitude coordinates [\(m\)] for meteorology in generated APCEMM input file. If not provided, uses estimated altitudes for levels in input Metdataset.

apcemm_root = None

If defined, use to override input_background_conditions and input_engine_emissions in APCEMMInput assuming that apcemm_root points to the root of the APCEMM git repository.

apcemm_threads = 1

Number of threads to use within individual APCEMM simulations.

as_dict()

Convert object to dictionary.

We use this method instead of dataclasses.asdict to use a shallow/unrecursive copy. This will return values as Any instead of dict.

Returns:

dict[str, Any] – Dictionary version of self.

copy_source = True

Copy input source data on eval

downselect_met = True

Downselect input MetDataset` to region around source.

dt_input_met = np.timedelta64(1,'h')

Time step of meteorology in generated APCEMM input file.

dt_lagrangian = np.timedelta64(30,'m')

Timestep for Lagrangian trajectory calculation

dz_m = 200.0

Altitude difference for vertical derivative calculations [\(m\)]

engine_uid = None

Engine UID. If not provided, uses the default engine UID for the aircraft_type.

fuel

Fuel type

humidity_scaling = None

Humidity scaling

interpolation_bounds_error = False

If True, points lying outside interpolation will raise an error

interpolation_fill_value = nan

Used for outside interpolation value if interpolation_bounds_error is False

interpolation_localize = False

Experimental. See pycontrails.core.interpolation.

interpolation_method = 'linear'

Interpolation method. Supported methods include “linear”, “nearest”, “slinear”, “cubic”, and “quintic”. See scipy.interpolate.RegularGridInterpolator for the description of each method. Not all methods are supported by all met grids. For example, the “cubic” method requires at least 4 points per dimension.

interpolation_q_method = None

Experimental. Alternative interpolation method to account for specific humidity lapse rate bias. Must be one of None, "cubic-spline", or "log-q-log-p". If None, no special interpolation is used for specific humidity. The "cubic-spline" method applies a custom stretching of the met interpolation table to account for the specific humidity lapse rate bias. The "log-q-log-p" method interpolates in the log of specific humidity and pressure, then converts back to specific humidity. Only used by models calling to interpolate_met().

interpolation_use_indices = False

Experimental. See pycontrails.core.interpolation.

lagrangian_sedimentation_rate = 0.0

Sedimentation rate for Lagrangian trajectories [\(Pa/s\)]

max_age = np.timedelta64(20,'h')

Maximum contrail age

met_latitude_buffer = (10.0, 10.0)

Latitude buffer for Lagrangian trajectory calculation [WGS84]

met_level_buffer = (40.0, 40.0)

Level buffer for Lagrangian trajectory calculation [\(hPa\)]

met_longitude_buffer = (10.0, 10.0)

Longitude buffer for Lagrangian trajectory calculation [WGS84]

met_time_buffer = (np.timedelta64(0,'h'), np.timedelta64(0,'h'))

Met time buffer for input to Flight.downselect_met() Only applies when downselect_met is True.

n_jobs = 1

Number of individual APCEMM simulations to run in parallel.

output_directory = 'out'

Name of output directory within run directory

overwrite = False

If True, delete existing run directories before running APCEMM simulations. If False (default), raise an exception if a run directory already exists.

verify_met = True

Call _verify_met() on model instantiation.

waypoints = None

List of flight waypoints to simulate in APCEMM. By default, runs a simulation for every waypoint.