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.

Parameters:

Name Type Description Default
None
required

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
82
83
84
85
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    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
 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
151
152
153
154
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
182
183
184
185
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

custom_setup

custom_setup()

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

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
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
226
227
228
229
230
231
232
233
234
235
236
237
238
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    Returns
    -------
    None
    """
    # TODO caution aircraft types not generic there
    self.input_names = {
        "ask_long_range_dropin_fuel": pd.Series([0.0]),
        "ask_medium_range_dropin_fuel": pd.Series([0.0]),
        "ask_short_range_dropin_fuel": pd.Series([0.0]),
        "ask_long_range_hydrogen": pd.Series([0.0]),
        "ask_medium_range_hydrogen": pd.Series([0.0]),
        "ask_short_range_hydrogen": pd.Series([0.0]),
        "ask_long_range_electric": pd.Series([0.0]),
        "ask_medium_range_electric": pd.Series([0.0]),
        "ask_short_range_electric": 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_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
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
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:
        emission_index_nox_short_range = self.fleet_model.df[
            f"Short Range:emission_index_nox:{aircraft_type}"
        ]
        emission_index_nox_medium_range = self.fleet_model.df[
            f"Medium Range:emission_index_nox:{aircraft_type}"
        ]
        emission_index_nox_long_range = self.fleet_model.df[
            f"Long Range:emission_index_nox:{aircraft_type}"
        ]

        ask_short_range = input_data.get(
            f"ask_short_range_{aircraft_type}",
            get_default_series(self.historic_start_year, self.end_year),
        )
        ask_medium_range = input_data.get(
            f"ask_medium_range_{aircraft_type}",
            get_default_series(self.historic_start_year, self.end_year),
        )
        ask_long_range = input_data.get(
            f"ask_long_range_{aircraft_type}",
            get_default_series(self.historic_start_year, self.end_year),
        )

        emission_index_aircraft_type = (
            (
                emission_index_nox_short_range.loc[self.historic_start_year : self.end_year]
                * ask_short_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
            + (
                emission_index_nox_medium_range.loc[self.historic_start_year : self.end_year]
                * ask_medium_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
            + (
                emission_index_nox_long_range.loc[self.historic_start_year : self.end_year]
                * ask_long_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
        ) / (
            ask_short_range.loc[self.historic_start_year : self.end_year].fillna(0)
            + ask_medium_range.loc[self.historic_start_year : self.end_year].fillna(0)
            + ask_long_range.loc[self.historic_start_year : self.end_year].fillna(0)
        )

        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
375
376
377
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.

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
379
380
381
382
383
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
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    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
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
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
515
516
517
518
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

custom_setup

custom_setup()

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

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
520
521
522
523
524
525
526
527
528
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
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    Returns
    -------
    None
    """
    # TODO caution aircraft types not generic there
    self.input_names = {
        "ask_long_range_dropin_fuel": pd.Series([0.0]),
        "ask_medium_range_dropin_fuel": pd.Series([0.0]),
        "ask_short_range_dropin_fuel": pd.Series([0.0]),
        "ask_long_range_hydrogen": pd.Series([0.0]),
        "ask_medium_range_hydrogen": pd.Series([0.0]),
        "ask_short_range_hydrogen": pd.Series([0.0]),
        "ask_long_range_electric": pd.Series([0.0]),
        "ask_medium_range_electric": pd.Series([0.0]),
        "ask_short_range_electric": 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
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
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
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:
        emission_index_soot_short_range = self.fleet_model.df[
            f"Short Range:emission_index_soot:{aircraft_type}"
        ]
        emission_index_soot_medium_range = self.fleet_model.df[
            f"Medium Range:emission_index_soot:{aircraft_type}"
        ]
        emission_index_soot_long_range = self.fleet_model.df[
            f"Long Range:emission_index_soot:{aircraft_type}"
        ]

        ask_short_range = input_data[f"ask_short_range_{aircraft_type}"]
        ask_medium_range = input_data[f"ask_medium_range_{aircraft_type}"]
        ask_long_range = input_data[f"ask_long_range_{aircraft_type}"]

        emission_index_aircraft_type = (
            (
                emission_index_soot_short_range.loc[self.historic_start_year : self.end_year]
                * ask_short_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
            + (
                emission_index_soot_medium_range.loc[self.historic_start_year : self.end_year]
                * ask_medium_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
            + (
                emission_index_soot_long_range.loc[self.historic_start_year : self.end_year]
                * ask_long_range.loc[self.historic_start_year : self.end_year].fillna(0)
            )
        ) / (
            ask_short_range.loc[self.historic_start_year : self.end_year].fillna(0)
            + ask_medium_range.loc[self.historic_start_year : self.end_year].fillna(0)
            + ask_long_range.loc[self.historic_start_year : self.end_year].fillna(0)
        )

        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
696
697
698
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.

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
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
737
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    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
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
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
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
819
820
821
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.

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
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
856
857
858
859
860
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    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
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
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
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
942
943
944
945
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.

Parameters:

Name Type Description Default
None
required

Returns:

Type Description
None
Source code in aeromaps/models/impacts/emissions/non_co2_emissions.py
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
def custom_setup(self):
    """
    Dynamically add all pathways variables to input_names and function outputs to output_names.
    Specific function for custom AeroMAPSModel instances.

    Parameters
    ----------
    None

    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
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
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