sasktran2.optical.XsecAbsorber#
- class sasktran2.optical.XsecAbsorber(source: str | Path | list[str] | list[Path])[source]#
Bases:
OpticalPropertyCross section absorber loaded from HITRAN fixed-width format files.
This absorber loads cross section data from .xsc files and performs interpolation in temperature (linear) and uses the nearest pressure level. Wavenumber interpolation uses zero padding outside the available range.
- Parameters:
source (str or list of str or Path) – Can be: - Path to a single .xsc file - Path to a folder containing .xsc files - List of paths to .xsc files
Examples
Load from a folder:
>>> absorber = XsecAbsorber("/path/to/hitran/xsec/CCl4")
Load from a single file:
>>> absorber = XsecAbsorber("/path/to/hitran/xsec/CCl4_v1.xsc")
Load from multiple files:
>>> absorber = XsecAbsorber(["/path/to/file1.xsc", "/path/to/file2.xsc"])
Methods
__init__(source)atmosphere_quantities(atmo, **kwargs)Calculate optical quantities for a given atmosphere.
cross_section_derivatives(wavelengths_nm, ...)cross_sections(wavelengths_nm, altitudes_m, ...)from_lbl_database(species_name)Load cross sections from the LBLRTM database for a given species.
optical_derivatives(atmo, **kwargs)Calculate optical derivatives for a given atmosphere.
- atmosphere_quantities(atmo, **kwargs)[source]#
Calculate optical quantities for a given atmosphere.
- Parameters:
atmo (Atmosphere) – Atmosphere object containing temperature and pressure profiles
**kwargs – Must include wavenumbers_cminv as an array
- Returns:
Object containing cross sections and other optical properties
- Return type:
OpticalQuantities
- classmethod from_lbl_database(species_name: str) XsecAbsorber[source]#
Load cross sections from the LBLRTM database for a given species.
This method reads the FSCDXS index file to determine which cross section files to load for the requested species, then loads them.
- Parameters:
species_name (str) –
Name of the species. Case insensitive.
Supported species: ACET, ACETICACI, BRO, C2CL2F4 (F114), C2CL3F3 (F113), C2CLF5 (F115), C2F6, C2HCl2F3CF2, CCL2FCH3, CCL4, CCLF3 (F13), CF3CH2CF3, CF3CH3, CF4 (F14), CFH2CF3, CH2F2, CH3CCLF2, CH3CHF2, CH3CN, CHCl2C2F5, CHCl2CF3, CHCL2F, CHClF2, CHClFCF3, CHF2CF3, CHF2CH2CF3, CHF3, CLONO2, F11, F12, FURAN, GLYCOLALD, HCHO, HNO3, HNO4, ISOP, N2O5, NF3, NO2, PAN, PROPENE, SF6, SO2
- Returns:
XsecAbsorber instance with the loaded cross section data
- Return type:
- Raises:
ValueError – If the species name is not found in the LBLRTM database
Examples
>>> absorber = XsecAbsorber.from_lbl_database('CCL4') >>> absorber = XsecAbsorber.from_lbl_database('HNO3') >>> absorber = XsecAbsorber.from_lbl_database('f11') # Case insensitive
- optical_derivatives(atmo, **kwargs)[source]#
Calculate optical derivatives for a given atmosphere.
- Parameters:
atmo (Atmosphere) – Atmosphere object containing temperature and pressure profiles
**kwargs – Must include wavenumbers_cminv as an array
- Returns:
Dictionary with “temperature_k” key containing temperature derivatives
- Return type: