Skip to content

aeromaps.models.impacts.energy_resources.energy_consumption

energy_consumption

Module to compute energy consumption from different aircraft types.

DropInFuelConsumption

DropInFuelConsumption(name='drop_in_fuel_consumption', *args, **kwargs)

Bases: AeroMAPSModel

Total drop-in fuel consumption calculation.

Parameters:

Name Type Description Default
name str

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

'drop_in_fuel_consumption'
Documentation

Inputs - ask_dropin_fuel: Passenger ASK for drop-in fuel aircraft [ASK]. - rtkdropin_fuel: Freight RTK for drop-in fuel aircraft [RTK]. - energy_per_ask_without_operationsdropin_fuel: Passenger MJ/ASK (no ops). - energy_per_askdropin_fuel: Passenger MJ/ASK (with ops). - energy_per_rtk_without_operationsdropin_fuel: Freight MJ/RTK (no ops). - energy_per_rtkdropin_fuel: Freight MJ/RTK (with ops). Outputs - energy_consumptiondropin_fuel_without_operations: Per-market drop-in [MJ]. - energy_consumption_dropin_fuel: Per-market drop-in [MJ]. - energy_consumption_passenger_dropin_fuel_without_operations: Passenger total [MJ]. - energy_consumption_freight_dropin_fuel_without_operations: Freight total [MJ]. - energy_consumption_dropin_fuel_without_operations: Passenger + freight [MJ]. - energy_consumption_passenger_dropin_fuel: Passenger total [MJ]. - energy_consumption_freight_dropin_fuel: Freight total [MJ]. - energy_consumption_dropin_fuel: Passenger + freight [MJ]. Notes - is the MarketManager id (passenger and freight markets). - I/O names are generated from configuration and passed to GEMSEO via self.input_names and self.output_names grammars.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
45
46
47
def __init__(self, name="drop_in_fuel_consumption", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.markets = None

custom_setup

custom_setup()

Build input_names / output_names dynamically from the MarketManager. Called once by AeroMAPSProcess after self.markets is injected.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
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
86
87
88
89
90
91
92
93
94
95
def custom_setup(self):
    """
    Build input_names / output_names dynamically from the MarketManager.
    Called once by AeroMAPSProcess after self.markets is injected.
    """
    self.input_names = {}
    self.output_names = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    # Per-market inputs and outputs (passenger: ask-based; freight: rtk-based).
    for market in passenger_markets:
        mid = market.id
        self.input_names[f"ask_{mid}_dropin_fuel"] = pd.Series([0.0])
        self.input_names[f"energy_per_ask_without_operations_{mid}_dropin_fuel"] = pd.Series(
            [0.0]
        )
        self.input_names[f"energy_per_ask_{mid}_dropin_fuel"] = pd.Series([0.0])
        self.output_names[f"energy_consumption_{mid}_dropin_fuel_without_operations"] = (
            pd.Series([0.0])
        )
        self.output_names[f"energy_consumption_{mid}_dropin_fuel"] = pd.Series([0.0])

    for market in freight_markets:
        mid = market.id
        self.input_names[f"rtk_{mid}_dropin_fuel"] = pd.Series([0.0])
        self.input_names[f"energy_per_rtk_without_operations_{mid}_dropin_fuel"] = pd.Series(
            [0.0]
        )
        self.input_names[f"energy_per_rtk_{mid}_dropin_fuel"] = pd.Series([0.0])
        self.output_names[f"energy_consumption_{mid}_dropin_fuel_without_operations"] = (
            pd.Series([0.0])
        )
        self.output_names[f"energy_consumption_{mid}_dropin_fuel"] = pd.Series([0.0])

    # Aggregate outputs (passenger sum, freight sum, grand total) — both with and without operations.
    self.output_names["energy_consumption_passenger_dropin_fuel_without_operations"] = (
        pd.Series([0.0])
    )
    self.output_names["energy_consumption_passenger_dropin_fuel"] = pd.Series([0.0])
    self.output_names["energy_consumption_freight_dropin_fuel_without_operations"] = pd.Series(
        [0.0]
    )
    self.output_names["energy_consumption_freight_dropin_fuel"] = pd.Series([0.0])
    self.output_names["energy_consumption_dropin_fuel_without_operations"] = pd.Series([0.0])
    self.output_names["energy_consumption_dropin_fuel"] = pd.Series([0.0])

compute

compute(input_data)

Drop-in fuel energy consumption per market and aggregates.

Per-market: energy = energy_per_(ask|rtk) * (ask|rtk). Aggregates: passenger sum over passenger markets, freight sum over freight markets, grand total = passenger + freight. Both with-operations and without-operations variants are produced.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
def compute(self, input_data) -> dict:
    """
    Drop-in fuel energy consumption per market and aggregates.

    Per-market: energy = energy_per_(ask|rtk) * (ask|rtk).
    Aggregates: passenger sum over passenger markets, freight sum over freight
    markets, grand total = passenger + freight. Both with-operations and
    without-operations variants are produced.
    """
    output_data = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    # Per-passenger-market consumption.
    passenger_dropin_fuel = None
    passenger_dropin_fuel_without_operations = None
    for market in passenger_markets:
        mid = market.id
        ask = input_data[f"ask_{mid}_dropin_fuel"]
        energy_per_ask_without_operations = input_data[
            f"energy_per_ask_without_operations_{mid}_dropin_fuel"
        ]
        energy_per_ask = input_data[f"energy_per_ask_{mid}_dropin_fuel"]

        # Energy is zero wherever there is no traffic, even when the per-ASK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_ask = energy / ask). The mask
        # is applied per-year so partially-empty markets (zero ASK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_ask_without_operations * ask).where(
            ask != 0.0, 0.0
        )
        energy_consumption = (energy_per_ask * ask).where(ask != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_dropin_fuel_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_dropin_fuel"] = energy_consumption

        passenger_dropin_fuel_without_operations = (
            energy_consumption_without_operations
            if passenger_dropin_fuel_without_operations is None
            else passenger_dropin_fuel_without_operations
            + energy_consumption_without_operations
        )
        passenger_dropin_fuel = (
            energy_consumption
            if passenger_dropin_fuel is None
            else passenger_dropin_fuel + energy_consumption
        )

    # Per-freight-market consumption.
    freight_dropin_fuel = None
    freight_dropin_fuel_without_operations = None
    for market in freight_markets:
        mid = market.id
        rtk = input_data[f"rtk_{mid}_dropin_fuel"]
        energy_per_rtk_without_operations = input_data[
            f"energy_per_rtk_without_operations_{mid}_dropin_fuel"
        ]
        energy_per_rtk = input_data[f"energy_per_rtk_{mid}_dropin_fuel"]

        # Energy is zero wherever there is no traffic, even when the per-RTK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_rtk = energy / rtk). The mask
        # is applied per-year so partially-empty markets (zero RTK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_rtk_without_operations * rtk).where(
            rtk != 0.0, 0.0
        )
        energy_consumption = (energy_per_rtk * rtk).where(rtk != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_dropin_fuel_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_dropin_fuel"] = energy_consumption

        freight_dropin_fuel_without_operations = (
            energy_consumption_without_operations
            if freight_dropin_fuel_without_operations is None
            else freight_dropin_fuel_without_operations + energy_consumption_without_operations
        )
        freight_dropin_fuel = (
            energy_consumption
            if freight_dropin_fuel is None
            else freight_dropin_fuel + energy_consumption
        )

    # Default to zero series when no markets in a traffic_type (defensive — should not happen
    # for the default 4-market config, but custom configs may have e.g. zero freight markets).
    if passenger_dropin_fuel_without_operations is None:
        passenger_dropin_fuel_without_operations = pd.Series(0.0, index=self.df.index)
    if passenger_dropin_fuel is None:
        passenger_dropin_fuel = pd.Series(0.0, index=self.df.index)
    if freight_dropin_fuel_without_operations is None:
        freight_dropin_fuel_without_operations = pd.Series(0.0, index=self.df.index)
    if freight_dropin_fuel is None:
        freight_dropin_fuel = pd.Series(0.0, index=self.df.index)

    output_data["energy_consumption_passenger_dropin_fuel_without_operations"] = (
        passenger_dropin_fuel_without_operations
    )
    output_data["energy_consumption_passenger_dropin_fuel"] = passenger_dropin_fuel
    output_data["energy_consumption_freight_dropin_fuel_without_operations"] = (
        freight_dropin_fuel_without_operations
    )
    output_data["energy_consumption_freight_dropin_fuel"] = freight_dropin_fuel
    output_data["energy_consumption_dropin_fuel_without_operations"] = (
        passenger_dropin_fuel_without_operations + freight_dropin_fuel_without_operations
    )
    output_data["energy_consumption_dropin_fuel"] = passenger_dropin_fuel + freight_dropin_fuel

    self._store_outputs(output_data)
    return output_data

DropInFuelDetailledConsumption

DropInFuelDetailledConsumption(name='drop_in_fuel_detailled_consumption', *args, **kwargs)

Bases: AeroMAPSModel

Detailled drop-in fuel consumption calculation.

Parameters:

Name Type Description Default
name str

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

'drop_in_fuel_detailled_consumption'
Documentation

Inputs - biomass_share_dropin_fuel: Share of biomass-based fuels in drop-in fuels [%]. - electricity_share_dropin_fuel: Share of electricity-based fuels in drop-in fuels [%]. - fossil_share_dropin_fuel: Share of fossil-based fuels in drop-in fuels [%]. - energy_consumption_dropin_fuel_without_operations: Drop-in fuel energy (no ops) [MJ]. - energy_consumptiondropin_fuel: Drop-in fuel energy (with ops) [MJ]. Outputs - energy_consumption_without_operations: Per-market split by fuel [MJ]. - energy_consumption: Per-market split by fuel [MJ]. - energy_consumption_passengerwithout_operations: Passenger total [MJ]. - energy_consumption_freightwithout_operations: Freight total [MJ]. - energy_consumptionwithout_operations: Passenger + freight [MJ]. - energy_consumption_passenger: Passenger total [MJ]. - energy_consumption_freight_: Freight total [MJ]. - energy_consumption_: Passenger + freight [MJ]. Notes - is the MarketManager id (passenger and freight markets). - is one of: biofuel, electrofuel, kerosene. - I/O names are generated from configuration and passed to GEMSEO via self.input_names and self.output_names grammars.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
245
246
247
def __init__(self, name="drop_in_fuel_detailled_consumption", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.markets = None

compute

compute(input_data)

Drop-in fuel detailed consumption per market and aggregates.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
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
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
def compute(self, input_data) -> dict:
    """Drop-in fuel detailed consumption per market and aggregates."""
    output_data = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    shares = {
        "biofuel": input_data["biomass_share_dropin_fuel"] / 100,
        "electrofuel": input_data["electricity_share_dropin_fuel"] / 100,
        "kerosene": input_data["fossil_share_dropin_fuel"] / 100,
    }

    passenger_fuel_totals_without_operations = {fuel: None for fuel in shares}
    passenger_fuel_totals = {fuel: None for fuel in shares}
    freight_fuel_totals_without_operations = {fuel: None for fuel in shares}
    freight_fuel_totals = {fuel: None for fuel in shares}

    for market in passenger_markets:
        mid = market.id
        dropin_fuel_without_operations = input_data[
            f"energy_consumption_{mid}_dropin_fuel_without_operations"
        ]
        dropin_fuel = input_data[f"energy_consumption_{mid}_dropin_fuel"]
        for fuel, share in shares.items():
            fuel_energy_without_operations = share * dropin_fuel_without_operations
            fuel_energy = share * dropin_fuel
            output_data[f"energy_consumption_{mid}_{fuel}_without_operations"] = (
                fuel_energy_without_operations
            )
            output_data[f"energy_consumption_{mid}_{fuel}"] = fuel_energy
            passenger_fuel_totals_without_operations[fuel] = (
                fuel_energy_without_operations
                if passenger_fuel_totals_without_operations[fuel] is None
                else passenger_fuel_totals_without_operations[fuel]
                + fuel_energy_without_operations
            )
            passenger_fuel_totals[fuel] = (
                fuel_energy
                if passenger_fuel_totals[fuel] is None
                else passenger_fuel_totals[fuel] + fuel_energy
            )

    for market in freight_markets:
        mid = market.id
        dropin_fuel_without_operations = input_data[
            f"energy_consumption_{mid}_dropin_fuel_without_operations"
        ]
        dropin_fuel = input_data[f"energy_consumption_{mid}_dropin_fuel"]
        for fuel, share in shares.items():
            fuel_energy_without_operations = share * dropin_fuel_without_operations
            fuel_energy = share * dropin_fuel
            output_data[f"energy_consumption_{mid}_{fuel}_without_operations"] = (
                fuel_energy_without_operations
            )
            output_data[f"energy_consumption_{mid}_{fuel}"] = fuel_energy
            freight_fuel_totals_without_operations[fuel] = (
                fuel_energy_without_operations
                if freight_fuel_totals_without_operations[fuel] is None
                else freight_fuel_totals_without_operations[fuel]
                + fuel_energy_without_operations
            )
            freight_fuel_totals[fuel] = (
                fuel_energy
                if freight_fuel_totals[fuel] is None
                else freight_fuel_totals[fuel] + fuel_energy
            )

    for fuel in shares:
        if passenger_fuel_totals_without_operations[fuel] is None:
            passenger_fuel_totals_without_operations[fuel] = pd.Series(0.0, index=self.df.index)
        if passenger_fuel_totals[fuel] is None:
            passenger_fuel_totals[fuel] = pd.Series(0.0, index=self.df.index)
        if freight_fuel_totals_without_operations[fuel] is None:
            freight_fuel_totals_without_operations[fuel] = pd.Series(0.0, index=self.df.index)
        if freight_fuel_totals[fuel] is None:
            freight_fuel_totals[fuel] = pd.Series(0.0, index=self.df.index)

        output_data[f"energy_consumption_passenger_{fuel}_without_operations"] = (
            passenger_fuel_totals_without_operations[fuel]
        )
        output_data[f"energy_consumption_freight_{fuel}_without_operations"] = (
            freight_fuel_totals_without_operations[fuel]
        )
        output_data[f"energy_consumption_{fuel}_without_operations"] = (
            passenger_fuel_totals_without_operations[fuel]
            + freight_fuel_totals_without_operations[fuel]
        )
        output_data[f"energy_consumption_passenger_{fuel}"] = passenger_fuel_totals[fuel]
        output_data[f"energy_consumption_freight_{fuel}"] = freight_fuel_totals[fuel]
        output_data[f"energy_consumption_{fuel}"] = (
            passenger_fuel_totals[fuel] + freight_fuel_totals[fuel]
        )

    self._store_outputs(output_data)
    return output_data

HydrogenConsumption

HydrogenConsumption(name='hydrogen_consumption', *args, **kwargs)

Bases: AeroMAPSModel

Class to calculate hydrogen consumption for each type of market.

Parameters:

Name Type Description Default
name str

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

'hydrogen_consumption'
Documentation

Inputs - ask_hydrogen: Passenger ASK for hydrogen aircraft [ASK]. - rtkhydrogen: Freight RTK for hydrogen aircraft [RTK]. - energy_per_ask_without_operationshydrogen: Passenger MJ/ASK (no ops). - energy_per_askhydrogen: Passenger MJ/ASK (with ops). - energy_per_rtk_without_operationshydrogen: Freight MJ/RTK (no ops). - energy_per_rtkhydrogen: Freight MJ/RTK (with ops). Outputs - energy_consumptionhydrogen_without_operations: Per-market hydrogen [MJ]. - energy_consumption_hydrogen: Per-market hydrogen [MJ]. - energy_consumption_passenger_hydrogen_without_operations: Passenger total [MJ]. - energy_consumption_freight_hydrogen_without_operations: Freight total [MJ]. - energy_consumption_hydrogen_without_operations: Passenger + freight [MJ]. - energy_consumption_passenger_hydrogen: Passenger total [MJ]. - energy_consumption_freight_hydrogen: Freight total [MJ]. - energy_consumption_hydrogen: Passenger + freight [MJ]. Notes - is the MarketManager id (passenger and freight markets). - I/O names are generated from configuration and passed to GEMSEO via self.input_names and self.output_names grammars.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
415
416
417
def __init__(self, name="hydrogen_consumption", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.markets = None

compute

compute(input_data)

Hydrogen consumption per market and aggregates.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
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
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
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
def compute(self, input_data) -> dict:
    """Hydrogen consumption per market and aggregates."""
    output_data = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    passenger_hydrogen_without_operations = None
    passenger_hydrogen = None
    for market in passenger_markets:
        mid = market.id
        ask = input_data[f"ask_{mid}_hydrogen"]
        energy_per_ask_without_operations = input_data[
            f"energy_per_ask_without_operations_{mid}_hydrogen"
        ]
        energy_per_ask = input_data[f"energy_per_ask_{mid}_hydrogen"]

        # Energy is zero wherever there is no traffic, even when the per-ASK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_ask = energy / ask). The mask
        # is applied per-year so partially-empty markets (zero ASK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_ask_without_operations * ask).where(
            ask != 0.0, 0.0
        )
        energy_consumption = (energy_per_ask * ask).where(ask != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_hydrogen_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_hydrogen"] = energy_consumption

        passenger_hydrogen_without_operations = (
            energy_consumption_without_operations
            if passenger_hydrogen_without_operations is None
            else passenger_hydrogen_without_operations + energy_consumption_without_operations
        )
        passenger_hydrogen = (
            energy_consumption
            if passenger_hydrogen is None
            else passenger_hydrogen + energy_consumption
        )

    freight_hydrogen_without_operations = None
    freight_hydrogen = None
    for market in freight_markets:
        mid = market.id
        rtk = input_data[f"rtk_{mid}_hydrogen"]
        energy_per_rtk_without_operations = input_data[
            f"energy_per_rtk_without_operations_{mid}_hydrogen"
        ]
        energy_per_rtk = input_data[f"energy_per_rtk_{mid}_hydrogen"]

        # Energy is zero wherever there is no traffic, even when the per-RTK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_rtk = energy / rtk). The mask
        # is applied per-year so partially-empty markets (zero RTK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_rtk_without_operations * rtk).where(
            rtk != 0.0, 0.0
        )
        energy_consumption = (energy_per_rtk * rtk).where(rtk != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_hydrogen_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_hydrogen"] = energy_consumption

        freight_hydrogen_without_operations = (
            energy_consumption_without_operations
            if freight_hydrogen_without_operations is None
            else freight_hydrogen_without_operations + energy_consumption_without_operations
        )
        freight_hydrogen = (
            energy_consumption
            if freight_hydrogen is None
            else freight_hydrogen + energy_consumption
        )

    if passenger_hydrogen_without_operations is None:
        passenger_hydrogen_without_operations = pd.Series(0.0, index=self.df.index)
    if passenger_hydrogen is None:
        passenger_hydrogen = pd.Series(0.0, index=self.df.index)
    if freight_hydrogen_without_operations is None:
        freight_hydrogen_without_operations = pd.Series(0.0, index=self.df.index)
    if freight_hydrogen is None:
        freight_hydrogen = pd.Series(0.0, index=self.df.index)

    output_data["energy_consumption_passenger_hydrogen_without_operations"] = (
        passenger_hydrogen_without_operations
    )
    output_data["energy_consumption_freight_hydrogen_without_operations"] = (
        freight_hydrogen_without_operations
    )
    output_data["energy_consumption_hydrogen_without_operations"] = (
        passenger_hydrogen_without_operations + freight_hydrogen_without_operations
    )
    output_data["energy_consumption_passenger_hydrogen"] = passenger_hydrogen
    output_data["energy_consumption_freight_hydrogen"] = freight_hydrogen
    output_data["energy_consumption_hydrogen"] = passenger_hydrogen + freight_hydrogen

    self._store_outputs(output_data)
    return output_data

ElectricConsumption

ElectricConsumption(name='electric_consumption', *args, **kwargs)

Bases: AeroMAPSModel

Class to calculate electricity consumption for each type of market.

Parameters:

Name Type Description Default
name str

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

'electric_consumption'
Documentation

Inputs - ask_electric: Passenger ASK for electric aircraft [ASK]. - rtkelectric: Freight RTK for electric aircraft [RTK]. - energy_per_ask_without_operationselectric: Passenger MJ/ASK (no ops). - energy_per_askelectric: Passenger MJ/ASK (with ops). - energy_per_rtk_without_operationselectric: Freight MJ/RTK (no ops). - energy_per_rtkelectric: Freight MJ/RTK (with ops). Outputs - energy_consumptionelectric_without_operations: Per-market electricity [MJ]. - energy_consumption_electric: Per-market electricity [MJ]. - energy_consumption_passenger_electric_without_operations: Passenger total [MJ]. - energy_consumption_freight_electric_without_operations: Freight total [MJ]. - energy_consumption_electric_without_operations: Passenger + freight [MJ]. - energy_consumption_passenger_electric: Passenger total [MJ]. - energy_consumption_freight_electric: Freight total [MJ]. - energy_consumption_electric: Passenger + freight [MJ]. Notes - is the MarketManager id (passenger and freight markets). - I/O names are generated from configuration and passed to GEMSEO via self.input_names and self.output_names grammars.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
593
594
595
def __init__(self, name="electric_consumption", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.markets = None

compute

compute(input_data)

Electricity consumption per market and aggregates.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
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
671
672
673
674
675
676
677
678
679
680
681
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
def compute(self, input_data) -> dict:
    """Electricity consumption per market and aggregates."""
    output_data = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    passenger_electric_without_operations = None
    passenger_electric = None
    for market in passenger_markets:
        mid = market.id
        ask = input_data[f"ask_{mid}_electric"]
        energy_per_ask_without_operations = input_data[
            f"energy_per_ask_without_operations_{mid}_electric"
        ]
        energy_per_ask = input_data[f"energy_per_ask_{mid}_electric"]

        # Energy is zero wherever there is no traffic, even when the per-ASK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_ask = energy / ask). The mask
        # is applied per-year so partially-empty markets (zero ASK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_ask_without_operations * ask).where(
            ask != 0.0, 0.0
        )
        energy_consumption = (energy_per_ask * ask).where(ask != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_electric_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_electric"] = energy_consumption

        passenger_electric_without_operations = (
            energy_consumption_without_operations
            if passenger_electric_without_operations is None
            else passenger_electric_without_operations + energy_consumption_without_operations
        )
        passenger_electric = (
            energy_consumption
            if passenger_electric is None
            else passenger_electric + energy_consumption
        )

    freight_electric_without_operations = None
    freight_electric = None
    for market in freight_markets:
        mid = market.id
        rtk = input_data[f"rtk_{mid}_electric"]
        energy_per_rtk_without_operations = input_data[
            f"energy_per_rtk_without_operations_{mid}_electric"
        ]
        energy_per_rtk = input_data[f"energy_per_rtk_{mid}_electric"]

        # Energy is zero wherever there is no traffic, even when the per-RTK intensity is
        # NaN/inf from an upstream division-by-zero (energy_per_rtk = energy / rtk). The mask
        # is applied per-year so partially-empty markets (zero RTK in some years only) do not
        # leak NaN: inf * 0 would otherwise produce NaN and propagate to every aggregate.
        energy_consumption_without_operations = (energy_per_rtk_without_operations * rtk).where(
            rtk != 0.0, 0.0
        )
        energy_consumption = (energy_per_rtk * rtk).where(rtk != 0.0, 0.0)

        output_data[f"energy_consumption_{mid}_electric_without_operations"] = (
            energy_consumption_without_operations
        )
        output_data[f"energy_consumption_{mid}_electric"] = energy_consumption

        freight_electric_without_operations = (
            energy_consumption_without_operations
            if freight_electric_without_operations is None
            else freight_electric_without_operations + energy_consumption_without_operations
        )
        freight_electric = (
            energy_consumption
            if freight_electric is None
            else freight_electric + energy_consumption
        )

    if passenger_electric_without_operations is None:
        passenger_electric_without_operations = pd.Series(0.0, index=self.df.index)
    if passenger_electric is None:
        passenger_electric = pd.Series(0.0, index=self.df.index)
    if freight_electric_without_operations is None:
        freight_electric_without_operations = pd.Series(0.0, index=self.df.index)
    if freight_electric is None:
        freight_electric = pd.Series(0.0, index=self.df.index)

    output_data["energy_consumption_passenger_electric_without_operations"] = (
        passenger_electric_without_operations
    )
    output_data["energy_consumption_freight_electric_without_operations"] = (
        freight_electric_without_operations
    )
    output_data["energy_consumption_electric_without_operations"] = (
        passenger_electric_without_operations + freight_electric_without_operations
    )
    output_data["energy_consumption_passenger_electric"] = passenger_electric
    output_data["energy_consumption_freight_electric"] = freight_electric
    output_data["energy_consumption_electric"] = passenger_electric + freight_electric

    self._store_outputs(output_data)
    return output_data

EnergyConsumption

EnergyConsumption(name='energy_consumption', *args, **kwargs)

Bases: AeroMAPSModel

Class to calculate total energy consumption for each type of market, aggregating all energy sources.

Documentation

Inputs - energy_consumption_dropin_fuel_without_operations: Drop-in fuel [MJ]. - energy_consumptionhydrogen_without_operations: Hydrogen [MJ]. - energy_consumptionelectric_without_operations: Electricity [MJ]. - energy_consumptiondropin_fuel: Drop-in fuel [MJ]. - energy_consumptionhydrogen: Hydrogen [MJ]. - energy_consumptionelectric: Electricity [MJ]. Outputs - energy_consumptionwithout_operations: Per-market total [MJ]. - energy_consumption: Per-market total [MJ]. - energy_consumption_passenger_without_operations: Passenger total [MJ]. - energy_consumption_freight_without_operations: Freight total [MJ]. - energy_consumption_without_operations: Passenger + freight [MJ]. - energy_consumption_passenger: Passenger total [MJ]. - energy_consumption_freight: Freight total [MJ]. - energy_consumption: Passenger + freight [MJ]. Notes - is the MarketManager id (passenger and freight markets). - I/O names are generated from configuration and passed to GEMSEO via self.input_names and self.output_names grammars.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
766
767
768
def __init__(self, name="energy_consumption", *args, **kwargs):
    super().__init__(name=name, model_type="custom", *args, **kwargs)
    self.markets = None

compute

compute(input_data)

Total energy consumption per market and aggregates.

Source code in aeromaps/models/impacts/energy_resources/energy_consumption.py
794
795
796
797
798
799
800
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
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
def compute(self, input_data) -> dict:
    """Total energy consumption per market and aggregates."""
    output_data = {}

    passenger_markets = list(self.markets.get(traffic_type="passenger"))
    freight_markets = list(self.markets.get(traffic_type="freight"))

    passenger_energy_without_operations = None
    passenger_energy = None
    for market in passenger_markets:
        mid = market.id
        market_energy_without_operations = (
            input_data[f"energy_consumption_{mid}_dropin_fuel_without_operations"]
            + input_data[f"energy_consumption_{mid}_hydrogen_without_operations"]
            + input_data[f"energy_consumption_{mid}_electric_without_operations"]
        )
        market_energy = (
            input_data[f"energy_consumption_{mid}_dropin_fuel"]
            + input_data[f"energy_consumption_{mid}_hydrogen"]
            + input_data[f"energy_consumption_{mid}_electric"]
        )

        output_data[f"energy_consumption_{mid}_without_operations"] = (
            market_energy_without_operations
        )
        output_data[f"energy_consumption_{mid}"] = market_energy

        passenger_energy_without_operations = (
            market_energy_without_operations
            if passenger_energy_without_operations is None
            else passenger_energy_without_operations + market_energy_without_operations
        )
        passenger_energy = (
            market_energy if passenger_energy is None else passenger_energy + market_energy
        )

    freight_energy_without_operations = None
    freight_energy = None
    for market in freight_markets:
        mid = market.id
        market_energy_without_operations = (
            input_data[f"energy_consumption_{mid}_dropin_fuel_without_operations"]
            + input_data[f"energy_consumption_{mid}_hydrogen_without_operations"]
            + input_data[f"energy_consumption_{mid}_electric_without_operations"]
        )
        market_energy = (
            input_data[f"energy_consumption_{mid}_dropin_fuel"]
            + input_data[f"energy_consumption_{mid}_hydrogen"]
            + input_data[f"energy_consumption_{mid}_electric"]
        )

        output_data[f"energy_consumption_{mid}_without_operations"] = (
            market_energy_without_operations
        )
        output_data[f"energy_consumption_{mid}"] = market_energy

        freight_energy_without_operations = (
            market_energy_without_operations
            if freight_energy_without_operations is None
            else freight_energy_without_operations + market_energy_without_operations
        )
        freight_energy = (
            market_energy if freight_energy is None else freight_energy + market_energy
        )

    if passenger_energy_without_operations is None:
        passenger_energy_without_operations = pd.Series(0.0, index=self.df.index)
    if passenger_energy is None:
        passenger_energy = pd.Series(0.0, index=self.df.index)
    if freight_energy_without_operations is None:
        freight_energy_without_operations = pd.Series(0.0, index=self.df.index)
    if freight_energy is None:
        freight_energy = pd.Series(0.0, index=self.df.index)

    output_data["energy_consumption_passenger_without_operations"] = (
        passenger_energy_without_operations
    )
    output_data["energy_consumption_freight_without_operations"] = (
        freight_energy_without_operations
    )
    output_data["energy_consumption_without_operations"] = (
        passenger_energy_without_operations + freight_energy_without_operations
    )
    output_data["energy_consumption_passenger"] = passenger_energy
    output_data["energy_consumption_freight"] = freight_energy
    output_data["energy_consumption"] = passenger_energy + freight_energy

    self._store_outputs(output_data)
    return output_data