ARTS
2.3.1285(git:92a29ea9-dirty)
|
Physical absorption routines. More...
#include "absorption.h"
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <cstdlib>
#include <map>
#include "arts.h"
#include "auto_md.h"
#include "file.h"
#include "interpolation_poly.h"
#include "linescaling.h"
#include "logic.h"
#include "math_funcs.h"
#include "messages.h"
#include "global_data.h"
#include "linefunctions.h"
Go to the source code of this file.
Functions | |
void | checkIsotopologueRatios (const ArrayOfArrayOfSpeciesTag &abs_species, const SpeciesAuxData &isoratios) |
Check that isotopologue ratios for the given species are correctly defined. More... | |
void | checkPartitionFunctions (const ArrayOfArrayOfSpeciesTag &abs_species, const SpeciesAuxData &partfun) |
Check that partition functions for the given species are correctly defined. More... | |
void | fillSpeciesAuxDataWithIsotopologueRatiosFromSpeciesData (SpeciesAuxData &sad) |
Fill SpeciesAuxData with default isotopologue ratios from species data. More... | |
void | fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData (SpeciesAuxData &sad) |
Fill SpeciesAuxData with default partition functions from species data. More... | |
ostream & | operator<< (ostream &os, const SpeciesRecord &sr) |
Output operator for SpeciesRecord. More... | |
ostream & | operator<< (ostream &os, const SpeciesAuxData &sad) |
Output operator for SpeciesAuxData. More... | |
Numeric | wavenumber_to_joule (Numeric e) |
A little helper function to convert energy from units of wavenumber (cm^-1) to Joule (J). More... | |
Index | species_index_from_species_name (String name) |
Return species index for given species name. More... | |
String | species_name_from_species_index (const Index spec_ind) |
Return species name for given species index. More... | |
void | set_vmr_from_first_species (Vector &vmr, const String &species_name, const ArrayOfArrayOfSpeciesTag &abs_species, const Matrix &abs_vmrs) |
set_abs_from_first_species. More... | |
const SpeciesRecord & | SpeciesDataOfBand (const AbsorptionLines &band) |
Returns the species data. More... | |
void | xsec_species (Matrix &xsec, Matrix &source, Matrix &phase, ArrayOfMatrix &dxsec_dx, ArrayOfMatrix &dsource_dx, ArrayOfMatrix &dphase_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const ArrayOfIndex &jacobian_propmat_positions, const Vector &f_grid, const Vector &abs_p, const Vector &abs_t, const EnergyLevelMap &abs_nlte, const Matrix &abs_vmrs, const ArrayOfArrayOfSpeciesTag &abs_species, const AbsorptionLines &band, const Numeric &isot_ratio, const SpeciesAuxData::AuxType &partfun_type, const ArrayOfGriddedField1 &partfun_data) |
Cross-section algorithm. More... | |
Physical absorption routines.
The absorption workspace methods are in file m_abs.cc
This is the file from arts-1-0, back-ported to arts-1-1.
Definition in file absorption.cc.
void checkIsotopologueRatios | ( | const ArrayOfArrayOfSpeciesTag & | abs_species, |
const SpeciesAuxData & | isoratios | ||
) |
Check that isotopologue ratios for the given species are correctly defined.
Definition at line 301 of file absorption.cc.
References SpeciesAuxData::getParam(), i, iso(), SpeciesRecord::Isotopologue(), SpeciesRecord::Name(), Array< base >::nelem(), SpeciesAuxData::nisotopologues(), SpeciesAuxData::nspecies(), global_data::species_data, and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().
Referenced by lbl_checkedCalc().
void checkPartitionFunctions | ( | const ArrayOfArrayOfSpeciesTag & | abs_species, |
const SpeciesAuxData & | partfun | ||
) |
Check that partition functions for the given species are correctly defined.
Definition at line 356 of file absorption.cc.
References i, SpeciesRecord::Isotopologue(), SpeciesRecord::Name(), Array< base >::nelem(), SpeciesAuxData::nisotopologues(), SpeciesAuxData::nspecies(), global_data::species_data, and _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str().
Referenced by lbl_checkedCalc().
void fillSpeciesAuxDataWithIsotopologueRatiosFromSpeciesData | ( | SpeciesAuxData & | sad | ) |
Fill SpeciesAuxData with default isotopologue ratios from species data.
Definition at line 394 of file absorption.cc.
References SpeciesAuxData::AT_ISOTOPOLOGUE_RATIO, SpeciesAuxData::InitFromSpeciesData(), SpeciesAuxData::setParam(), and global_data::species_data.
Referenced by isotopologue_ratiosInitFromBuiltin().
void fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData | ( | SpeciesAuxData & | sad | ) |
Fill SpeciesAuxData with default partition functions from species data.
Definition at line 417 of file absorption.cc.
References SpeciesAuxData::AT_PARTITIONFUNCTION_COEFF, SpeciesAuxData::InitFromSpeciesData(), ConstVectorView::nelem(), nlinspace(), SpeciesAuxData::setParam(), and global_data::species_data.
Referenced by partition_functionsInitFromBuiltin().
ostream& operator<< | ( | ostream & | os, |
const SpeciesRecord & | sr | ||
) |
Output operator for SpeciesRecord.
Incomplete version: only writes SpeciesName.
Definition at line 467 of file absorption.cc.
References SpeciesRecord::Isotopologue(), SpeciesRecord::Name(), and Array< base >::nelem().
ostream& operator<< | ( | ostream & | os, |
const SpeciesAuxData & | sad | ||
) |
Output operator for SpeciesAuxData.
Definition at line 474 of file absorption.cc.
References SpeciesAuxData::getParam(), SpeciesAuxData::getTypeString(), iso(), Array< base >::nelem(), SpeciesAuxData::nisotopologues(), SpeciesAuxData::nspecies(), global_data::species_data, and species_name_from_species_index().
void set_vmr_from_first_species | ( | Vector & | vmr, |
const String & | species_name, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const Matrix & | abs_vmrs | ||
) |
set_abs_from_first_species.
Returns vmr for the profile of the first tag group containing the given species.
[out] | vmr | Volume mixing ratio |
[in] | species_name | Species Name |
[in] | abs_species | WS Input |
[in] | abs_vmrs | WS Input |
Definition at line 597 of file absorption.cc.
References find_first_species_tg(), joker, ConstMatrixView::ncols(), Vector::resize(), and species_index_from_species_name().
Referenced by abs_xsec_per_speciesAddConts().
Return species index for given species name.
This is useful in connection with other functions that need a species index.
[in] | name | Species name. |
Definition at line 531 of file absorption.cc.
References global_data::SpeciesMap, and my_basic_string< charT >::trim().
Referenced by abs_lookupCalc(), abs_lookupSetup(), abs_lookupSetupBatch(), abs_lookupTestAccMC(), abs_lookupTestAccuracy(), choose_abs_nls(), GasAbsLookup::Extract(), find_nonlinear_continua(), get_lande_spin_constant(), SpeciesTag::IsIsotopologue(), SpeciesTag::IsSpecies(), parse_a1_sym_hitran(), parse_a1_x_hitran(), postprocess_group1_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), refr_index_airMicrowavesEarth(), set_vmr_from_first_species(), QuantumParserHITRAN2004::SetClassGroup(), CIARecord::SetMoleculeName(), SpeciesTag::SpeciesTag(), test_K1_and_K2(), test_partitionfunction(), xml_read_from_stream(), and z_fieldFromHSE().
Return species name for given species index.
This is useful in connection with other functions that use a species index.
Does an assertion that the index really corresponds to a species.
[in] | spec_ind | Species index. |
Definition at line 569 of file absorption.cc.
References global_data::species_data.
Referenced by abs_cia_dataReadFromCIA(), abs_cia_dataReadFromXML(), get_species_name(), CIARecord::MoleculeName(), SpeciesTag::Name(), operator<<(), XsecRecord::SpeciesName(), QuantumIdentifier::SpeciesName(), and SpeciesTag::SpeciesNameMain().
const SpeciesRecord& SpeciesDataOfBand | ( | const AbsorptionLines & | band | ) |
Returns the species data.
band | An absorption band |
Definition at line 611 of file absorption.cc.
References Absorption::Lines::Species(), and global_data::species_data.
Referenced by abs_lines_per_speciesCreateFromLines().
A little helper function to convert energy from units of wavenumber (cm^-1) to Joule (J).
This is used when reading HITRAN or JPL catalogue files, which have the lower state energy in cm^-1.
[in] | e | Energy in cm^-1. |
Definition at line 500 of file absorption.cc.
void xsec_species | ( | Matrix & | xsec, |
Matrix & | source, | ||
Matrix & | phase, | ||
ArrayOfMatrix & | dxsec_dx, | ||
ArrayOfMatrix & | dsource_dx, | ||
ArrayOfMatrix & | dphase_dx, | ||
const ArrayOfRetrievalQuantity & | jacobian_quantities, | ||
const ArrayOfIndex & | jacobian_propmat_positions, | ||
const Vector & | f_grid, | ||
const Vector & | abs_p, | ||
const Vector & | abs_t, | ||
const EnergyLevelMap & | abs_nlte, | ||
const Matrix & | abs_vmrs, | ||
const ArrayOfArrayOfSpeciesTag & | abs_species, | ||
const AbsorptionLines & | band, | ||
const Numeric & | isot_ratio, | ||
const SpeciesAuxData::AuxType & | partfun_type, | ||
const ArrayOfGriddedField1 & | partfun_data | ||
) |
Cross-section algorithm.
[in,out] | xsec | Cross section of one tag group. This is now the true attenuation cross section in units of m^2. |
[in,out] | sourceCross | section of one tag group. This is now the true source cross section in units of m^2. |
[in,out] | phase | Cross section of one tag group. This is now the true phase cross section in units of m^2. |
[in,out] | dxsec | Partial derivatives of xsec. |
[in,out] | dsource | Partial derivatives of source. |
[in,out] | dphase | Partial derivatives of phase. |
[in] | jacobian_quantities | As WSV |
[in] | jacobian_propmat_positions | Positions in jacobian_quantities affected by propmat calculations |
[in] | f_grid | As WSV |
[in] | abs_p | As WSV |
[in] | abs_t | As WSV |
[in] | abs_nlte | As WSV |
[in] | abs_vmrs | As WSV |
[in] | abs_species | As WSV |
[in] | band | A single absorption band |
[in] | isot_ratio | Isotopologue ratio of this species |
[in] | partfun_type | Partition function type for this species |
[in] | partfun_data | Partition function model data for this species |
Definition at line 616 of file absorption.cc.
References Absorption::Lines::BroadeningSpeciesVMR(), Linefunctions::dDopplerConstant_dT(), Linefunctions::InternalData::dF, Linefunctions::InternalData::dN, Linefunctions::DopplerConstant(), dsingle_partition_function_dT(), ConstMatrixView::empty(), Linefunctions::InternalData::F, joker, MapToEigen(), Linefunctions::InternalData::N, Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), Absorption::Lines::NumLines(), Linefunctions::set_cross_section_of_band(), single_partition_function(), Absorption::Lines::SpeciesMass(), Absorption::Lines::T0(), and temperature_perturbation().
Referenced by abs_xsec_per_speciesAddLines().