ARTS 2.5.11 (git: 6827797f)
LineShape Namespace Reference

Computations of line shape derived parameters. More...

Namespaces

namespace  LegacyLineFunctionData
 Legacy dealing with reading old LineFunctionData.
 
namespace  LegacyLineMixingData
 Legacy dealing with reading old LineMixingData.
 
namespace  LegacyPressureBroadeningData
 Legacy dealing with reading old PressureBroadeningData.
 

Classes

class  Calculator
 Line shape calculator. More...
 
struct  ComputeData
 Main computational data for the line shape and strength calculations. More...
 
struct  ComputeValues
 
struct  CutoffRange
 Struct to keep the cutoff limited range values. More...
 
struct  Derivatives
 Data struct for keeping derivative keys and values. More...
 
struct  Doppler
 
struct  FullNonLocalThermodynamicEquilibrium
 
struct  FullNonLocalThermodynamicEquilibriumInitialization
 
struct  HartmannTran
 
class  IntensityCalculator
 Class encapsulating all supported types of intensity calculations of individual absorption lines. More...
 
struct  LocalThermodynamicEquilibrium
 
struct  Lorentz
 
class  Model
 Main line shape model class. More...
 
struct  ModelParameters
 Coefficients and temperature model for SingleSpeciesModel. More...
 
struct  Nonorm
 
class  Normalizer
 
struct  Noshape
 
struct  Nostrength
 
struct  Output
 Main output of Model. More...
 
struct  RosenkranzQuadratic
 
struct  SimpleFrequencyScaling
 
class  SingleSpeciesModel
 Compute the line shape parameters for a single broadening species. More...
 
struct  SparseLimitRange
 Struct to keep the cutoff limited range values and the sparse limits. More...
 
struct  SpeedDependentVoigt
 
struct  VanVleckHuber
 
struct  VanVleckWeisskopf
 
struct  VibrationalTemperaturesNonLocalThermodynamicEquilibrium
 
struct  VibrationalTemperaturesNonLocalThermodynamicEquilibriumInitializer
 
struct  Voigt
 

Typedefs

using ArrayOfDerivatives = Array< Derivatives >
 Helper to keep function signature clean.
 

Functions

constexpr Numeric abs_squared (Complex z) noexcept
 
CutoffRange limited_range (const Numeric fl, const Numeric fu, const Vector &f_grid) ARTS_NOEXCEPT
 Gets the start and size of a range such that.
 
SparseLimitRange linear_sparse_limited_range (const Numeric flc, const Numeric fuc, const Numeric fls, const Numeric fus, const Vector &f_grid, const Vector &sparse_f_grid) ARTS_NOEXCEPT
 
SparseLimitRange quad_sparse_limited_range (const Numeric flc, const Numeric fuc, const Numeric fls, const Numeric fus, const Vector &f_grid, const Vector &sparse_f_grid) ARTS_NOEXCEPT
 
Index active_nelem (const ArrayOfDerivatives &derivs) noexcept
 Helper function to find the last relevant derivative.
 
void cutoff_frequency_loop (ComputeValues &com, Calculator &ls, Calculator &ls_mirr, Normalizer &ls_norm, const Calculator &ls_cut, const Calculator &ls_mirr_cut, const IntensityCalculator &ls_str, const ArrayOfDerivatives &derivs, const Complex LM, const Numeric &T, const Numeric &dfdH, const Numeric &Sz, const Species::Species self_species) ARTS_NOEXCEPT
 Cutoff frequency loop of the line shape call.
 
void frequency_loop (ComputeValues &com, Calculator &ls, Calculator &ls_mirr, Normalizer &ls_norm, const IntensityCalculator &ls_str, const ArrayOfDerivatives &derivs, const Complex LM, const Numeric &T, const Numeric &dfdH, const Numeric &Sz, const Species::Species self_species) ARTS_NOEXCEPT
 Frequency loop of the line shape call.
 
void cutoff_loop_sparse_linear (ComputeData &com, ComputeData &sparse_com, Normalizer ls_norm, const IntensityCalculator ls_str, const AbsorptionLines &band, const ArrayOfDerivatives &derivs, const Output X, const Numeric &T, const Numeric &H, const Numeric &sparse_lim, const Numeric &DC, const Index i, const Zeeman::Polarization zeeman_polarization) ARTS_NOEXCEPT
 Cutoff considerations of the line shape.
 
void cutoff_loop_sparse_triple (ComputeData &com, ComputeData &sparse_com, Normalizer ls_norm, const IntensityCalculator ls_str, const AbsorptionLines &band, const ArrayOfDerivatives &derivs, const Output X, const Numeric &T, const Numeric &H, const Numeric &sparse_lim, const Numeric &DC, const Index i, const Zeeman::Polarization zeeman_polarization) ARTS_NOEXCEPT
 
void cutoff_loop (ComputeData &com, Normalizer ls_norm, const IntensityCalculator ls_str, const AbsorptionLines &band, const ArrayOfDerivatives &derivs, const Output X, const Numeric &T, const Numeric &H, const Numeric &DC, const Index i, const Zeeman::Polarization zeeman_polarization) ARTS_NOEXCEPT
 Cutoff considerations of the line shape.
 
void line_loop (ComputeData &com, ComputeData &sparse_com, const AbsorptionLines &band, const ArrayOfRetrievalQuantity &jacobian_quantities, const EnergyLevelMap &nlte, const Vector &vmrs, const ArrayOfSpeciesTag &self_tag, const Numeric &P, const Numeric &T, const Numeric &H, const Numeric &sparse_lim, const Numeric QT, const Numeric QT0, const Numeric dQTdT, const Numeric r, const Numeric drdSELFVMR, const Numeric drdT, const Zeeman::Polarization zeeman_polarization, const Options::LblSpeedup speedup_type) ARTS_NOEXCEPT
 Loop all the lines of the band.
 
void compute (ComputeData &com, ComputeData &sparse_com, const AbsorptionLines &band, const ArrayOfRetrievalQuantity &jacobian_quantities, const EnergyLevelMap &rtp_nlte, const Vector &vmrs, const ArrayOfSpeciesTag &self_tag, const Numeric &self_vmr, const Numeric &isot_ratio, const Numeric &rtp_pressure, const Numeric &rtp_temperature, const Numeric &H, const Numeric &sparse_lim, const Zeeman::Polarization zeeman_polarization, const Options::LblSpeedup speedup_type, const bool robust) ARTS_NOEXCEPT
 Compute the absorption of an absorption band.
 
Index sparse_f_grid_red (const Vector &f_grid, const Numeric &sparse_df) noexcept
 
Vector linear_sparse_f_grid (const Vector &f_grid, const Numeric &sparse_df) ARTS_NOEXCEPT
 
bool good_linear_sparse_f_grid (const Vector &f_grid_dense, const Vector &f_grid_sparse) noexcept
 
Vector triple_sparse_f_grid (const Vector &f_grid, const Numeric &sparse_df) noexcept
 
std::ostream & operator<< (std::ostream &os, const Model &m)
 
std::istream & operator>> (std::istream &is, Model &m)
 
String ModelShape2MetaData (const Model &m)
 
Model MetaData2ModelShape (const String &s)
 
String modelparameters2metadata (const ModelParameters mp, const Numeric T0)
 
ArrayOfString ModelMetaDataArray (const LineShape::Model &m, const bool self, const ArrayOfSpecies &sts, const Numeric T0)
 
Numeric & SingleModelParameter (ModelParameters &mp, const String &type)
 Get a coefficient from ModelParameters by name.
 
std::ostream & operator<< (std::ostream &os, const ModelParameters &mp)
 
std::istream & operator>> (std::istream &is, ModelParameters &mp)
 
std::ostream & operator<< (std::ostream &os, const SingleSpeciesModel &ssm)
 
std::istream & operator>> (std::istream &is, SingleSpeciesModel &ssm)
 
std::ostream & operator<< (std::ostream &os, Output x)
 
Model hitran_model (Numeric sgam, Numeric nself, Numeric agam, Numeric nair, Numeric psf)
 
Model lblrtm_model (Numeric sgam, Numeric nself, Numeric agam, Numeric nair, Numeric psf, std::array< Numeric, 12 > aer_interp)
 
 ENUMCLASS (Type, char, DP, LP, VP, SDVP, HTP, SplitLP, SplitVP, SplitSDVP, SplitHTP) const expr std
 Type of line shape to compute.
 
 ENUMCLASS (TemperatureModel, char, None, T0, T1, T2, T3, T4, T5, LM_AER, DPL, POLY) ENUMCLASS(Variable
 Temperature models.
 
constexpr ModelParameters modelparameterGetEmpty (const TemperatureModel t) noexcept
 
constexpr bool modelparameterEmpty (const ModelParameters mp) noexcept
 
constexpr Numeric modelparameterFirstExponent (const ModelParameters mp) noexcept
 
constexpr Output mirroredOutput (Output x) noexcept
 Output to be used by mirroring calls.
 
constexpr Output negativeOutput (Output x) noexcept
 Output turned negative.
 
constexpr Output si2cgs (Output x) noexcept
 Output turned from SI to CGS units.
 
constexpr Output differenceOutput (Output y, Output x) noexcept
 Diff of two output.
 
Vector vmrs (const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const ArrayOfSpecies &lineshape_species) ARTS_NOEXCEPT
 Returns a VMR vector for this model's main calculations.
 
Vector mass (const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const ArrayOfSpecies &lineshape_species, const SpeciesIsotopologueRatios &ir) ARTS_NOEXCEPT
 Returns a mass vector for this model's main calculations.
 
std::istream & from_artscat4 (std::istream &is, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpecies &species, const QuantumIdentifier &qid)
 
std::istream & from_linefunctiondata (std::istream &data, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpecies &species)
 
std::istream & from_linemixingdata (std::istream &data, Model &lsc)
 Legacy reading of old deprecated LineMixingData class.
 
std::istream & from_pressurebroadeningdata (std::istream &data, LineShape::Type &type, bool &self, bool &bath, Model &m, ArrayOfSpecies &species, const QuantumIdentifier &qid)
 Legacy reading of old deprecated PressureBroadeningData class.
 

Variables

 char
 
 G0
 
 D0
 
 G2
 
 D2
 
 FVC
 
 ETA
 
 Y
 
 G
 
constexpr Index nVars = Index(Variable::FINAL)
 Current max number of line shape variables.
 
constexpr std::string_view bath_broadening = "AIR"
 Name for bath broadening in printing and reading user input.
 
constexpr std::string_view self_broadening = "SELF"
 Name for self broadening in printing and reading user input.
 

Detailed Description

Computations of line shape derived parameters.

Defines many classes and IO routines for line shape parameters to comply with everything from no line mixing Doppler to coefficient-based line mixing Hartman-Tran profiles

Typedef Documentation

◆ ArrayOfDerivatives

Helper to keep function signature clean.

Definition at line 2195 of file lineshape.cc.

Function Documentation

◆ abs_squared()

constexpr Numeric LineShape::abs_squared ( Complex  z)
constexprnoexcept

◆ active_nelem()

Index LineShape::active_nelem ( const ArrayOfDerivatives derivs)
noexcept

Helper function to find the last relevant derivative.

Definition at line 2198 of file lineshape.cc.

◆ compute()

void LineShape::compute ( ComputeData com,
ComputeData sparse_com,
const AbsorptionLines band,
const ArrayOfRetrievalQuantity jacobian_quantities,
const EnergyLevelMap rtp_nlte,
const Vector &  vmrs,
const ArrayOfSpeciesTag self_tag,
const Numeric &  self_vmr,
const Numeric &  isot_ratio,
const Numeric &  rtp_pressure,
const Numeric &  rtp_temperature,
const Numeric &  H,
const Numeric &  sparse_lim,
const Zeeman::Polarization  zeeman_polarization,
const Options::LblSpeedup  speedup_type,
const bool  robust 
)

Compute the absorption of an absorption band.

For a single line the line shape is

\[ F_i = S_{z_i} S_{n_i} S_i LM_i F_i( \cdots ), \]

where \( S_{z_i} \) is the Zeeman scaling, \( S_{n_i} \) is the normalization scaling, \( S_i \) is the line strength scaling, \( LM_i \) is the line mixing scaling, and \( F_i( \cdots )\) is the shape.

and the derivatives are

\[ \frac{\partial F_l}{\partial t} = S_{z_i} \left( \frac{\partial S_{n_i}}{\partial t} S_i LM_i F_i( \cdots ) + S_{n_i} \frac{\partial S_i}{\partial t} LM_i F_i( \cdots ) + S_{n_i} S_i \frac{\partial LM_i}{\partial t} F_i( \cdots ) + S_{n_i} S_i LM_i \frac{\partial F_i( \cdots )}{\partial t} \right), \]

where \( t \) is some arbitrary variable.

Parameters
[in,out]comMain computations variable. Should be initialized and may have been used before.
[in,out]sparse_comSparse computations variable. Should be initialized and may have been used before.
[in]bandThe absorption band
[in]jacobian_quantitiesAs WSV
[in]rtp_nlteAs WSV
[in]vmrsThe volume mixing ratios of the band's line shape model
[in]self_tagThe species tag from abs_species this band belongs to (only used for derivatives)
[in]self_vmrThe volume mixing of the band's species.
[in]isot_ratioThe sotopologue ratio of the band's species
[in]rtp_pressureAs WSV
[in]rtp_temperatureAs WSV
[in]HThe magnetic field strength in Teslas
[in]sparse_limThe frequency separating the sparse and dense frequency grid calculations
[in]zeeman_polarizationType of Zeeman polarization
[in]speedup_typeType of sparse grid interactions
[in]robustIf true, a band with line mixing parameters guarantees non-negative output by allocating its own com and sparse_com for local calculations

Definition at line 3549 of file lineshape.cc.

References ARTS_ASSERT, dnumber_density_dt(), dsingle_partition_function_dT(), LineShape::ComputeData::enforce_positive_absorption(), line_loop(), number_density(), Absorption::relaxationtype_relmat(), single_partition_function(), and vmrs().

Referenced by propmat_clearskyAddLines(), and zeeman_on_the_fly().

◆ cutoff_frequency_loop()

void LineShape::cutoff_frequency_loop ( ComputeValues com,
Calculator ls,
Calculator ls_mirr,
Normalizer ls_norm,
const Calculator ls_cut,
const Calculator ls_mirr_cut,
const IntensityCalculator ls_str,
const ArrayOfDerivatives derivs,
const Complex  LM,
const Numeric &  T,
const Numeric &  dfdH,
const Numeric &  Sz,
const Species::Species  self_species 
)

Cutoff frequency loop of the line shape call.

This simply adds to the four output vectors/matrices for each frequency grid.

The equation solved is the inner part of

\[ F(f) = \sum_i S_{lm} S_n(f) S_z S_i \left[F_i\left(f\right) + F^M_i\left(f\right) - F_i\left(f_c\right) - F^M_i\left(f_c\right)\right], \]

where \( f \) is the frequency, \( i \) is the line index, \( S_{lm} \) is the line mixing scaling, \( S_n(f) \) is the line normalization at \( f \), \( S_z \) is the Zeeman line strength scaling, \( S_i \) is the line strength, \( F_i\left(f\right) \) is the line shape at \( f \), \( F^M_i\left(f\right) \) is the mirrored line shape at \( f \), and \( f_c \) is the cutoff frequency.

Each of \( S_n \), \( S_i \), \( F_i\left(f\right) \), and \( F^M_i\left(f\right) \) are setup to work as functional classes. They each define a set of possible derivatives and these possible derivatives are used to setup the chain rules required to computed \( \partial F(f) / \partial x \). Also, \( S_i \) is setup so to return the NLTE ratios required for computing

\[ N(f) = \sum_i S_{lm} S_n(f) S_z N_i \left[F_i\left(f\right) + F^M_i\left(f\right) - F_i\left(f_c\right) - F^M_i\left(f_c\right)\right], \]

with the same rules applied to \( \partial N(f) / \partial x \) as on \( \partial F(f) / \partial x \).

Note that even though not directly implied by this notation, most of the variables used in these two equations depends on some line parameters. Also note that the idea is to add full cross-section at once so as to limit the number of allocations in nested runs, so the calculations must happen in the inner most loop.

This function is not possible to run on multiple cores. Such parallelisms must happen at a much higher level.

Parameters
[in]jacobian_quantitiesAs WSV
[in]TThe atmospheric temperature
[in]do_nlteFlag for whether or not NLTE will be computed
[in]LMThe line mixing scaling. \( S_{lm} \)
[in]ls_strThe line strength calculator. \( S_i \)
[in,out]ls_normThe normalization calculator. \( S_n \)
[in]derivsA list of pre-computed derivative values and keys
[in,out]FThe cross-section. \( F \)
[in,out]dFThe cross-section's derivatives. \( \partial F / \partial x \)
[in,out]NThe cross-section ratio of the NLTE source. \( N \)
[in,out]dNThe cross-section ratio of the NLTE source's derivatives. \( \partial N / \partial x \)
[in]f_gridThe frequency grid. \( \left[ f_0, \cdots, f_n \right] \)
[in]dfdHThe derivative of the change of frequency w.r.t. magnetic field strength
[in]SzThe relative Zeeman strength. \( S_z \)
[in]lsThe line shape calculator. \( F_i \)
[in]ls_mirrThe mirrored line shape calculator. \( F^M_i \)

Definition at line 2663 of file lineshape.cc.

References CutInternalDerivatives, d, D0, D2, ETA, FVC, G0, G2, InternalDerivativesG, InternalDerivativesY, and mirroredOutput().

Referenced by cutoff_loop(), cutoff_loop_sparse_linear(), and cutoff_loop_sparse_triple().

◆ cutoff_loop()

void LineShape::cutoff_loop ( ComputeData com,
Normalizer  ls_norm,
const IntensityCalculator  ls_str,
const AbsorptionLines band,
const ArrayOfDerivatives derivs,
const Output  X,
const Numeric &  T,
const Numeric &  H,
const Numeric &  DC,
const Index  i,
const Zeeman::Polarization  zeeman_polarization 
)

Cutoff considerations of the line shape.

This function takes care of setting up cutoff and line shape considerations for the frequency loop function it wraps. Internally, the cutoff is calculated from the band information and a view of the correct data is sent on.

The Zeeman effect is also considered internally if applicable (or ignored otherwise)

This function is not possible to run on multiple cores. Such parallelisms must happen at a much higher level.

Parameters
[in,out]FThe cross-section. \( F \)
[in,out]dFThe cross-section's derivatives. \( \partial F / \partial x \)
[in,out]NThe cross-section ratio of the NLTE source. \( N \)
[in,out]dNThe cross-section ratio of the NLTE source's derivatives. \( \partial N / \partial x \)
[in]f_gridThe frequency grid. \( \left[ f_0, \cdots, f_n \right] \)
[in]bandThe absorption band
[in]jacobian_quantitiesAs WSV
[in]TThe atmospheric temperature
[in]do_nlteFlag for whether or not NLTE will be computed
[in]HThe magnetic field magnitude
[in]do_zeemanFlag for whether this is part of some Zeeman calculations
[in]zeeman_polarizationThe type of Zeeman polarization to consider (if any)
[in]f_meanThe mean frequency of the absorption band
[in]DCThe Doppler broadening constant of the band
[in]iThe line index
[in]XThe line shape model parameters of the atmosphere
[in]LMThe line mixing scaling. \( S_{lm} \)
[in]ls_strThe line strength calculator. \( S_i \)
[in]ls_normThe normalization calculator. \( S_n \)
[in]derivsA list of pre-computed derivative values and keys

Definition at line 3290 of file lineshape.cc.

References cutoff_frequency_loop(), frequency_loop(), and limited_range().

Referenced by line_loop().

◆ cutoff_loop_sparse_linear()

void LineShape::cutoff_loop_sparse_linear ( ComputeData com,
ComputeData sparse_com,
Normalizer  ls_norm,
const IntensityCalculator  ls_str,
const AbsorptionLines band,
const ArrayOfDerivatives derivs,
const Output  X,
const Numeric &  T,
const Numeric &  H,
const Numeric &  sparse_lim,
const Numeric &  DC,
const Index  i,
const Zeeman::Polarization  zeeman_polarization 
)

Cutoff considerations of the line shape.

This function takes care of setting up cutoff and line shape considerations for the frequency loop function it wraps. Internally, the cutoff is calculated from the band information and a view of the correct data is sent on.

The Zeeman effect is also considered internally if applicable (or ignored otherwise)

This function is not possible to run on multiple cores. Such parallelisms must happen at a much higher level.

Parameters
[in,out]FThe cross-section. \( F \)
[in,out]dFThe cross-section's derivatives. \( \partial F / \partial x \)
[in,out]NThe cross-section ratio of the NLTE source. \( N \)
[in,out]dNThe cross-section ratio of the NLTE source's derivatives. \( \partial N / \partial x \)
[in]f_gridThe frequency grid. \( \left[ f_0, \cdots, f_n \right] \)
[in]bandThe absorption band
[in]jacobian_quantitiesAs WSV
[in]TThe atmospheric temperature
[in]do_nlteFlag for whether or not NLTE will be computed
[in]HThe magnetic field magnitude
[in]do_zeemanFlag for whether this is part of some Zeeman calculations
[in]zeeman_polarizationThe type of Zeeman polarization to consider (if any)
[in]f_meanThe mean frequency of the absorption band
[in]DCThe Doppler broadening constant of the band
[in]iThe line index
[in]XThe line shape model parameters of the atmosphere
[in]LMThe line mixing scaling. \( S_{lm} \)
[in]ls_strThe line strength calculator. \( S_i \)
[in]ls_normThe normalization calculator. \( S_n \)
[in]derivsA list of pre-computed derivative values and keys

Definition at line 3084 of file lineshape.cc.

References cutoff_frequency_loop(), frequency_loop(), and linear_sparse_limited_range().

Referenced by line_loop().

◆ cutoff_loop_sparse_triple()

void LineShape::cutoff_loop_sparse_triple ( ComputeData com,
ComputeData sparse_com,
Normalizer  ls_norm,
const IntensityCalculator  ls_str,
const AbsorptionLines band,
const ArrayOfDerivatives derivs,
const Output  X,
const Numeric &  T,
const Numeric &  H,
const Numeric &  sparse_lim,
const Numeric &  DC,
const Index  i,
const Zeeman::Polarization  zeeman_polarization 
)

Definition at line 3168 of file lineshape.cc.

References cutoff_frequency_loop(), frequency_loop(), and quad_sparse_limited_range().

Referenced by line_loop().

◆ differenceOutput()

constexpr Output LineShape::differenceOutput ( Output  y,
Output  x 
)
constexprnoexcept

Diff of two output.

Definition at line 567 of file lineshapemodel.h.

References LineShape::Output::G0.

◆ ENUMCLASS() [1/2]

LineShape::ENUMCLASS ( TemperatureModel  ,
char  ,
None  ,
T0  ,
T1  ,
T2  ,
T3  ,
T4  ,
T5  ,
LM_AER  ,
DPL  ,
POLY   
)

Temperature models.

Each input here should correspond to a method of how to compute the variable given the coefficients and Interpolation data available to SingleSpeciesModel

FIXME: The python API breaks if this is a char type even though it can be???? List of possible shape variables

Should correspond to strings in AllLineShapeVars()

◆ ENUMCLASS() [2/2]

LineShape::ENUMCLASS ( Type  ,
char  ,
DP  ,
LP  ,
VP  ,
SDVP  ,
HTP  ,
SplitLP  ,
SplitVP  ,
SplitSDVP  ,
SplitHTP   
) const

Type of line shape to compute.

Turns selected Type into a human readable string

This function takes the input Type and returns it as a string

Parameters
[in]typeThe Type
Returns
std::string_view of Type Is the Type independent per broadener?

If it is, the line shape is computed as F_1(...) + F_2(...) + /// + F_N(...) If it is not, then it is computed as F(avg(..._1 + ..._2 + /// + ..._N))

Where F is the lineshape, the subindex is the line parameter (such as pressure broadening) and avg(///) is an averaging function

Parameters
[in]typeThe LineShape::Type
Returns
true If we compute the line shape per broadener and then sum it up
false If we average line parameters for all broadeners and then compute the line shape

Definition at line 44 of file lineshapemodel.h.

◆ frequency_loop()

void LineShape::frequency_loop ( ComputeValues com,
Calculator ls,
Calculator ls_mirr,
Normalizer ls_norm,
const IntensityCalculator ls_str,
const ArrayOfDerivatives derivs,
const Complex  LM,
const Numeric &  T,
const Numeric &  dfdH,
const Numeric &  Sz,
const Species::Species  self_species 
)

Frequency loop of the line shape call.

This simply adds to the four output vectors/matrices for each frequency grid.

The equation solved is the inner part of

\[ F(f) = \sum_i S_{lm} S_n(f) S_z S_i \left[F_i\left(f\right) + F^M_i\left(f\right)\right], \]

where \( f \) is the frequency, \( i \) is the line index, \( S_{lm} \) is the line mixing scaling, \( S_n(f) \) is the line normalization at \( f \), \( S_z \) is the Zeeman line strength scaling, \( S_i \) is the line strength, \( F_i\left(f\right) \) is the line shape at \( f \), and \( F^M_i\left(f\right) \) is the mirrored line shape at \( f \).

Each of \( S_n \), \( S_i \), \( F_i\left(f\right) \), and \( F^M_i\left(f\right) \) are setup to work as functional classes. They each define a set of possible derivatives and these possible derivatives are used to setup the chain rules required to computed \( \partial F(f) / \partial x \). Also, \( S_i \) is setup so to return the NLTE ratios required for computing

\[ N(f) = \sum_i S_{lm} S_n(f) S_z N_i \left[F_i\left(f\right) + F^M_i\left(f\right)\right], \]

with the same rules applied to \( \partial N(f) / \partial x \) as on \( \partial F(f) / \partial x \).

Note that even though not directly implied by this notation, most of the variables used in these two equations depends on some line parameters. Also note that the idea is to add full cross-section at once so as to limit the number of allocations in nested runs, so the calculations must happen in the inner most loop.

This function is not possible to run on multiple cores. Such parallelisms must happen at a much higher level.

Parameters
[in]jacobian_quantitiesAs WSV
[in]TThe atmospheric temperature
[in]do_nlteFlag for whether or not NLTE will be computed
[in]LMThe line mixing scaling. \( S_{lm} \)
[in]ls_strThe line strength calculator. \( S_i \)
[in,out]ls_normThe normalization calculator. \( S_n \)
[in]derivsA list of pre-computed derivative values and keys
[in,out]FThe cross-section. \( F \)
[in,out]dFThe cross-section's derivatives. \( \partial F / \partial x \)
[in,out]NThe cross-section ratio of the NLTE source. \( N \)
[in,out]dNThe cross-section ratio of the NLTE source's derivatives. \( \partial N / \partial x \)
[in]f_gridThe frequency grid. \( \left[ f_0, \cdots, f_n \right] \)
[in]dfdHThe derivative of the change of frequency w.r.t. magnetic field strength
[in]SzThe relative Zeeman strength. \( S_z \)
[in]lsThe line shape calculator. \( F_i \)
[in]ls_mirrThe mirrored line shape calculator. \( F^M_i \)

Definition at line 2890 of file lineshape.cc.

References d, D0, D2, ETA, FVC, G0, G2, InternalDerivatives, InternalDerivativesG, InternalDerivativesY, and mirroredOutput().

Referenced by cutoff_loop(), cutoff_loop_sparse_linear(), and cutoff_loop_sparse_triple().

◆ from_artscat4()

std::istream & LineShape::from_artscat4 ( std::istream &  is,
Type &  type,
bool &  self,
bool &  bath,
Model m,
ArrayOfSpecies species,
const QuantumIdentifier qid 
)

◆ from_linefunctiondata()

std::istream & LineShape::from_linefunctiondata ( std::istream &  data,
Type &  type,
bool &  self,
bool &  bath,
Model m,
ArrayOfSpecies species 
)

◆ from_linemixingdata()

std::istream & LineShape::from_linemixingdata ( std::istream &  data,
LineShape::Model lsc 
)

Legacy reading of old deprecated LineMixingData class.

Definition at line 260 of file lineshapemodel.cc.

Referenced by Absorption::ReadFromArtscat5Stream().

◆ from_pressurebroadeningdata()

std::istream & LineShape::from_pressurebroadeningdata ( std::istream &  data,
LineShape::Type &  type,
bool &  self,
bool &  bath,
Model m,
ArrayOfSpecies species,
const QuantumIdentifier qid 
)

Legacy reading of old deprecated PressureBroadeningData class.

Definition at line 229 of file lineshapemodel.cc.

References Quantum::Number::GlobalState::Species().

Referenced by Absorption::ReadFromArtscat5Stream().

◆ good_linear_sparse_f_grid()

bool LineShape::good_linear_sparse_f_grid ( const Vector &  f_grid_dense,
const Vector &  f_grid_sparse 
)
noexcept

Definition at line 3662 of file lineshape.cc.

Referenced by sparse_f_gridFromFrequencyGrid().

◆ hitran_model()

Model LineShape::hitran_model ( Numeric  sgam,
Numeric  nself,
Numeric  agam,
Numeric  nair,
Numeric  psf 
)

◆ lblrtm_model()

Model LineShape::lblrtm_model ( Numeric  sgam,
Numeric  nself,
Numeric  agam,
Numeric  nair,
Numeric  psf,
std::array< Numeric, 12 >  aer_interp 
)

Definition at line 1112 of file lineshapemodel.cc.

References LineShape::Model::Data().

Referenced by Absorption::ReadFromLBLRTMStream().

◆ limited_range()

CutoffRange LineShape::limited_range ( const Numeric  fl,
const Numeric  fu,
const Vector &  f_grid 
)

Gets the start and size of a range such that.

\[ fl \leq f_grid[i] \leq fu \]

for i such that all fl <= f_grid[Range(out.first, out.second, 1)] <= fu

Parameters
[in]flLower frequency limit
[in]fuUpper frequency limit
[in]f_gridAs WSV, must be sorted
Returns
out so that the Range above can be formed

Definition at line 2031 of file lineshape.cc.

References ARTS_ASSERT.

Referenced by cutoff_loop().

◆ line_loop()

void LineShape::line_loop ( ComputeData com,
ComputeData sparse_com,
const AbsorptionLines band,
const ArrayOfRetrievalQuantity jacobian_quantities,
const EnergyLevelMap nlte,
const Vector &  vmrs,
const ArrayOfSpeciesTag self_tag,
const Numeric &  P,
const Numeric &  T,
const Numeric &  H,
const Numeric &  sparse_lim,
const Numeric  QT,
const Numeric  QT0,
const Numeric  dQTdT,
const Numeric  r,
const Numeric  drdSELFVMR,
const Numeric  drdT,
const Zeeman::Polarization  zeeman_polarization,
const Options::LblSpeedup  speedup_type 
)

Loop all the lines of the band.

This function is not possible to run on multiple cores. Such parallelisms must happen at a much higher level.

Parameters
[in,out]FThe cross-section. \( F \)
[in,out]dFThe cross-section's derivatives. \( \partial F / \partial x \)
[in,out]NThe cross-section ratio of the NLTE source. \( N \)
[in,out]dNThe cross-section ratio of the NLTE source's derivatives. \( \partial N / \partial x \)
[in]f_gridThe frequency grid. \( \left[ f_0, \cdots, f_n \right] \)
[in]bandThe absorption band
[in]jacobian_quantitiesAs WSV
[in]nlteA map of NLTE data
[in]vmrsThe band volume mixing ratio
[in]isot_ratioThe isotopic ratio of the isotopologue
[in]PThe atmospheric pressure
[in]TThe atmospheric temperature
[in]do_nlteFlag for whether or not NLTE will be computed
[in]HThe magnetic field magnitude
[in]do_zeemanFlag for whether this is part of some Zeeman calculations
[in]zeeman_polarizationThe type of Zeeman polarization to consider (if any)
[in]f_meanThe mean frequency of the absorption band
[in]QTThe partition function at the temperature
[in]QT0The partition function at the reference temperature
[in]dQTdTThe derivative of the partition function at the temperature wrt temperature

Definition at line 3369 of file lineshape.cc.

References LineShape::IntensityCalculator::adaptive_scaling(), cutoff_loop(), cutoff_loop_sparse_linear(), cutoff_loop_sparse_triple(), D0, D2, ETA, FVC, G, G0, G2, InternalDerivativesSetup, vmrs(), and Y.

Referenced by compute().

◆ linear_sparse_f_grid()

Vector LineShape::linear_sparse_f_grid ( const Vector &  f_grid,
const Numeric &  sparse_df 
)

Definition at line 3639 of file lineshape.cc.

References sparse_f_grid_red().

Referenced by sparse_f_gridFromFrequencyGrid().

◆ linear_sparse_limited_range()

SparseLimitRange LineShape::linear_sparse_limited_range ( const Numeric  flc,
const Numeric  fuc,
const Numeric  fls,
const Numeric  fus,
const Vector &  f_grid,
const Vector &  sparse_f_grid 
)

Definition at line 2048 of file lineshape.cc.

References ARTS_ASSERT.

Referenced by cutoff_loop_sparse_linear().

◆ mass()

Vector LineShape::mass ( const ConstVectorView &  atmospheric_vmrs,
const ArrayOfArrayOfSpeciesTag atmospheric_species,
const ArrayOfSpecies lineshape_species,
const SpeciesIsotopologueRatios ir 
)

Returns a mass vector for this model's main calculations.

Sets a vector that matches the mdata size of VMRs based on atmospheric species and VMRs

Only checks the first species in inner atmosphere

Renormalizes the values to unity. If this renormalization is impossible then it throws an error

Parameters
[in]atmospheric_vmrsVMRS in atmosphere
[in]atmospheric_speciesSpecies in atmosphere
[in]lineshape_speciesSpecies affecting lineshape

Definition at line 480 of file lineshapemodel.cc.

References ARTS_ASSERT, and Species::mean_mass().

Referenced by Absorption::Lines::BroadeningSpeciesMass().

◆ MetaData2ModelShape()

Model LineShape::MetaData2ModelShape ( const String s)

Definition at line 555 of file lineshapemodel.cc.

References my_basic_string< charT >::nelem().

Referenced by xml_read_from_stream().

◆ mirroredOutput()

constexpr Output LineShape::mirroredOutput ( Output  x)
constexprnoexcept

Output to be used by mirroring calls.

Definition at line 543 of file lineshapemodel.h.

References LineShape::Output::G0.

Referenced by LineShape::Calculator::Calculator(), cutoff_frequency_loop(), and frequency_loop().

◆ ModelMetaDataArray()

ArrayOfString LineShape::ModelMetaDataArray ( const LineShape::Model m,
const bool  self,
const ArrayOfSpecies sts,
const Numeric  T0 
)

◆ modelparameterEmpty()

constexpr bool LineShape::modelparameterEmpty ( const ModelParameters  mp)
constexprnoexcept

◆ modelparameterFirstExponent()

constexpr Numeric LineShape::modelparameterFirstExponent ( const ModelParameters  mp)
constexprnoexcept

Definition at line 356 of file lineshapemodel.h.

◆ modelparameterGetEmpty()

constexpr ModelParameters LineShape::modelparameterGetEmpty ( const TemperatureModel  t)
constexprnoexcept

Definition at line 300 of file lineshapemodel.h.

Referenced by Absorption::Lines::MakeLineShapeModelCommon().

◆ modelparameters2metadata()

String LineShape::modelparameters2metadata ( const ModelParameters  mp,
const Numeric  T0 
)

◆ ModelShape2MetaData()

String LineShape::ModelShape2MetaData ( const Model m)

Definition at line 536 of file lineshapemodel.cc.

References LineShape::Model::Data(), and toString().

Referenced by Absorption::Lines::LineShapeMetaData().

◆ negativeOutput()

constexpr Output LineShape::negativeOutput ( Output  x)
constexprnoexcept

Output turned negative.

Definition at line 548 of file lineshapemodel.h.

References LineShape::Output::G0.

◆ operator<<() [1/4]

std::ostream & LineShape::operator<< ( std::ostream &  os,
const Model m 
)

Definition at line 526 of file lineshapemodel.cc.

◆ operator<<() [2/4]

std::ostream & LineShape::operator<< ( std::ostream &  os,
const ModelParameters mp 
)

Definition at line 689 of file lineshapemodel.cc.

◆ operator<<() [3/4]

std::ostream & LineShape::operator<< ( std::ostream &  os,
const SingleSpeciesModel ssm 
)

Definition at line 1039 of file lineshapemodel.cc.

◆ operator<<() [4/4]

std::ostream & LineShape::operator<< ( std::ostream &  os,
Output  x 
)

Definition at line 1053 of file lineshapemodel.cc.

◆ operator>>() [1/3]

std::istream & LineShape::operator>> ( std::istream &  is,
Model m 
)

Definition at line 531 of file lineshapemodel.cc.

◆ operator>>() [2/3]

std::istream & LineShape::operator>> ( std::istream &  is,
ModelParameters mp 
)

Definition at line 695 of file lineshapemodel.cc.

◆ operator>>() [3/3]

std::istream & LineShape::operator>> ( std::istream &  is,
SingleSpeciesModel ssm 
)

Definition at line 1046 of file lineshapemodel.cc.

◆ quad_sparse_limited_range()

SparseLimitRange LineShape::quad_sparse_limited_range ( const Numeric  flc,
const Numeric  fuc,
const Numeric  fls,
const Numeric  fus,
const Vector &  f_grid,
const Vector &  sparse_f_grid 
)

Definition at line 2106 of file lineshape.cc.

References ARTS_ASSERT.

Referenced by cutoff_loop_sparse_triple().

◆ si2cgs()

constexpr Output LineShape::si2cgs ( Output  x)
constexprnoexcept

Output turned from SI to CGS units.

Definition at line 553 of file lineshapemodel.h.

References Conversion::freq2kaycm().

◆ SingleModelParameter()

Numeric & LineShape::SingleModelParameter ( ModelParameters mp,
const String type 
)

Get a coefficient from ModelParameters by name.

Will throw a runtime_error if type is bad

Parameters
[in]mpThe model parameters
[in]typeThe coefficient by name
Returns
a reference to the coefficient

Definition at line 674 of file lineshapemodel.cc.

References ARTS_USER_ERROR, LineShape::ModelParameters::X0, LineShape::ModelParameters::X1, LineShape::ModelParameters::X2, and LineShape::ModelParameters::X3.

◆ sparse_f_grid_red()

Index LineShape::sparse_f_grid_red ( const Vector &  f_grid,
const Numeric &  sparse_df 
)
noexcept

Definition at line 3630 of file lineshape.cc.

Referenced by linear_sparse_f_grid(), and triple_sparse_f_grid().

◆ triple_sparse_f_grid()

Vector LineShape::triple_sparse_f_grid ( const Vector &  f_grid,
const Numeric &  sparse_df 
)
noexcept

Definition at line 3677 of file lineshape.cc.

References sparse_f_grid_red().

Referenced by sparse_f_gridFromFrequencyGrid().

◆ vmrs()

Vector LineShape::vmrs ( const ConstVectorView &  atmospheric_vmrs,
const ArrayOfArrayOfSpeciesTag atmospheric_species,
const ArrayOfSpecies lineshape_species 
)

Returns a VMR vector for this model's main calculations.

Sets a vector that matches the mdata size of VMRs based on atmospheric species and VMRs

Only checks the first species in inner atmosphere

Renormalizes the values to unity. If this renormalization is impossible then it throws an error

Parameters
[in]atmospheric_vmrsVMRS in atmosphere
[in]atmospheric_speciesSpecies in atmosphere
[in]lineshape_speciesSpecies affecting lineshape

Definition at line 438 of file lineshapemodel.cc.

References ARTS_ASSERT.

Referenced by Absorption::Lines::BroadeningSpeciesVMR(), compute(), and line_loop().

Variable Documentation

◆ bath_broadening

constexpr std::string_view LineShape::bath_broadening = "AIR"
inlineconstexpr

◆ char

LineShape::char

Definition at line 137 of file lineshapemodel.h.

◆ D0

◆ D2

◆ ETA

◆ FVC

◆ G

◆ G0

◆ G2

◆ nVars

◆ self_broadening

constexpr std::string_view LineShape::self_broadening = "SELF"
inlineconstexpr

◆ Y