pyLBL package¶
Subpackages¶
- pyLBL.arts_crossfit package
- pyLBL.c_lib package
- pyLBL.mt_ckd package
- Submodules
- pyLBL.mt_ckd.carbon_dioxide module
- pyLBL.mt_ckd.nitrogen module
- pyLBL.mt_ckd.oxygen module
- pyLBL.mt_ckd.ozone module
- pyLBL.mt_ckd.utils module
- pyLBL.mt_ckd.water_vapor module
- Module contents
- pyLBL.pyarts_frontend package
- pyLBL.webapi package
- Submodules
- pyLBL.webapi.hitran_api module
HitranWebApiHitranWebApi.api_keyHitranWebApi.api_versionHitranWebApi.cross_section_directoryHitranWebApi.hostHitranWebApi.parametersHitranWebApi.proxyHitranWebApi.timestampHitranWebApi.transition_directoryHitranWebApi.download_cross_sections()HitranWebApi.download_data_sources()HitranWebApi.download_isotopologues()HitranWebApi.download_molecules()HitranWebApi.download_transitions()
NoCrossSectionErrorNoIsotopologueErrorNoTransitionsErrorQueryStruct
- pyLBL.webapi.tips_api module
- Module contents
Submodules¶
pyLBL.atmosphere module¶
Define how atmospheric inputs are handled.
- class pyLBL.atmosphere.Atmosphere(dataset, mapping=None)[source]¶
Bases:
objectAtmospheric data container with basic data discover methods.
- dataset¶
Input xarray Dataset.
- pressure¶
xarray DataArray object for pressure [Pa].
- temperature¶
xarray DataArray object for temperature [K].
- gases¶
Dictionary of xarray DataArray objects for gas mole fractions [mol mol-1].
pyLBL.database module¶
Manages how the spectral input data is acquired and handled.
- class pyLBL.database.ArtsCrossFitTable(**kwargs)[source]¶
Bases:
BaseArts-crossfit table schema.
- id¶
- molecule_id¶
- path¶
- class pyLBL.database.Database(path, echo=False)[source]¶
Bases:
objectSpectral line parameter database.
- engine¶
SQLAlchemy Engine object.
- arts_crossfit(name)[source]¶
Queries the database for all parameters needed to run ARTS Crossfit.
- Parameters:
name – String molecule alias.
- Returns:
Path to the cross section dataset.
- Raises:
CrossSectionNotFoundError if no cross sections are found. –
- create(hitran_webapi, molecules='all', tips_webapi=None, cross_section_directory='.cross-sections')[source]¶
Downloads data from HITRAN and TIPS and inserts it into the database tables.
- Parameters:
hitran_webapi – HitranWebApi object.
molecules – List of string molecule chemical formulae.
tips_webapi – TipsWebApi object.
cross_section_directory – Directory to download cross sections to.
- gas(name)[source]¶
Queries the database for all parameters needed to run a line-by-line calculation.
- Parameters:
name – String molecule alias.
- Returns:
String chemical formula. mass: List of float isotopologue masses. transitions: List of TransitionTable objects. TotalPartionFunction: TotalPartitionFunction object.
- Return type:
formula
- class pyLBL.database.IsotopologueTable(**kwargs)[source]¶
Bases:
BaseIsotopologue database table schema.
- abundance¶
- id¶
- iso_name¶
- isoid¶
- mass¶
- molecule_id¶
- class pyLBL.database.MetadataTable(**kwargs)[source]¶
Bases:
BaseTable that describes when data was downloaded.
- database¶
- id¶
- molecule_id¶
- time¶
- class pyLBL.database.MoleculeAliasTable(**kwargs)[source]¶
Bases:
BaseMolecule alias database table schema.
- alias¶
- id¶
- molecule¶
- class pyLBL.database.MoleculeTable(**kwargs)[source]¶
Bases:
BaseMolecule database table schema.
- common_name¶
- id¶
- ordinary_formula¶
- stoichiometric_formula¶
- class pyLBL.database.TipsTable(**kwargs)[source]¶
Bases:
BaseTIPS data table schema.
- data¶
- id¶
- isotopologue_id¶
- molecule_id¶
- temperature¶
pyLBL.plugins module¶
Manage the model ‘back-ends’ using a plug-in model.
pyLBL.spectroscopy module¶
Provides a simplified API for calculating molecular line spectra.
- class pyLBL.spectroscopy.MoleculeCache(name, grid, lines_database, lines_engine, continua_engine, cross_sections_engine)[source]¶
Bases:
objectHelper class that caches molecular data so it can be reused.
- cross_section¶
Object controlling the current absorption cross section backend plugin.
- gas¶
Object controlling the current lines backend plugin.
- gas_continua¶
List of objects controlling the curret continua backend plugin.
- class pyLBL.spectroscopy.Spectroscopy(atmosphere, grid, database, mapping=None, lines_backend='pyLBL', continua_backend='mt_ckd', cross_sections_backend='arts_crossfit')[source]¶
Bases:
objectLine-by-line gas optics.
- atmosphere¶
Atmosphere object describing atmospheric conditions.
- cache¶
Dictionary of MoleculeCache objects.
- continua_backend¶
String name of model to use for the continua.
- continua_engine¶
Object exposed by the current molecular continuum backed.
- cross_section_backend¶
String name of model to use for the cross sections.
- cross_section_engine¶
Object exposed by the current cross sections backend.
- grid¶
Numpy array describing the spectral grid [cm-1].
- lines_backend¶
String name of model to use for lines calculation.
- lines_database¶
Database object controlling the spectral database.
- lines_engine¶
Object exposed by the current molecular lines backend.
- output¶
namedtuple object that stores some output dataset metadata.
- compute_absorption(output_format='all', remove_pedestal=None)[source]¶
- Computes absorption coefficient [m-1] at specified wavenumbers given temperature,
pressure, and gas concentrations.
- Parameters:
output_format –
String describing how the absorption data should be output. “all” - returns absorption spectra from all components (lines,
continuum, cross section) for all gases separately.
- ”gas” - returns total absorption spectra for all gases
separately.
”total” - returns the total spectra.
remove_pedestal – Flag that allows the user to not subtract off the MT-CKD water vapor “pedestal” if desired.
- Returns:
An xarray Dataset of absorption coefficients [m-1].
pyLBL.tips module¶
Controls the TIPS (total internal partition function) calculations.
- class pyLBL.tips.TotalPartitionFunction(molecule, temperature, data)[source]¶
Bases:
objectTotal partition function, using data from TIPS 2017 (doi: 10.1016/j.jqsrt.2017.03.045).
- data¶
Numpy array of total partition function values (isotopologue, temperature).
- molecule¶
String molecule chemical formula.
- temperature¶
Numpy array of temperatures [K].
- property isotopologue¶
