Skip to content

aeromaps.models.impacts.emissions.carbon_offset

carbon_offset

=============================== Module to compute effects of carbon offsets.

LevelCarbonOffset

LevelCarbonOffset(name='level_carbon_offset', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute carbon offset required to level emissions to offsetting targets compared to 2019 emissions.

Parameters:

Name Type Description Default
name str

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

'level_carbon_offset'
Source code in aeromaps/models/impacts/emissions/carbon_offset.py
29
30
def __init__(self, name="level_carbon_offset", *args, **kwargs):
    super().__init__(name=name, *args, **kwargs)

compute

compute(co2_emissions, carbon_offset_baseline_level_vs_2019_reference_periods, carbon_offset_baseline_level_vs_2019_reference_periods_values, carbon_offset_baseline_share_total_emissions_reference_periods, carbon_offset_baseline_share_total_emissions_reference_periods_values)

Execute the computation of carbon offset required to level emissions.

Parameters:

Name Type Description Default
co2_emissions Series

CO2 emissions trajectory [MtCO2].

required
carbon_offset_baseline_level_vs_2019_reference_periods list

Reference periods for the level of CO2 emissions relative to 2019 from which higher emissions are offset [years].

required
carbon_offset_baseline_level_vs_2019_reference_periods_values list

Level of CO2 emissions relative to 2019 from which higher emissions are offset for the reference periods [%].

required
carbon_offset_baseline_share_total_emissions_reference_periods list

Reference periods for the share of total CO2 emissions on which offset is applied [years].

required
carbon_offset_baseline_share_total_emissions_reference_periods_values list

Share of total CO2 emissions on which offset is applied for the reference periods [%].

required

Returns:

Type Description
carbon_offset_baseline_level_vs_2019

Level of CO2 emissions relative to 2019 from which higher emissions are offset [%].

level_carbon_offset

Annual carbon offset due to offsetting for a given level of emissions [MtCO2].

Source code in aeromaps/models/impacts/emissions/carbon_offset.py
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 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
 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
def compute(
    self,
    co2_emissions: pd.Series,
    carbon_offset_baseline_level_vs_2019_reference_periods: list,
    carbon_offset_baseline_level_vs_2019_reference_periods_values: list,
    carbon_offset_baseline_share_total_emissions_reference_periods: list,
    carbon_offset_baseline_share_total_emissions_reference_periods_values: list,
) -> Tuple[pd.Series, pd.Series, pd.Series]:
    """
    Execute the computation of carbon offset required to level emissions.

    Parameters
    ----------
    co2_emissions
        CO2 emissions trajectory [MtCO2].
    carbon_offset_baseline_level_vs_2019_reference_periods
        Reference periods for the level of CO2 emissions relative to 2019 from which higher emissions are offset [years].
    carbon_offset_baseline_level_vs_2019_reference_periods_values
        Level of CO2 emissions relative to 2019 from which higher emissions are offset for the reference periods [%].
    carbon_offset_baseline_share_total_emissions_reference_periods
        Reference periods for the share of total CO2 emissions on which offset is applied [years].
    carbon_offset_baseline_share_total_emissions_reference_periods_values
        Share of total CO2 emissions on which offset is applied for the reference periods [%].

    Returns
    -------
    carbon_offset_baseline_level_vs_2019
        Level of CO2 emissions relative to 2019 from which higher emissions are offset [%].
    level_carbon_offset
        Annual carbon offset due to offsetting for a given level of emissions [MtCO2].

    """
    carbon_offset_baseline_level_vs_2019 = aeromaps_leveling_function(
        self,
        carbon_offset_baseline_level_vs_2019_reference_periods,
        carbon_offset_baseline_level_vs_2019_reference_periods_values,
        model_name=self.name,
    )

    carbon_offset_baseline_share_total_emissions = aeromaps_leveling_function(
        self,
        carbon_offset_baseline_share_total_emissions_reference_periods,
        carbon_offset_baseline_share_total_emissions_reference_periods_values,
        model_name=self.name,
    )

    self.df.loc[:, "carbon_offset_baseline_level_vs_2019"] = (
        carbon_offset_baseline_level_vs_2019
    )
    self.df.loc[:, "carbon_offset_baseline_share_total_emissions"] = (
        carbon_offset_baseline_share_total_emissions
    )

    self.df.loc[
        self.historic_start_year : self.prospection_start_year - 1, "level_carbon_offset"
    ] = 0.0

    baseline_level = (
        co2_emissions.loc[2019]
        * self.df.loc[
            self.prospection_start_year : self.end_year, "carbon_offset_baseline_level_vs_2019"
        ]
        / 100
    )

    # compute the ammount offset. "clip" sets it to zero if emissions do not exceeds the baseline.
    self.df.loc[self.prospection_start_year : self.end_year, "level_carbon_offset"] = (
        (
            (
                co2_emissions.loc[self.prospection_start_year : self.end_year] - baseline_level
            ).clip(lower=0.0)
        )
        * self.df.loc[
            self.prospection_start_year : self.end_year,
            "carbon_offset_baseline_share_total_emissions",
        ]
        / 100
    )

    level_carbon_offset = self.df["level_carbon_offset"]

    return (
        carbon_offset_baseline_level_vs_2019,
        carbon_offset_baseline_share_total_emissions,
        level_carbon_offset,
    )

ResidualCarbonOffset

ResidualCarbonOffset(name='residual_carbon_offset', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute carbon offset to match a share of residual emissions.

Parameters:

Name Type Description Default
name str

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

'residual_carbon_offset'
Source code in aeromaps/models/impacts/emissions/carbon_offset.py
130
131
def __init__(self, name="residual_carbon_offset", *args, **kwargs):
    super().__init__(name=name, *args, **kwargs)

compute

compute(co2_emissions, level_carbon_offset, residual_carbon_offset_share_reference_years, residual_carbon_offset_share_reference_years_values)

Execute the computation of carbon offset to match a share of residual emissions.

Parameters:

Name Type Description Default
co2_emissions Series

CO2 emissions trajectory [MtCO2].

required
level_carbon_offset Series

Annual carbon offset due to offsetting for a given level of emissions [MtCO2].

required
residual_carbon_offset_share_reference_years list

Reference years for the share of remaining CO2 emissions offset [years].

required
residual_carbon_offset_share_reference_years_values list

Share of residual emissions to be offset for the reference years [%].

required

Returns:

Type Description
residual_carbon_offset_share

Share of residual emissions to be offset [%].

residual_carbon_offset

Annual carbon offset due to offsetting of a given share of the remaining emissions [MtCO2].

Source code in aeromaps/models/impacts/emissions/carbon_offset.py
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
def compute(
    self,
    co2_emissions: pd.Series,
    level_carbon_offset: pd.Series,
    residual_carbon_offset_share_reference_years: list,
    residual_carbon_offset_share_reference_years_values: list,
) -> Tuple[pd.Series, pd.Series]:
    """
    Execute the computation of carbon offset to match a share of residual emissions.

    Parameters
    ----------
    co2_emissions
        CO2 emissions trajectory [MtCO2].
    level_carbon_offset
        Annual carbon offset due to offsetting for a given level of emissions [MtCO2].
    residual_carbon_offset_share_reference_years
        Reference years for the share of remaining CO2 emissions offset [years].
    residual_carbon_offset_share_reference_years_values
        Share of residual emissions to be offset for the reference years [%].

    Returns
    -------
    residual_carbon_offset_share
        Share of residual emissions to be offset [%].
    residual_carbon_offset
        Annual carbon offset due to offsetting of a given share of the remaining emissions [MtCO2].

    """
    residual_carbon_offset_share_prospective = aeromaps_interpolation_function(
        self,
        residual_carbon_offset_share_reference_years,
        residual_carbon_offset_share_reference_years_values,
        model_name=self.name,
    )
    self.df.loc[:, "residual_carbon_offset_share"] = residual_carbon_offset_share_prospective
    for k in range(self.historic_start_year, self.prospection_start_year):
        self.df.loc[k, "residual_carbon_offset_share"] = 0.0
    residual_carbon_offset_share = self.df["residual_carbon_offset_share"]

    for k in range(self.historic_start_year, self.end_year + 1):
        self.df.loc[k, "residual_carbon_offset"] = (
            self.df.loc[k, "residual_carbon_offset_share"]
            / 100
            * (co2_emissions.loc[k] - level_carbon_offset.loc[k])
        )

    residual_carbon_offset = self.df["residual_carbon_offset"]

    return (residual_carbon_offset_share, residual_carbon_offset)

CarbonOffset

CarbonOffset(name='carbon_offset', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute total carbon offset.

Parameters:

Name Type Description Default
name str

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

'carbon_offset'
Source code in aeromaps/models/impacts/emissions/carbon_offset.py
195
196
def __init__(self, name="carbon_offset", *args, **kwargs):
    super().__init__(name=name, *args, **kwargs)

compute

compute(level_carbon_offset, residual_carbon_offset)

Execute the computation of total carbon offset.

Parameters:

Name Type Description Default
level_carbon_offset Series

Annual carbon offset due to offsetting for a given level of emissions [MtCO2].

required
residual_carbon_offset Series

Annual carbon offset due to offsetting of a given share of the remaining emissions [MtCO2].

required

Returns:

Type Description
carbon_offset

Total annual carbon offset [MtCO2].

Source code in aeromaps/models/impacts/emissions/carbon_offset.py
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
def compute(
    self,
    level_carbon_offset: pd.Series,
    residual_carbon_offset: pd.Series,
) -> pd.Series:
    """
    Execute the computation of total carbon offset.

    Parameters
    ----------
    level_carbon_offset
        Annual carbon offset due to offsetting for a given level of emissions [MtCO2].
    residual_carbon_offset
        Annual carbon offset due to offsetting of a given share of the remaining emissions [MtCO2].

    Returns
    -------
    carbon_offset
        Total annual carbon offset [MtCO2].

    """
    carbon_offset = level_carbon_offset.fillna(0) + residual_carbon_offset.fillna(0)

    self.df.loc[:, "carbon_offset"] = carbon_offset

    return carbon_offset

CumulativeCarbonOffset

CumulativeCarbonOffset(name='cumulative_carbon_offset', *args, **kwargs)

Bases: AeroMAPSModel

Class to compute cumulative carbon offset.

Parameters:

Name Type Description Default
name str

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

'cumulative_carbon_offset'
Source code in aeromaps/models/impacts/emissions/carbon_offset.py
236
237
def __init__(self, name="cumulative_carbon_offset", *args, **kwargs):
    super().__init__(name=name, *args, **kwargs)

compute

compute(carbon_offset)

Execute the computation of cumulative carbon offset.

Parameters:

Name Type Description Default
carbon_offset Series

Total annual carbon offset [MtCO2].

required

Returns:

Type Description
cumulative_carbon_offset

Cumulative carbon offset from air transport [GtCO2].

Source code in aeromaps/models/impacts/emissions/carbon_offset.py
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
def compute(
    self,
    carbon_offset: pd.Series,
) -> pd.Series:
    """
    Execute the computation of cumulative carbon offset.

    Parameters
    ----------
    carbon_offset
        Total annual carbon offset [MtCO2].

    Returns
    -------
    cumulative_carbon_offset
        Cumulative carbon offset from air transport [GtCO2].

    """
    self.df.loc[self.prospection_start_year - 1, "cumulative_carbon_offset"] = 0.0
    for k in range(self.prospection_start_year, self.end_year + 1):
        self.df.loc[k, "cumulative_carbon_offset"] = (
            self.df.loc[k - 1, "cumulative_carbon_offset"] + carbon_offset.loc[k] / 1000
        )

    cumulative_carbon_offset = self.df["cumulative_carbon_offset"]

    return cumulative_carbon_offset