ARTS  2.3.1285(git:92a29ea9-dirty)
linefunctiondata.h File Reference

Contains the line function data class. More...

#include "abs_species_tags.h"
#include "jacobian.h"
#include <numeric>
#include "constants.h"

Go to the source code of this file.

Classes

struct  LineShape::ModelParameters
 Coefficients and temperature model for SingleSpeciesModel. More...
 
class  LineShape::SingleSpeciesModel
 Compute the line shape parameters for a single broadening species. More...
 
struct  LineShape::Output
 Main output of Model. More...
 
class  LineShape::Model
 Main line shape model class. More...
 

Namespaces

 LineShape
 Computations of line shape derived parameters.
 
 LineShape::LegacyLineFunctionData
 Legacy dealing with reading old LineFunctionData.
 
 LineShape::LegacyLineMixingData
 Legacy dealing with reading old LineMixingData.
 
 LineShape::LegacyPressureBroadeningData
 Legacy dealing with reading old PressureBroadeningData.
 

Macros

#define VARIABLE2STRINGDEF(X)   case Variable::X: return # X
 
#define STRING2VARIABLEDEF(X)   if(type == # X) return Variable::X
 
#define x0   X[Index(var)].X0
 
#define x1   X[Index(var)].X1
 
#define x2   X[Index(var)].X2
 
#define ACCESS_INTERNAL(VARPOS)
 
#define MODELPARAMCASESETTER(X)   case Variable::X: X () = x; break
 
#define MODELPARAMCASEGETTER(X)   case Variable::X: return X ();
 
#define LSPC(XVAR, PVAR)
 
#define LSPC(XVAR, PVAR)
 
#define LSPC(XVAR, PVAR)
 
#define LSPDC(XVAR, DERIV, PVAR)
 
#define RETURNINTERNALDERIVATIVE(TYPE)
 

Enumerations

enum  LineShape::TemperatureModel : Index {
  LineShape::TemperatureModel::None, LineShape::TemperatureModel::T0, LineShape::TemperatureModel::T1, LineShape::TemperatureModel::T2,
  LineShape::TemperatureModel::T3, LineShape::TemperatureModel::T4, LineShape::TemperatureModel::T5, LineShape::TemperatureModel::LM_AER,
  LineShape::TemperatureModel::None, LineShape::TemperatureModel::T0, LineShape::TemperatureModel::T1, LineShape::TemperatureModel::T2,
  LineShape::TemperatureModel::T3, LineShape::TemperatureModel::T4, LineShape::TemperatureModel::T5, LineShape::TemperatureModel::LM_AER,
  LineShape::TemperatureModel::DPL
}
 Temperature models. More...
 
enum  LineShape::Variable {
  LineShape::Variable::G0 =0, LineShape::Variable::D0 =1, LineShape::Variable::G2 =2, LineShape::Variable::D2 =3,
  LineShape::Variable::FVC =4, LineShape::Variable::ETA =5, LineShape::Variable::Y =6, LineShape::Variable::G =7,
  LineShape::Variable::DV =8, LineShape::Variable::G0 = 0, LineShape::Variable::D0 = 1, LineShape::Variable::G2 = 2,
  LineShape::Variable::D2 = 3, LineShape::Variable::FVC = 4, LineShape::Variable::ETA = 5, LineShape::Variable::Y = 6,
  LineShape::Variable::G = 7, LineShape::Variable::DV = 8
}
 List of possible shape variables. More...
 
enum  LineShape::Type {
  LineShape::Type::DP, LineShape::Type::LP, LineShape::Type::VP, LineShape::Type::SDVP,
  LineShape::Type::HTP, LineShape::Type::DP, LineShape::Type::LP, LineShape::Type::VP,
  LineShape::Type::SDVP, LineShape::Type::HTP
}
 
enum  LineShape::LegacyLineMixingData::TypeLM {
  LineShape::LegacyLineMixingData::TypeLM::LM_NONE, LineShape::LegacyLineMixingData::TypeLM::LM_LBLRTM, LineShape::LegacyLineMixingData::TypeLM::LM_LBLRTM_O2NonResonant, LineShape::LegacyLineMixingData::TypeLM::LM_1STORDER,
  LineShape::LegacyLineMixingData::TypeLM::LM_2NDORDER, LineShape::LegacyLineMixingData::TypeLM::LM_BYBAND, LineShape::LegacyLineMixingData::TypeLM::LM_NONE, LineShape::LegacyLineMixingData::TypeLM::LM_LBLRTM,
  LineShape::LegacyLineMixingData::TypeLM::LM_LBLRTM_O2NonResonant, LineShape::LegacyLineMixingData::TypeLM::LM_1STORDER, LineShape::LegacyLineMixingData::TypeLM::LM_2NDORDER, LineShape::LegacyLineMixingData::TypeLM::LM_BYBAND
}
 
enum  LineShape::LegacyPressureBroadeningData::TypePB {
  LineShape::LegacyPressureBroadeningData::TypePB::PB_NONE, LineShape::LegacyPressureBroadeningData::TypePB::PB_AIR_BROADENING, LineShape::LegacyPressureBroadeningData::TypePB::PB_AIR_AND_WATER_BROADENING, LineShape::LegacyPressureBroadeningData::TypePB::PB_PLANETARY_BROADENING,
  LineShape::LegacyPressureBroadeningData::TypePB::PB_NONE, LineShape::LegacyPressureBroadeningData::TypePB::PB_AIR_BROADENING, LineShape::LegacyPressureBroadeningData::TypePB::PB_AIR_AND_WATER_BROADENING, LineShape::LegacyPressureBroadeningData::TypePB::PB_PLANETARY_BROADENING
}
 

Functions

JacPropMatType select_derivativeLineShape (const String &var, const String &coeff)
 Select the derivative that will be used in Jacobian calculations — also checks validity of var and coeff. More...
 
ArrayOfString all_coefficientsLineFunctionData ()
 {"X0", "X1", "X2"} More...
 
ArrayOfString all_variablesLineFunctionData ()
 {"G0", "D0", "G2", "D2", "ETA", "FVC", "Y", "G", "DV"} More...
 
String LineShape::temperaturemodel2string (TemperatureModel type) noexcept
 Turns selected TemperatureModel type into a string. More...
 
TemperatureModel LineShape::string2temperaturemodel (const String &type)
 Turns predefined strings into a TemperatureModel type. More...
 
std::ostream & LineShape::operator<< (std::ostream &os, Variable v)
 Output operator for Variable to be human-readable. More...
 
String LineShape::variable2string (Variable type) noexcept
 Turns selected Variable type into a string. More...
 
Variable LineShape::string2variable (const String &type)
 Turns predefined strings into a Variable type. More...
 
NumericLineShape::SingleModelParameter (ModelParameters &mp, const String &type)
 Get a coefficient from ModelParameters by name. More...
 
std::ostream & LineShape::operator<< (std::ostream &os, const ModelParameters &mp)
 Output operator for ModelParameters. More...
 
std::istream & LineShape::operator>> (std::istream &is, ModelParameters &mp)
 Input operator for ModelParameters. More...
 
std::ostream & LineShape::operator<< (std::ostream &os, const SingleSpeciesModel &ssm)
 Output operator for SingleSpeciesModel. More...
 
std::istream & LineShape::operator>> (std::istream &is, SingleSpeciesModel &ssm)
 Input operator for SingleSpeciesModel. More...
 
String LineShape::shapetype2string (Type type) noexcept
 Turns selected Type into a string. More...
 
Type LineShape::string2shapetype (const String &type)
 Turns predefined strings into a Type. More...
 
std::ostream & LineShape::operator<< (std::ostream &os, Output x)
 Output operator for LineShape::Output. More...
 
constexpr Output LineShape::mirroredOutput (Output x) noexcept
 Output to be used by mirroring calls. More...
 
constexpr Output LineShape::negativeOutput (Output x) noexcept
 Output turned negative. More...
 
constexpr Output LineShape::si2cgs (Output x) noexcept
 Output turned from SI to CGS units. More...
 
constexpr Output LineShape::differenceOutput (Output y, Output x) noexcept
 Diff of two output. More...
 
std::istream & LineShape::from_artscat4 (std::istream &is, Model &lsc, const QuantumIdentifier &qid)
 
std::istream & LineShape::from_linefunctiondata (std::istream &data, Model &lsc)
 
std::istream & LineShape::from_linemixingdata (std::istream &data, Model &lsc)
 Legacy reading of old deprecated LineMixingData class. More...
 
std::istream & LineShape::from_pressurebroadeningdata (std::istream &data, Model &lsc, const QuantumIdentifier &qid)
 
std::ostream & LineShape::operator<< (std::ostream &os, const Model &m)
 
std::istream & LineShape::operator>> (std::istream &is, Model &m)
 
Index LineShape::LegacyLineFunctionData::temperaturemodel2legacynelem (TemperatureModel type) noexcept
 Length per variable. More...
 
std::vector< Variable > LineShape::LegacyLineFunctionData::lineshapetag2variablesvector (String type)
 Line shape models. More...
 
std::vector< Variable > LineShape::LegacyLineFunctionData::linemixingtag2variablesvector (String type)
 Line mixing models. More...
 
LegacyLineMixingData::TypeLM LineShape::LegacyLineMixingData::string2typelm (String type)
 Line mixing types from string. More...
 
Index LineShape::LegacyLineMixingData::typelm2nelem (LegacyLineMixingData::TypeLM type)
 Line mixing types to number. More...
 
Model LineShape::LegacyLineMixingData::vector2modellm (Vector x, LegacyLineMixingData::TypeLM type)
 LineShape::Model from legacy input vector. More...
 
LegacyPressureBroadeningData::TypePB LineShape::LegacyPressureBroadeningData::string2typepb (String type)
 Pressure broadening types from string. More...
 
bool LineShape::LegacyPressureBroadeningData::self_listed (const QuantumIdentifier &qid, LegacyPressureBroadeningData::TypePB t)
 Pressure broadening if self exist. More...
 
Index LineShape::LegacyPressureBroadeningData::typepb2nelem (LegacyPressureBroadeningData::TypePB type)
 Pressure broadening types to number of elements. More...
 
Model LineShape::LegacyPressureBroadeningData::vector2modelpb (Vector x, LegacyPressureBroadeningData::TypePB type, bool self_in_list)
 

Variables

constexpr Index LineShape::nmaxTempModelParams =3
 Current max number of coefficients. More...
 
constexpr Index LineShape::nVars =9
 Current max number of line shape variables. More...
 
constexpr Index LineShape::nmaxInterpModels =12
 

Detailed Description

Contains the line function data class.

Author
Richard Larsson
Date
2018-09-19

Definition in file linefunctiondata.h.

Macro Definition Documentation

◆ ACCESS_INTERNAL

#define ACCESS_INTERNAL (   VARPOS)
Value:
ModelParameters& VARPOS() noexcept {return X[Index(Variable::VARPOS)];} \
ModelParameters VARPOS() const noexcept {return X[Index(Variable::VARPOS)];}
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39

Definition at line 417 of file linefunctiondata.h.

◆ LSPC [1/3]

#define LSPC (   XVAR,
  PVAR 
)
Value:
Numeric XVAR (Numeric T, Numeric T0, Numeric P [[maybe_unused]], const Vector& vmrs) const noexcept { \
return PVAR * std::inner_product(mdata.cbegin(), mdata.cend(), vmrs.begin(), 0.0, \
std::plus<Numeric>(), [=](const SingleSpeciesModel& x, Numeric vmr) -> Numeric \
{return vmr * x.compute(T, T0, Variable::XVAR);}); \
}
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model&#39;s main calculations.
The Vector class.
Definition: matpackI.h:860
Iterator1D begin()
Return iterator to first element.
Definition: matpackI.cc:144
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33

Definition at line 719 of file linefunctiondata.h.

Referenced by LineShape::Model::this_species().

◆ LSPC [2/3]

#define LSPC (   XVAR,
  PVAR 
)
Value:
Numeric d ## XVAR ## _dVMR (Numeric T, Numeric T0, Numeric P [[maybe_unused]], const Index deriv_pos) const noexcept { \
if(deriv_pos not_eq -1) return PVAR * mdata[deriv_pos].compute(T, T0, Variable::XVAR); \
else return 0; \
}
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Variable
List of possible shape variables.
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Vector compute(const Numeric p, const Numeric t, const Numeric xco2, const Numeric xh2o, const ConstVectorView invcm_grid, const Numeric stotmax, const calctype type)

Definition at line 719 of file linefunctiondata.h.

◆ LSPC [3/3]

#define LSPC (   XVAR,
  PVAR 
)
Value:
Numeric d ## XVAR ## _dT (Numeric T, Numeric T0, Numeric P [[maybe_unused]], const Vector& vmrs) const noexcept { \
return PVAR * std::inner_product(mdata.cbegin(), mdata.cend(), vmrs.begin(), 0.0, \
std::plus<Numeric>(), [=](const SingleSpeciesModel& x, Numeric vmr) -> Numeric \
{return vmr * x.compute_dT (T, T0, Variable::XVAR);}); \
}
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model&#39;s main calculations.
The Vector class.
Definition: matpackI.h:860
Iterator1D begin()
Return iterator to first element.
Definition: matpackI.cc:144
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33

Definition at line 719 of file linefunctiondata.h.

◆ LSPDC

#define LSPDC (   XVAR,
  DERIV,
  PVAR 
)
Value:
Numeric d ## XVAR ## DERIV (Numeric T, Numeric T0, Numeric P [[maybe_unused]], \
Index deriv_pos, const Vector& vmrs) const noexcept { \
if(deriv_pos not_eq -1) \
return vmrs[deriv_pos] * PVAR * mdata[deriv_pos].compute ## DERIV (T, T0, Variable::XVAR); \
else return 0; \
}
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model&#39;s main calculations.
The Vector class.
Definition: matpackI.h:860
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33

◆ MODELPARAMCASEGETTER

#define MODELPARAMCASEGETTER (   X)    case Variable::X: return X ();

◆ MODELPARAMCASESETTER

#define MODELPARAMCASESETTER (   X)    case Variable::X: X () = x; break

◆ RETURNINTERNALDERIVATIVE

#define RETURNINTERNALDERIVATIVE (   TYPE)
Value:
case JacPropMatType::LineShape ## TYPE ## X0: return d ## TYPE ## _dX0(T, T0, P, pos, vmrs); \
case JacPropMatType::LineShape ## TYPE ## X1: return d ## TYPE ## _dX1(T, T0, P, pos, vmrs); \
case JacPropMatType::LineShape ## TYPE ## X2: return d ## TYPE ## _dX2(T, T0, P, pos, vmrs)
Vector vmrs(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const QuantumIdentifier &self, const ArrayOfSpeciesTag &lineshape_species, bool self_in_list, bool bath_in_list, Type type)
Returns a VMR vector for this model&#39;s main calculations.

Referenced by LineShape::Model::GetInternalDeriv().

◆ STRING2VARIABLEDEF

#define STRING2VARIABLEDEF (   X)    if(type == # X) return Variable::X

◆ VARIABLE2STRINGDEF

#define VARIABLE2STRINGDEF (   X)    case Variable::X: return # X

◆ x0

◆ x1

◆ x2

Function Documentation

◆ all_coefficientsLineFunctionData()

ArrayOfString all_coefficientsLineFunctionData ( )

{"X0", "X1", "X2"}

Definition at line 33 of file linefunctiondata.cc.

Referenced by select_derivativeLineShape().

◆ all_variablesLineFunctionData()

ArrayOfString all_variablesLineFunctionData ( )

{"G0", "D0", "G2", "D2", "ETA", "FVC", "Y", "G", "DV"}

Definition at line 36 of file linefunctiondata.cc.

Referenced by select_derivativeLineShape().

◆ select_derivativeLineShape()

JacPropMatType select_derivativeLineShape ( const String var,
const String coeff 
)

Select the derivative that will be used in Jacobian calculations — also checks validity of var and coeff.

Definition at line 38 of file linefunctiondata.cc.