ARTS 2.5.4 (git: 31ce4f0e)
Absorption::LineMixing Namespace Reference

Namespaces

namespace  LinearRovibErrorCorrectedSudden
 Generic interface for ECS calculations.
 
namespace  Makarov2020etal
 

Classes

struct  EcsReturn
 
struct  EquivalentLines
 Contains recomputed equivalent lines (sorting is unknown) More...
 
struct  ErrorCorrectedSuddenData
 Rovibrational line mixing data following the ideas of Collisional Effects On Molecular Spectra by J. More...
 
struct  MapOfErrorCorrectedSuddenData
 
struct  PopulationAndDipole
 Contains the population distribution and dipole. More...
 
struct  SpeciesErrorCorrectedSuddenData
 

Typedefs

using EnergyFunction = std::function< Numeric(const Rational)>
 
using ArrayOfSpeciesErrorCorrectedSuddenData = Array< SpeciesErrorCorrectedSuddenData >
 

Functions

std::ostream & operator<< (std::ostream &os, const EquivalentLines &eqv)
 
std::ostream & operator<< (std::ostream &os, const SpeciesErrorCorrectedSuddenData &srbd)
 
std::istream & operator>> (std::istream &is, SpeciesErrorCorrectedSuddenData &srbd)
 
std::pair< ArrayOfIndex, PopulationAndDipolesorted_population_and_dipole (const Numeric T, const AbsorptionLines &band)
 
PopulationAndDipole presorted_population_and_dipole (const Numeric T, const ArrayOfIndex &presorting, const AbsorptionLines &band)
 
ComplexMatrix single_species_ecs_relaxation_matrix (const AbsorptionLines &band, const ArrayOfIndex &sorting, const Numeric T, const Numeric P, const SpeciesErrorCorrectedSuddenData &species_ecs_data, const Index species_pos)
 
ComplexMatrix ecs_relaxation_matrix (const Numeric T, const Numeric P, const Vector &vmrs, const ErrorCorrectedSuddenData &ecs_data, const AbsorptionLines &band, const ArrayOfIndex &sorting, const Numeric frenorm)
 
std::pair< ComplexVector, bool > ecs_absorption_impl (const Numeric T, const Numeric H, const Numeric P, const Numeric this_vmr, const Vector &vmrs, const ErrorCorrectedSuddenData &ecs_data, const Vector &f_grid, const Zeeman::Polarization zeeman_polarization, const AbsorptionLines &band)
 
EcsReturn ecs_absorption (const Numeric T, const Numeric H, const Numeric P, const Numeric this_vmr, const Vector &vmrs, const ErrorCorrectedSuddenData &ecs_data, const Vector &f_grid, const Zeeman::Polarization zeeman_polarization, const AbsorptionLines &band, const ArrayOfRetrievalQuantity &jacobian_quantities)
 
Index band_eigenvalue_adaptation (AbsorptionLines &band, const Tensor4 &tempdata, const Vector &temperatures, const Numeric P0, const Index ord)
 Adapts the band to the temperature data. More...
 
Vector RosenkranzY (const Vector &dip, const ConstMatrixView &W, const AbsorptionLines &band)
 
Vector RosenkranzG (const Vector &dip, const ConstMatrixView &W, const AbsorptionLines &band)
 
Vector RosenkranzDV (const Vector &dip, const ConstMatrixView &W, const AbsorptionLines &band)
 
EquivalentLines eigenvalue_adaptation_of_relmat (const ComplexMatrix &W, const Vector &pop, const Vector &dip, const AbsorptionLines &band, const Numeric frenorm, const Numeric T, const Numeric P, const Numeric QT, const Numeric QT0, const Index broadener)
 Adapts the relaxation matrix eigenvalues to a form where they represent additions towards the three Rosenkranz parameters and the 3rd order pressure broadening term. More...
 
Tensor4 ecs_eigenvalue_approximation (const AbsorptionLines &band, const Vector &temperatures, const ErrorCorrectedSuddenData &ecs_data, const Numeric P)
 
Tensor4 rosenkranz_approximation (const AbsorptionLines &band, const Vector &temperatures, const ErrorCorrectedSuddenData &ecs_data, const Numeric P)
 
void ecs_eigenvalue_adaptation (AbsorptionLines &band, const Vector &temperatures, const ErrorCorrectedSuddenData &ecs_data, const Numeric P0, const Index ord, const bool robust, const bool rosenkranz_adaptation, const Verbosity &verbosity)
 
Tensor5 ecs_eigenvalue_adaptation_test (const AbsorptionLines &band, const Vector &temperatures, const ErrorCorrectedSuddenData &ecs_data, const Vector &pressures)
 
std::ostream & operator<< (std::ostream &os, const ErrorCorrectedSuddenData &rbd)
 
std::istream & operator>> (std::istream &is, ErrorCorrectedSuddenData &rbd)
 
std::ostream & operator<< (std::ostream &os, const MapOfErrorCorrectedSuddenData &m)
 

Typedef Documentation

◆ ArrayOfSpeciesErrorCorrectedSuddenData

◆ EnergyFunction

using Absorption::LineMixing::EnergyFunction = typedef std::function<Numeric (const Rational)>

Definition at line 70 of file linemixing.h.

Function Documentation

◆ band_eigenvalue_adaptation()

Index Absorption::LineMixing::band_eigenvalue_adaptation ( AbsorptionLines band,
const Tensor4 tempdata,
const Vector temperatures,
const Numeric  P0,
const Index  ord 
)

◆ ecs_absorption()

EcsReturn Absorption::LineMixing::ecs_absorption ( const Numeric  T,
const Numeric  H,
const Numeric  P,
const Numeric  this_vmr,
const Vector vmrs,
const ErrorCorrectedSuddenData ecs_data,
const Vector f_grid,
const Zeeman::Polarization  zeeman_polarization,
const AbsorptionLines band,
const ArrayOfRetrievalQuantity jacobian_quantities = {} 
)

Computed the Error Corrected Sudden Complex absorption with Zeeman effect perturbations

Note that Zeeman perturbations are only applied after the ECS computations, and only if zeeman_polarization is not None

Parameters
[in]TThe temperature
[in]PThe pressure
[in]this_vmrThe VMR of this species
[in]vmrsThe VMRs of all broadeners of the absorption band
[in]massThe mass of all broadeners of the absorption band
[in]f_gridThe grid of frequencies
[in]zeeman_polarizationThe Zeeman polarization to consider
[in]bandThe absorption band
Returns
Complex absorption of the Zeeman component

Definition at line 763 of file linemixing.cc.

References ARTS_USER_ERROR_IF, Absorption::Lines::bathbroadening, Absorption::Lines::broadeningspecies, Absorption::Lines::BroadeningSpeciesPosition(), d, dabs, Absorption::Lines::DoVmrDerivative(), Constant::e, ecs_absorption_impl(), Absorption::Lines::Isotopologue(), Absorption::Lines::lines, Array< base >::nelem(), Absorption::Lines::NumLines(), Absorption::LineMixing::ErrorCorrectedSuddenData::pos(), Absorption::Lines::quantumidentity, Absorption::Lines::selfbroadening, Absorption::LineMixing::ErrorCorrectedSuddenData::size(), Jacobian::Temperature, and LineShape::vmrs().

Referenced by propmat_clearskyAddOnTheFlyLineMixing(), and propmat_clearskyAddOnTheFlyLineMixingWithZeeman().

◆ ecs_absorption_impl()

◆ ecs_eigenvalue_adaptation()

void Absorption::LineMixing::ecs_eigenvalue_adaptation ( AbsorptionLines band,
const Vector temperatures,
const ErrorCorrectedSuddenData ecs_data,
const Numeric  P0,
const Index  ord,
const bool  robust,
const bool  rosenkranz_adaptation,
const Verbosity verbosity 
)

Adapts the band to use Rosenkranz parameters from Eigenvalue decomposition

Fits will be of form:

Y ~ P * polyfit(x, y, LineShape::ModelParameters::N - 1) DV ~ P ** 2 * polyfit(x, dv, LineShape::ModelParameters::N - 1) G ~ P ** 2 * polyfit(x, g, LineShape::ModelParameters::N - 1) DG ~ P ** 3 * polyfit(x, dg, LineShape::ModelParameters::N - 1)

where all the values are computed at P0 but re-normalized by the order above

Note that these parameters will fail at high pressures

Parameters
[in]bandThe absorption band
[in]temperaturesThe temperature grid for fitting parameters upon
[in]massThe mass of all broadeners of the absorption band
[in]P0The pressure at which temperature dependencies are computed at
[in]ordThe order of the parameters [1: Y; 2: Y, DF, G; 3: Y, DF, G, DG], the last is still not supported fully
[in]robustDoesn't throw on failure if true
[in]rosenkranz_adaptationMakes the explicit computation of Rosenkranz parameters
[in]verbosityAs WSM
Returns
EXIT_FAILURE when some parameterization fit fails
EXIT_SUCCESS if all algorithms worked (independent of if the absorption will be reasonable)

Definition at line 1452 of file linemixing.cc.

References ARTS_USER_ERROR_IF, band_eigenvalue_adaptation(), CREATE_OUT3, ecs_eigenvalue_approximation(), is_sorted(), Absorption::Lines::lines, Absorption::Lines::normalization, Absorption::Lines::population, Absorption::Lines::quantumidentity, and rosenkranz_approximation().

Referenced by abs_linesAdaptOnTheFlyLineMixing().

◆ ecs_eigenvalue_adaptation_test()

Tensor5 Absorption::LineMixing::ecs_eigenvalue_adaptation_test ( const AbsorptionLines band,
const Vector temperatures,
const ErrorCorrectedSuddenData ecs_data,
const Vector pressures 
)

Outputs the adaptation values used for ecs_eigenvalue_adaptation but as a function of pressure. ecs_eigenvalue_adaptation makes strong assumptions about the pressure order of the outputs used, and if this work for a given band can be found out using this data

Parameters
[in]bandThe absorption band [N lines]
[in]temperaturesThe temperature grid for fitting parameters upon [K temperatures]
[in]massThe mass of all broadeners of the absorption band [M broadeners]
[in]pressuresThe pressures for testing [L pressures]
Returns
Tensor with size [4, N, M, K, L]

Definition at line 1500 of file linemixing.cc.

References ecs_eigenvalue_approximation(), joker, Interpolation::l(), M, N, ConstVectorView::nelem(), Absorption::Lines::NumBroadeners(), Absorption::Lines::NumLines(), and ConstVectorView::size().

◆ ecs_eigenvalue_approximation()

Tensor4 Absorption::LineMixing::ecs_eigenvalue_approximation ( const AbsorptionLines band,
const Vector temperatures,
const ErrorCorrectedSuddenData ecs_data,
const Numeric  P 
)

Computes the Eigenvalue adaptation values

The output is sorted based on frequency. If pressure shifts moves one line's frequency past another, this introduces errors. This is uncommon but happens more easily at higher pressures.

If this happens, the output of this function is not usable, but no safe-guards are in place to guard against this.

Parameters
[in]bandThe absorption band [N lines]
[in]temperaturesThe temperature grid for fitting parameters upon [K temperatures]
[in]massThe mass of all broadeners of the absorption band [M broadeners]
Returns
Eigenvalue line mixing parameters

Definition at line 1351 of file linemixing.cc.

References Absorption::Lines::broadeningspecies, eigenvalue_adaptation_of_relmat(), Absorption::Lines::F_mean(), Absorption::Lines::Isotopologue(), joker, Constant::k, Absorption::Lines::lines, M, N, ConstVectorView::nelem(), Absorption::Lines::NumBroadeners(), Absorption::Lines::NumLines(), presorted_population_and_dipole(), single_partition_function(), single_species_ecs_relaxation_matrix(), sorted_population_and_dipole(), and Absorption::Lines::T0.

Referenced by ecs_eigenvalue_adaptation(), and ecs_eigenvalue_adaptation_test().

◆ ecs_relaxation_matrix()

ComplexMatrix Absorption::LineMixing::ecs_relaxation_matrix ( const Numeric  T,
const Numeric  P,
const Vector vmrs,
const ErrorCorrectedSuddenData ecs_data,
const AbsorptionLines band,
const ArrayOfIndex sorting,
const Numeric  frenorm 
)

Computes the Error Corrected Sudden relaxation matrix

Parameters
[in]TThe temperature
[in]PThe pressure
[in]vmrsThe VMRs of all broadeners of the absorption band
[in]massThe mass of all broadeners of the absorption band
[in]bandThe absorption band
[in]sortingThe sorting of the band
[in]frenormThe renormalization of frequency
Returns
The relaxation matrix

Definition at line 660 of file linemixing.cc.

References Absorption::Lines::broadeningspecies, Constant::k, Absorption::Lines::lines, M, matpack::eigen::mat(), N, ConstVectorView::nelem(), Absorption::Lines::NumLines(), real_val(), single_species_ecs_relaxation_matrix(), and LineShape::vmrs().

Referenced by ecs_absorption_impl().

◆ eigenvalue_adaptation_of_relmat()

EquivalentLines Absorption::LineMixing::eigenvalue_adaptation_of_relmat ( const ComplexMatrix W,
const Vector pop,
const Vector dip,
const AbsorptionLines band,
const Numeric  frenorm,
const Numeric  T,
const Numeric  P,
const Numeric  QT,
const Numeric  QT0,
const Index  broadener 
)

Adapts the relaxation matrix eigenvalues to a form where they represent additions towards the three Rosenkranz parameters and the 3rd order pressure broadening term.

The EquivalentLines are sorted by the real part of the val-component. At a sufficiently small pressure, this is equivalent to sorting by line frequency. At higher pressures, the sorting might be wrong

The output is adapted to fit into standard LBL calculations assuming that the pressure-sorting works. This happens via an adaptation so that

X = val - Complex(F0 + D0(T), G0(T)) Y = str / I(T) - 1

are the two return values, where val and str are the output of the standard constructor of EquivalentLines.

Definition at line 1282 of file linemixing.cc.

References Constant::h, Constant::k, Absorption::Lines::lines, Absorption::Lines::NumLines(), LineShape::LocalThermodynamicEquilibrium::S, ConstVectorView::size(), Absorption::LineMixing::EquivalentLines::sort_by_frequency(), Absorption::LineMixing::EquivalentLines::str, swap(), Absorption::Lines::T0, and Absorption::LineMixing::EquivalentLines::val.

Referenced by ecs_eigenvalue_approximation(), and lm_hitran_2017::hitran_lm_eigenvalue_approximation().

◆ operator<<() [1/4]

std::ostream & Absorption::LineMixing::operator<< ( std::ostream &  os,
const EquivalentLines eqv 
)

Definition at line 128 of file linemixing.cc.

◆ operator<<() [2/4]

std::ostream & Absorption::LineMixing::operator<< ( std::ostream &  os,
const ErrorCorrectedSuddenData rbd 
)

Definition at line 1516 of file linemixing.cc.

◆ operator<<() [3/4]

std::ostream & Absorption::LineMixing::operator<< ( std::ostream &  os,
const MapOfErrorCorrectedSuddenData m 
)

Definition at line 1570 of file linemixing.cc.

◆ operator<<() [4/4]

std::ostream & Absorption::LineMixing::operator<< ( std::ostream &  os,
const SpeciesErrorCorrectedSuddenData srbd 
)

Definition at line 137 of file linemixing.cc.

◆ operator>>() [1/2]

std::istream & Absorption::LineMixing::operator>> ( std::istream &  is,
ErrorCorrectedSuddenData rbd 
)

Definition at line 1525 of file linemixing.cc.

◆ operator>>() [2/2]

std::istream & Absorption::LineMixing::operator>> ( std::istream &  is,
SpeciesErrorCorrectedSuddenData srbd 
)

Definition at line 147 of file linemixing.cc.

◆ presorted_population_and_dipole()

PopulationAndDipole Absorption::LineMixing::presorted_population_and_dipole ( const Numeric  T,
const ArrayOfIndex presorting,
const AbsorptionLines band 
)

Returns pre-sorted population distribtions and dipoles

Parameters
[in]TThe temperature
[in]presortingChanges positions from [0 ... N-1] to presorting positions
[in]bandThe absorption band
Returns
Pre-sorted population distribtions and dipoles

Definition at line 259 of file linemixing.cc.

References Absorption::LineMixing::PopulationAndDipole::sort().

Referenced by ecs_eigenvalue_approximation(), and rosenkranz_approximation().

◆ rosenkranz_approximation()

Tensor4 Absorption::LineMixing::rosenkranz_approximation ( const AbsorptionLines band,
const Vector temperatures,
const ErrorCorrectedSuddenData ecs_data,
const Numeric  P 
)

Computes the Eigenvalue adaptation values

The output is sorted based on frequency. If pressure shifts moves one line's frequency past another, this introduces errors. This is uncommon but happens more easily at higher pressures.

If this happens, the output of this function is not usable, but no safe-guards are in place to guard against this.

Parameters
[in]bandThe absorption band [N lines]
[in]temperaturesThe temperature grid for fitting parameters upon [K temperatures]
[in]massThe mass of all broadeners of the absorption band [M broadeners]
Returns
Eigenvalue line mixing parameters

Definition at line 1411 of file linemixing.cc.

References Absorption::Lines::broadeningspecies, Absorption::Lines::F_mean(), ComplexMatrixView::imag(), joker, Constant::k, Absorption::Lines::lines, M, N, ConstVectorView::nelem(), Absorption::Lines::NumBroadeners(), Absorption::Lines::NumLines(), presorted_population_and_dipole(), RosenkranzDV(), RosenkranzG(), RosenkranzY(), single_species_ecs_relaxation_matrix(), sorted_population_and_dipole(), and Absorption::Lines::T0.

Referenced by ecs_eigenvalue_adaptation().

◆ RosenkranzDV()

Vector Absorption::LineMixing::RosenkranzDV ( const Vector dip,
const ConstMatrixView W,
const AbsorptionLines band 
)

Computes the Rosenkranz second order imaginary perturbation

Parameters
[in]dipReduced dipoles
[in]WThe relaxation matrix
[in]bandThe absorption band
Returns
Second order imaginary coefficients

Definition at line 1262 of file linemixing.cc.

References Constant::k, Absorption::Lines::lines, N, and ConstVectorView::nelem().

Referenced by rosenkranz_approximation().

◆ RosenkranzG()

Vector Absorption::LineMixing::RosenkranzG ( const Vector dip,
const ConstMatrixView W,
const AbsorptionLines band 
)

Computes the Rosenkranz second order real perturbation

Parameters
[in]dipReduced dipoles
[in]WThe relaxation matrix
[in]bandThe absorption band
Returns
Second order real coefficients

Definition at line 1228 of file linemixing.cc.

References abs, LineShape::G, Constant::k, Interpolation::l(), Absorption::Lines::lines, N, ConstVectorView::nelem(), and Math::pow2().

Referenced by rosenkranz_approximation().

◆ RosenkranzY()

Vector Absorption::LineMixing::RosenkranzY ( const Vector dip,
const ConstMatrixView W,
const AbsorptionLines band 
)

Computes the Rosenkranz first order perturbation

Parameters
[in]dipReduced dipoles
[in]WThe relaxation matrix
[in]bandThe absorption band
Returns
First order coefficients

Definition at line 1201 of file linemixing.cc.

References abs, Constant::k, Absorption::Lines::lines, N, ConstVectorView::nelem(), and LineShape::Y.

Referenced by rosenkranz_approximation().

◆ single_species_ecs_relaxation_matrix()

ComplexMatrix Absorption::LineMixing::single_species_ecs_relaxation_matrix ( const AbsorptionLines band,
const ArrayOfIndex sorting,
const Numeric  T,
const Numeric  P,
const SpeciesErrorCorrectedSuddenData species_ecs_data,
const Index  species_pos 
)

Computes the Error Corrected Sudden relaxation matrix for a single species

The band population type is used to select type of off-diagonal element computations

Parameters
[in]bandThe absorption band
[in]sortingThe sorting of the band
[in]TThe temperature
[in]PThe pressure
[in]species_massThe mass of the colliding species
[in]species_posThe index position of the colliding species among the band broadeners
Returns
The single species relaxation matrix

Definition at line 613 of file linemixing.cc.

References ARTS_ASSERT, ComplexMatrixView::imag(), N, Absorption::Lines::NumLines(), Absorption::Lines::population, Absorption::LineMixing::Makarov2020etal::relaxation_matrix_offdiagonal(), Absorption::LineMixing::LinearRovibErrorCorrectedSudden::relaxation_matrix_offdiagonal(), and Absorption::Lines::ShapeParameters().

Referenced by ecs_eigenvalue_approximation(), ecs_relaxation_matrix(), and rosenkranz_approximation().

◆ sorted_population_and_dipole()

std::pair< ArrayOfIndex, PopulationAndDipole > Absorption::LineMixing::sorted_population_and_dipole ( const Numeric  T,
const AbsorptionLines band 
)

Returns sorted population distribtions and dipoles and the original sorting

Parameters
[in]TThe temperature
[in]bandThe absorption band
Returns
{sorting, sorted population distribtions and dipoles}

Definition at line 245 of file linemixing.cc.

References Absorption::LineMixing::PopulationAndDipole::sort().

Referenced by ecs_absorption_impl(), ecs_eigenvalue_approximation(), and rosenkranz_approximation().