1 gaseous_absorption

gaseous_absorption

1.1 Functions

Name Description
create_gaseous_abs Create a high-resolution gaseous absorption model DataTree and write to NetCDF.
get_abs_data_hires Generate high-resolution gaseous absorption transmission at unit air mass
get_absorption Read absorption cross-section data for a given gas.
get_climate_data Download NO₂ climatology climate data files from the Hygeos server.
get_file_gatiab Return the path to a GATIAB optical-depth spectrum NetCDF file.
get_gaseous_abs Load a DataTree of high-resolution absorption models for gases.
transmission_model Determine transmission model (Teq, n) for each gas , for a given srf
transmission_model_eval Evaluate the transmission model returned by transmission_model_srf, at provided x
transmission_model_single Determine transmission model (Teq, n) for a given srf (for a single band)
write_coeffs_uint16_netcdf Pack numeric coefficient variables into uint16 and write to NetCDF.

1.1.1 create_gaseous_abs

gaseous_absorption.create_gaseous_abs(filename)

Create a high-resolution gaseous absorption model DataTree and write to NetCDF.

For each gas in gas_list_gatiab, computes high-resolution transmission data at unit air mass and nominal gas content via :func:get_abs_data_hires, then packs the coefficients into uint16 and writes a single NetCDF file.

1.1.1.1 Parameters

Name Type Description Default
filename Path Output NetCDF file path. The parent directory will be created if it does not exist. required

1.1.1.2 Raises

Name Type Description
ValueError If wavelength coordinates are inconsistent across gas datasets.

1.1.2 get_abs_data_hires

gaseous_absorption.get_abs_data_hires(gas, afglmod='afglus')

Generate high-resolution gaseous absorption transmission at unit air mass and nominal gas content.

Returns a gaseous transmission value per wavelength, computed for: - Air mass M = 1.0 (zenith path) - Nominal gas content U = U0 (from GATIAB)

1.1.2.1 Parameters

Name Type Description Default
gas str Gas species identifier. Must be one of the GATIAB-supported gases: [‘CH4’, ‘CO2’, ‘H2O’, ‘N2’, ‘N2O’, ‘O2’, ‘O3’] required
afglmod str Atmospheric model to use, by default ‘afglus’ 'afglus'

1.1.2.2 Returns

Name Type Description
xr.Dataset Dataset with a single 1-D T1 variable over the wav dimension (wavelength in nm), plus scalar U0 and P0.

1.1.3 get_absorption

gaseous_absorption.get_absorption(gaz, dirname=None)

Read absorption cross-section data for a given gas.

Downloads (if necessary) and parses a tabular text file that contains wavelength-dependent absorption values for the requested gas species. The metadata (URL, skip-rows, etc.) is looked up in absorption_MTL.csv.

1.1.3.1 Parameters

Name Type Description Default
gaz str Gas species identifier (e.g. “O3”, “NO2”). Must match a gaz entry in the absorption metadata file. required
dirname str, Path, or None Directory in which to cache the downloaded file. Defaults to DIR_STATIC/common. None

1.1.3.2 Returns

Name Type Description
xr.DataArray 1-D array of absorption values with a wav coordinate (nm).

1.1.4 get_climate_data

gaseous_absorption.get_climate_data(dirname)

Download NO₂ climatology climate data files from the Hygeos server.

Fetches two HDF files: - no2_climatology.hdf — NO₂ climatology data - trop_f_no2_200m.hdf — tropospheric NO₂ factor at 200 m resolution

1.1.4.1 Parameters

Name Type Description Default
dirname str or Path Directory where the files will be downloaded. required

1.1.5 get_file_gatiab

gaseous_absorption.get_file_gatiab(gas, afglmod='afglus')

Return the path to a GATIAB optical-depth spectrum NetCDF file.

1.1.5.1 Parameters

Name Type Description Default
gas str Gas species identifier. Must be one of gas_list_gatiab: [‘CH4’, ‘CO2’, ‘H2O’, ‘N2’, ‘N2O’, ‘O2’, ‘O3’]. required
afglmod str Atmospheric profile model directory name, by default ‘afglus’. 'afglus'

1.1.5.2 Returns

Name Type Description
Path Absolute path to the optical-depth spectrum file.

1.1.6 get_gaseous_abs

gaseous_absorption.get_gaseous_abs()

Load a DataTree of high-resolution absorption models for gases.

The root dataset stores the common wav coordinate, and each gas is added as a child node containing fitted coefficients (without duplicating wav).

1.1.6.1 Returns

Name Type Description
xr.DataTree A tree with one child dataset per gas in gas_list_gatiab. Each Dataset holds a variable T1.

1.1.7 transmission_model

gaseous_absorption.transmission_model(srf, x0=5.0)

Determine transmission model (Teq, n) for each gas , for a given srf T(lam) = Teq(xn) where x = M*U/U0

The model is fitted by evaluating the integrated transmission and its derivative at x = x0.

1.1.7.1 Parameters

Name Type Description Default
srf xr.Dataset Spectral response functions for all bands required
x0 float Reference value of x = M*U/U0 at which to evaluate the derivative for fitting n 5.0

1.1.7.2 Returns

Name Type Description
xr.DataTree DataTree with root having ‘bands’ coordinate, and each gas node containing ‘Teq’ and ‘n’ variables for each band

1.1.8 transmission_model_eval

gaseous_absorption.transmission_model_eval(mod, x)

Evaluate the transmission model returned by transmission_model_srf, at provided x values.

1.1.9 transmission_model_single

gaseous_absorption.transmission_model_single(T, srf_band, x0=5.0)

Determine transmission model (Teq, n) for a given srf (for a single band) T(lam) = Teq(xn) where x = M*U/U0

The model is fitted by evaluating the integrated transmission and its derivative at x = x0.

1.1.9.1 Parameters

Name Type Description Default
T xr.DataArray High-resolution transmission spectrum T(lambda) required
srf_band xr.DataArray Spectral response function for the band required
x0 float Reference value of x = M*U/U0 at which to evaluate the derivative for fitting n 2.0

1.1.9.2 Returns

Name Type Description
tuple (Teq, n) where Teq is the equivalent transmission at x=1, and n is the exponent

1.1.10 write_coeffs_uint16_netcdf

gaseous_absorption.write_coeffs_uint16_netcdf(
    coeffs,
    filename,
    *,
    engine='h5netcdf',
)

Pack numeric coefficient variables into uint16 and write to NetCDF.

Numeric variables are stored with dtype=uint16 using scale_factor and add_offset so values are approximately preserved on read. Non-numeric variables are written without packing.

1.1.10.1 Parameters

Name Type Description Default
coeffs xr.DataTree Coefficient tree to write. Packing is applied independently to each node dataset. required
filename str | Path Output NetCDF path. required
engine str NetCDF backend engine passed to xarray. "h5netcdf"

1.1.10.2 Returns

Name Type Description
Path Path to written NetCDF file.