openairclim.calc_swv
Calculates the impact of SWV
- openairclim.calc_swv.calc_swv_mass_conc(delta_ch4, display_distribution=False)[source]
Calculates the SWV concentration and mass based on the oxidation of CH4. It is based on the tropospheric CH4 change, the fractional release factor, and the Age-of-Air. Based on the papers of A.J. Harmsen (2026) The Climate Impact of Stratospheric Water Vapour Caused by Aviation Emissions https://repository.tudelft.nl/record/uuid:98c4bda7-a17d-47a4-9b24-48b7b46e4bb6
- Parameters:
- Returns:
- A list of the total change in SWV mass in Tg due to CH4 oxidation
for each year corresponding to delta_ch4.
- delta_conc_swv (list): A list with the average stratospheric concentration
change of SWV in ppbv due to CH4 oxidation for each year corresponding to delta_ch4.
- final_swv_distribution (DataFrame): A DataFrame of the final distribution of
SWV concentration change in ppbv
- Return type:
delta_mass_swv (list)
- openairclim.calc_swv.calc_swv_rf(total_swv_mass: dict)[source]
Function to calculate the RF due to a certain SWV perturbation mass. Based on Pletzer (2024) The climate impact of hypersonic transport. https://doi.org/10.4233/uuid:39acca9a-53ba-4b9c-b9c0-b6c99f552e25
- Parameters:
total_swv_mass (dict) – A dict with as key “SWV” with an array containing
year. (the SWV mass in Tg for corresponding)
- Raises:
TypeError – if total_SWV_mass is not a dict
ValueError – if the total mass is out of range of the plot of Pletzer (2024)
- Returns:
A dict that contains the forcing due to SWV at that time
- Return type:
rf_swv_dict (dict)
- openairclim.calc_swv.construct_myhre_1m_df()[source]
A function to reproduce the HALOE data stated in figure 1 from Myhre et al., (2007) Radiative forcing due to stratospheric water vapour from CH4 oxidation. This function produces the HALOE zonal mean vertical profile of CH4 over the period October 1991 throughout 1999. The function reads the data file called ‘ch4_for_swv_calc.nc’ in which the data is stored.
- Returns:
a DataFrame that contains all data that is required by the get_griddata function to provide a proper grid
- Return type:
df (DataFrame)
- openairclim.calc_swv.get_alpha_aoa(heights, latitudes, plot_data=False)[source]
Function to construct the fractional release factor for CH4 (alpha) and the age-of air rounded to whole years.
- Parameters:
heights (np.array) – a np.array of heights in meters
latitudes (np.array) – a np.array of latitudes in degrees
plot_data (bool) – whether to plot the data or not
- Returns:
- A matrix of fractional release factors
for different altitude and latitude levels.
- rounded_aoa (np.ndarray): A matrix of the rounded age of air
for different altitude and latitude levels.
- Return type:
alpha (np.ndarray)
- openairclim.calc_swv.get_griddata(df, heights, latitudes, plot_data=False)[source]
Function to transform the data to an evenly spaced and linearly interpolated grid. :param df: a dataframe containing altitudes and latitudes and corresponding values :type df: DataFrame :param heights: a np.array of heights in meters :type heights: np.array :param latitudes: a np.array of latitudes in degrees :type latitudes: np.array :param plot_data: whether to plot the data or not: :type plot_data: bool
- Returns:
A grid with x axis latitudes and y axis heights and for all gridpoints an interpolated value of df
- Return type:
grid (ndarray)
- openairclim.calc_swv.get_volume_matrix(heights, latitudes, delta_h, delta_deg)[source]
A function to get the volume of every box of air in an altitude-latitude graph The heights and latitudes arrays should have a spacing equivalent to the corresponding delta :param heights: a np.array of heights in meters :param latitudes: a np.array of latitudes in degrees :param delta_h: the step between every height in meters :param delta_deg: the step between every latitude in degrees
- Returns (np.array): A matrix of volumes. Rows correspond
to altitude levels, columns to latitudes
- openairclim.calc_swv.plot_alpha_aoa(latitudes, heights, alpha, rounded_aoa)[source]
Plot the alpha distribution as a latitude–pressure heatmap. Plot the alpha distribution as a latitude–pressure contour plot. Plot the rounded age-of-air distribution as a latitude–pressure heatmap.
- Parameters:
latitudes – A 1D array of latitude values in degrees north.
heights – A 1D array of the heights in meters
alpha – A 2D array of alpha values
rounded_aoa – A 2D array of age-of-air values rounded to whole integer years
- Returns:
This function displays a plot and does not return any value.
- Return type:
None
- openairclim.calc_swv.plot_swv_distribution(latitudes, heights, final_swv_distribution)[source]
Plot the SWV distribution as a latitude–pressure heatmap.
- Parameters:
latitudes – A 1D array of latitude values in degrees north.
heights – A 1D array of the heights in meters
final_swv_distribution – A 2D array of SWV distribution values
- Returns:
This function displays a plot and does not return any value.
- Return type:
None