Skip to content

aeromaps.models.impacts.emissions.non_co2_emissions

non_co2_emissions

========================= Module to compute non-CO2 emissions from various aircraft types and energy origins.

NOxEmissionIndex

NOxEmissionIndex(name='nox_emission_index', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute NOx emission index.

Parameters:

Name Type Description Default
name str

Name of the model instance ('nox_emission_index' by default).

'nox_emission_index'

Attributes:

Name Type Description
pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
38
39
40
def __init__(self, name="nox_emission_index", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.pathways_manager = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """

    # TODO caution aircraft types not generic there
    self.input_names = {
        "emission_index_nox_dropin_fuel_evolution": 0.0,
        "emission_index_nox_hydrogen_evolution": 0.0,
    }
    self.output_names = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_nox": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_nox": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

NOx emission index calculation using simple method.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
def compute(self, input_data) -> dict:
    """
    NOx emission index calculation using simple method.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

    """

    output_data = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        cagr_aircraft = input_data.get(f"emission_index_nox_{aircraft_type}_evolution", 0.0)
        growth_series = pd.Series(
            np.concatenate(
                (
                    np.ones(self.prospection_start_year - self.historic_start_year),
                    (1 + cagr_aircraft)
                    ** np.arange(0, self.end_year - self.prospection_start_year + 1),
                )
            ),
            index=range(self.historic_start_year, self.end_year + 1),
        )

        # intialize the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_nox = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_nox = input_data[
                        f"{pathway.name}_emission_index_nox"
                    ]

                    origin_mean_emission_index_nox += (
                        pathway_emission_index_nox * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_nox"] = (
                    origin_mean_emission_index_nox * origin_valid_years * growth_series
                )

    self._store_outputs(output_data)

    return output_data

NOxEmissionIndexComplex

NOxEmissionIndexComplex(name='nox_emission_index_complex', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute NOx emission index using fleet renewal models.

Parameters:

Name Type Description Default
name str

Name of the model instance ('nox_emission_index_complex' by default).

'nox_emission_index_complex'

Attributes:

Name Type Description
fleet_model FleetModel(AeroMAPSModel)

AeroMAPSModel instance to provide fleet renewal data for NOx emission index calculation.

pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
180
181
182
183
184
def __init__(self, name="nox_emission_index_complex", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.fleet_model = None
    self.pathways_manager = None
    self.markets = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    # TODO caution aircraft types not generic there
    aircraft_types = ["dropin_fuel", "hydrogen", "electric"]
    self.input_names = {}
    for market in self.markets.get(traffic_type="passenger"):
        for aircraft_type in aircraft_types:
            self.input_names[f"ask_{market.id}_{aircraft_type}"] = pd.Series([0.0])

    self.output_names = {}

    for aircraft_type in aircraft_types:
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_nox": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_nox": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

NOx emission index calculation using fleet renewal models.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
def compute(
    self,
    input_data,
) -> dict:
    """
    NOx emission index calculation using fleet renewal models.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.
    """
    output_data = {}
    # Getting fleet model data

    aircraft_types = ["dropin_fuel", "hydrogen", "electric"]

    for aircraft_type in aircraft_types:
        weighted_emission_index_nox_sum = get_default_series(
            self.historic_start_year, self.end_year
        )
        ask_sum = get_default_series(self.historic_start_year, self.end_year)
        for market in self.markets.get(traffic_type="passenger"):
            emission_index_nox_market = self.fleet_model.df[
                f"{market.name}:emission_index_nox:{aircraft_type}"
            ]
            ask_market = input_data.get(
                f"ask_{market.id}_{aircraft_type}",
                get_default_series(self.historic_start_year, self.end_year),
            )
            ask_market_filled = ask_market.loc[self.historic_start_year : self.end_year].fillna(
                0
            )
            weighted_emission_index_nox_sum = (
                weighted_emission_index_nox_sum
                + emission_index_nox_market.loc[self.historic_start_year : self.end_year]
                * ask_market_filled
            )
            ask_sum = ask_sum + ask_market_filled
        emission_index_aircraft_type = weighted_emission_index_nox_sum / ask_sum

        relative_emission_index_aircraft_type = (
            emission_index_aircraft_type
            / emission_index_aircraft_type.loc[self.prospection_start_year - 1]
        )

        # intialize the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_nox = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_nox = input_data[
                        f"{pathway.name}_emission_index_nox"
                    ]

                    origin_mean_emission_index_nox += (
                        pathway_emission_index_nox * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_nox"] = (
                    origin_mean_emission_index_nox
                    * origin_valid_years
                    * relative_emission_index_aircraft_type
                )

    # print(output_data)
    self._store_outputs(output_data)

    return output_data

SootEmissionIndex

SootEmissionIndex(name='soot_emission_index', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute Soot emission index.

Parameters:

Name Type Description Default
name str

Name of the model instance ('soot_emission_index' by default).

'soot_emission_index'

Attributes:

Name Type Description
pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
343
344
345
def __init__(self, name="soot_emission_index", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.pathways_manager = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    # TODO caution aircraft types not generic there
    self.input_names = {"emission_index_soot_dropin_fuel_evolution": 0.0}

    self.output_names = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_soot": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_soot": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

Execute Soot emission index calculation using simple method.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
def compute(self, input_data) -> dict:
    """
    Execute Soot emission index calculation using simple method.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

    """

    output_data = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        cagr_aircraft = input_data.get(f"emission_index_soot_{aircraft_type}_evolution", 0.0)
        growth_series = pd.Series(
            np.concatenate(
                (
                    np.ones(self.prospection_start_year - self.historic_start_year),
                    (1 + cagr_aircraft)
                    ** np.arange(0, self.end_year - self.prospection_start_year + 1),
                )
            ),
            index=range(self.historic_start_year, self.end_year + 1),
        )

        # initialise the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_soot = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_soot = input_data[
                        f"{pathway.name}_emission_index_soot"
                    ]

                    origin_mean_emission_index_soot += (
                        pathway_emission_index_soot * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_soot"] = (
                    origin_mean_emission_index_soot * origin_valid_years * growth_series
                )

    self._store_outputs(output_data)

    return output_data

SootEmissionIndexComplex

SootEmissionIndexComplex(name='soot_emission_index_complex', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute Soot emission index using fleet renewal models.

Parameters:

Name Type Description Default
name str

Name of the model instance ('soot_emission_index_complex' by default).

'soot_emission_index_complex'

Attributes:

Name Type Description
fleet_model FleetModel(AeroMAPSModel)

AeroMAPSModel instance to provide fleet renewal data for Soot emission index calculation.

pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
481
482
483
484
485
def __init__(self, name="soot_emission_index_complex", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.fleet_model = None
    self.pathways_manager = None
    self.markets = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    # TODO caution aircraft types not generic there
    aircraft_types = ["dropin_fuel", "hydrogen", "electric"]
    self.input_names = {}
    for market in self.markets.get(traffic_type="passenger"):
        for aircraft_type in aircraft_types:
            self.input_names[f"ask_{market.id}_{aircraft_type}"] = pd.Series([0.0])

    self.output_names = {}

    aircraft_types = ["dropin_fuel", "hydrogen", "electric"]
    for aircraft_type in aircraft_types:
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_soot": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_soot": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

Soot emission index calculation using fleet renewal models.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
def compute(
    self,
    input_data,
) -> dict:
    """Soot emission index calculation using fleet renewal models.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

    """
    output_data = {}
    # Getting fleet model data

    aircraft_types = ["dropin_fuel", "hydrogen", "electric"]

    for aircraft_type in aircraft_types:
        weighted_emission_index_soot_sum = get_default_series(
            self.historic_start_year, self.end_year
        )
        ask_sum = get_default_series(self.historic_start_year, self.end_year)
        for market in self.markets.get(traffic_type="passenger"):
            emission_index_soot_market = self.fleet_model.df[
                f"{market.name}:emission_index_soot:{aircraft_type}"
            ]
            ask_market = input_data.get(
                f"ask_{market.id}_{aircraft_type}",
                get_default_series(self.historic_start_year, self.end_year),
            )
            ask_market_filled = ask_market.loc[self.historic_start_year : self.end_year].fillna(
                0
            )
            weighted_emission_index_soot_sum = (
                weighted_emission_index_soot_sum
                + emission_index_soot_market.loc[self.historic_start_year : self.end_year]
                * ask_market_filled
            )
            ask_sum = ask_sum + ask_market_filled
        emission_index_aircraft_type = weighted_emission_index_soot_sum / ask_sum

        relative_emission_index_aircraft_type = (
            emission_index_aircraft_type
            / emission_index_aircraft_type.loc[self.prospection_start_year - 1]
        )

        # intialize the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_soot = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_soot = input_data[
                        f"{pathway.name}_emission_index_soot"
                    ]

                    origin_mean_emission_index_soot += (
                        pathway_emission_index_soot * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_soot"] = (
                    origin_mean_emission_index_soot
                    * origin_valid_years
                    * relative_emission_index_aircraft_type
                )
    self._store_outputs(output_data)

    return output_data

H2OEmissionIndex

H2OEmissionIndex(name='h2o_emission_index', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute H2O emission index.

Parameters:

Name Type Description Default
name str

Name of the model instance ('h2o_emission_index' by default).

'h2o_emission_index'

Attributes:

Name Type Description
pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
643
644
645
def __init__(self, name="h2o_emission_index", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.pathways_manager = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    self.input_names = {}
    self.output_names = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_h2o": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_h2o": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

Average H20 emission index calculation

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
def compute(self, input_data) -> dict:
    """Average H20 emission index calculation

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

    """

    output_data = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        # initialise the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_h2o = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_h2o = input_data[
                        f"{pathway.name}_emission_index_h2o"
                    ]

                    origin_mean_emission_index_h2o += (
                        pathway_emission_index_h2o * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_h2o"] = (
                    origin_mean_emission_index_h2o * origin_valid_years
                )

    self._store_outputs(output_data)

    return output_data

SulfurEmissionIndex

SulfurEmissionIndex(name='sulfur_emission_index', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute Sulfur emission index.

Parameters:

Name Type Description Default
name str

Name of the model instance ('sulfur_emission_index' by default).

'sulfur_emission_index'

Attributes:

Name Type Description
pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
762
763
764
def __init__(self, name="sulfur_emission_index", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.pathways_manager = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    self.input_names = {}
    self.output_names = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.output_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_sulfur": pd.Series(
                            [0.0]
                        ),
                    }
                )

        for pathway in self.pathways_manager.get(aircraft_type=aircraft_type):
            self.input_names.update(
                {
                    f"{pathway.name}_emission_index_sulfur": 0.0,
                    f"{pathway.name}_massic_share_{aircraft_type}_{pathway.energy_origin}": pd.Series(
                        [0.0]
                    ),
                }
            )

compute

compute(input_data)

Average H20 emission index calculation

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
def compute(self, input_data) -> dict:
    """Average H20 emission index calculation

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

    """

    output_data = {}

    for aircraft_type in self.pathways_manager.get_all_types("aircraft_type"):
        # initialise the mean values for the aircraft type
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            # Get the pathways for this aircraft type and energy origin
            pathways = self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            )
            if pathways:
                origin_mean_emission_index_sulfur = get_default_series(
                    self.historic_start_year, self.end_year
                )
                origin_cumulative_share = get_default_series(
                    self.historic_start_year, self.end_year
                )
                for pathway in pathways:
                    origin_share = input_data[
                        f"{pathway.name}_massic_share_{aircraft_type}_{energy_origin}"
                    ]
                    origin_cumulative_share = (
                        origin_cumulative_share + origin_share.fillna(0) / 100
                    )
                    pathway_emission_index_sulfur = input_data[
                        f"{pathway.name}_emission_index_sulfur"
                    ]

                    origin_mean_emission_index_sulfur += (
                        pathway_emission_index_sulfur * origin_share
                    ).fillna(0) / 100

                origin_valid_years = origin_cumulative_share.replace(0, np.nan)

                output_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_sulfur"] = (
                    origin_mean_emission_index_sulfur * origin_valid_years
                )

    self._store_outputs(output_data)

    return output_data

NonCO2Emissions

NonCO2Emissions(name='non_co2_emissions', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute non-CO2 emissions.

Parameters:

Name Type Description Default
name str

Name of the model instance ('non_co2_emissions' by default).

'non_co2_emissions'

Attributes:

Name Type Description
pathways_manager EnergyCarrierManager

EnergyCarrierManager instance to manage generic energy pathways and their data.

input_names dict

Dictionary of input variable names populated at model initialisation before MDA chain creation.

output_names dict

Dictionary of output variable names populated at model initialisation before MDA chain creation.

Warnings
  • Detailed i/o documentation is not yet provided for models defined wityh generic .yaml files?
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
881
882
883
884
def __init__(self, name="non_co2_emissions", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.climate_historical_data = None
    self.pathways_manager = None

custom_setup

custom_setup()

Dynamically add all pathways variables to input_names and function outputs to output_names. Specific function for custom AeroMAPSModel instances.

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Returns
    -------
    None
    """
    aircraft_type = ["dropin_fuel", "hydrogen"]

    for aircraft_type in aircraft_type:
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                self.input_names.update(
                    {
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_nox": pd.Series(
                            [0.0]
                        ),
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_soot": pd.Series(
                            [0.0]
                        ),
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_h2o": pd.Series(
                            [0.0]
                        ),
                        f"{aircraft_type}_{energy_origin}_mean_emission_index_sulfur": pd.Series(
                            [0.0]
                        ),
                        f"{aircraft_type}_{energy_origin}_mean_lhv": pd.Series([0.0]),
                        f"{aircraft_type}_{energy_origin}_energy_consumption": pd.Series([0.0]),
                    }
                )

    self.output_names.update(
        {
            "soot_emissions": pd.Series([0.0]),
            "h2o_emissions": pd.Series([0.0]),
            "nox_emissions": pd.Series([0.0]),
            "sulfur_emissions": pd.Series([0.0]),
        }
    )

compute

compute(input_data)

Non-CO2 emissions calculation.

Parameters:

Name Type Description Default
input_data

Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

required

Returns:

Type Description
output_data

Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.

Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
def compute(self, input_data) -> dict:
    """Non-CO2 emissions calculation.

    Parameters
    ----------
    input_data
        Dictionary containing all input data required for the computation, completed at model instantiation with information from yaml files and outputs of other models.

    Returns
    -------
    output_data
        Dictionary containing all output data resulting from the computation. Contains outputs defined during model instantiation.
    """

    soot_emissions = get_default_series(self.climate_historic_start_year, self.end_year)
    h2o_emissions = get_default_series(self.climate_historic_start_year, self.end_year)
    nox_emissions = get_default_series(self.climate_historic_start_year, self.end_year)
    sulfur_emissions = get_default_series(self.climate_historic_start_year, self.end_year)

    ## Initialization
    historical_nox_emissions_for_temperature = self.climate_historical_data[:, 2]
    historical_h2o_emissions_for_temperature = self.climate_historical_data[:, 3]
    historical_soot_emissions_for_temperature = self.climate_historical_data[:, 4]
    historical_sulfur_emissions_for_temperature = self.climate_historical_data[:, 5]

    soot_emissions.loc[self.climate_historic_start_year : self.historic_start_year] = (
        historical_soot_emissions_for_temperature
    )
    h2o_emissions.loc[self.climate_historic_start_year : self.historic_start_year] = (
        historical_h2o_emissions_for_temperature
    )
    nox_emissions.loc[self.climate_historic_start_year : self.historic_start_year] = (
        historical_nox_emissions_for_temperature
    )
    sulfur_emissions.loc[self.climate_historic_start_year : self.historic_start_year] = (
        historical_sulfur_emissions_for_temperature
    )

    for aircraft_type in ["dropin_fuel", "hydrogen"]:
        for energy_origin in self.pathways_manager.get_all_types("energy_origin"):
            if self.pathways_manager.get(
                aircraft_type=aircraft_type, energy_origin=energy_origin
            ):
                mass_consumption = (
                    input_data[f"{aircraft_type}_{energy_origin}_energy_consumption"]
                    / input_data[f"{aircraft_type}_{energy_origin}_mean_lhv"]
                    / 10**9  # convert MJ to Mt
                )
                soot_emissions.loc[self.historic_start_year + 1 : self.end_year] += (
                    input_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_soot"]
                    * mass_consumption
                ).fillna(0.0)
                h2o_emissions.loc[self.historic_start_year + 1 : self.end_year] += (
                    input_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_h2o"]
                    * mass_consumption
                ).fillna(0.0)
                nox_emissions.loc[self.historic_start_year + 1 : self.end_year] += (
                    input_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_nox"]
                    * mass_consumption
                ).fillna(0.0)
                sulfur_emissions.loc[self.historic_start_year + 1 : self.end_year] += (
                    input_data[f"{aircraft_type}_{energy_origin}_mean_emission_index_sulfur"]
                    * mass_consumption
                ).fillna(0.0)

    output_data = {
        "soot_emissions": soot_emissions,
        "h2o_emissions": h2o_emissions,
        "nox_emissions": nox_emissions,
        "sulfur_emissions": sulfur_emissions,
    }

    self.df_climate.loc[:, "soot_emissions"] = soot_emissions
    self.df_climate.loc[:, "h2o_emissions"] = h2o_emissions
    self.df_climate.loc[:, "nox_emissions"] = nox_emissions
    self.df_climate.loc[:, "sulfur_emissions"] = sulfur_emissions

    return output_data