ARTS  2.3.1285(git:92a29ea9-dirty)
absorption.cc File Reference

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 SpeciesRecordSpeciesDataOfBand (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...
 

Detailed Description

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.

Author
Stefan Buehler and Axel von Engeln

Definition in file absorption.cc.

Function Documentation

◆ checkIsotopologueRatios()

void checkIsotopologueRatios ( const ArrayOfArrayOfSpeciesTag abs_species,
const SpeciesAuxData isoratios 
)

◆ checkPartitionFunctions()

void checkPartitionFunctions ( const ArrayOfArrayOfSpeciesTag abs_species,
const SpeciesAuxData partfun 
)

◆ fillSpeciesAuxDataWithIsotopologueRatiosFromSpeciesData()

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().

◆ fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData()

void fillSpeciesAuxDataWithPartitionFunctionsFromSpeciesData ( SpeciesAuxData sad)

◆ operator<<() [1/2]

ostream& operator<< ( ostream &  os,
const SpeciesRecord sr 
)

Output operator for SpeciesRecord.

Incomplete version: only writes SpeciesName.

Author
Jana Mendrok

Definition at line 467 of file absorption.cc.

References SpeciesRecord::Isotopologue(), SpeciesRecord::Name(), and Array< base >::nelem().

◆ operator<<() [2/2]

◆ set_vmr_from_first_species()

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.

Author
Oliver Lemke
Parameters
[out]vmrVolume mixing ratio
[in]species_nameSpecies Name
[in]abs_speciesWS Input
[in]abs_vmrsWS 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().

◆ species_index_from_species_name()

◆ species_name_from_species_index()

String species_name_from_species_index ( const Index  spec_ind)

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.

Parameters
[in]spec_indSpecies index.
Returns
Species name
Author
Stefan Buehler
Date
2013-01-04

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().

◆ SpeciesDataOfBand()

const SpeciesRecord& SpeciesDataOfBand ( const AbsorptionLines band)

Returns the species data.

Parameters
bandAn absorption band
Returns
const ref to the species record

Definition at line 611 of file absorption.cc.

References Absorption::Lines::Species(), and global_data::species_data.

Referenced by abs_lines_per_speciesCreateFromLines().

◆ wavenumber_to_joule()

Numeric wavenumber_to_joule ( Numeric  e)

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.

Returns
Energy in J.
Parameters
[in]eEnergy in cm^-1.
Author
Stefan Buehler
Date
2001-06-26

Definition at line 500 of file absorption.cc.

◆ xsec_species()

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.

Parameters
[in,out]xsecCross section of one tag group. This is now the true attenuation cross section in units of m^2.
[in,out]sourceCrosssection of one tag group. This is now the true source cross section in units of m^2.
[in,out]phaseCross section of one tag group. This is now the true phase cross section in units of m^2.
[in,out]dxsecPartial derivatives of xsec.
[in,out]dsourcePartial derivatives of source.
[in,out]dphasePartial derivatives of phase.
[in]jacobian_quantitiesAs WSV
[in]jacobian_propmat_positionsPositions in jacobian_quantities affected by propmat calculations
[in]f_gridAs WSV
[in]abs_pAs WSV
[in]abs_tAs WSV
[in]abs_nlteAs WSV
[in]abs_vmrsAs WSV
[in]abs_speciesAs WSV
[in]bandA single absorption band
[in]isot_ratioIsotopologue ratio of this species
[in]partfun_typePartition function type for this species
[in]partfun_dataPartition function model data for this species
Author
Richard Larsson
Date
2019-10-10

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().