ARTS  2.3.1285(git:92a29ea9-dirty)
LineShape Namespace Reference

Computations of line shape derived parameters. More...

Namespaces

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

Classes

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

Enumerations

enum  TemperatureModel : Index {
  TemperatureModel::None, TemperatureModel::T0, TemperatureModel::T1, TemperatureModel::T2,
  TemperatureModel::T3, TemperatureModel::T4, TemperatureModel::T5, TemperatureModel::LM_AER,
  TemperatureModel::None, TemperatureModel::T0, TemperatureModel::T1, TemperatureModel::T2,
  TemperatureModel::T3, TemperatureModel::T4, TemperatureModel::T5, TemperatureModel::LM_AER,
  TemperatureModel::DPL
}
 Temperature models. More...
 
enum  Variable {
  Variable::G0 =0, Variable::D0 =1, Variable::G2 =2, Variable::D2 =3,
  Variable::FVC =4, Variable::ETA =5, Variable::Y =6, Variable::G =7,
  Variable::DV =8, Variable::G0 = 0, Variable::D0 = 1, Variable::G2 = 2,
  Variable::D2 = 3, Variable::FVC = 4, Variable::ETA = 5, Variable::Y = 6,
  Variable::G = 7, Variable::DV = 8
}
 List of possible shape variables. More...
 
enum  Type {
  Type::DP, Type::LP, Type::VP, Type::SDVP,
  Type::HTP, Type::DP, Type::LP, Type::VP,
  Type::SDVP, Type::HTP
}
 
enum  TemperatureModel : Index {
  TemperatureModel::None, TemperatureModel::T0, TemperatureModel::T1, TemperatureModel::T2,
  TemperatureModel::T3, TemperatureModel::T4, TemperatureModel::T5, TemperatureModel::LM_AER,
  TemperatureModel::None, TemperatureModel::T0, TemperatureModel::T1, TemperatureModel::T2,
  TemperatureModel::T3, TemperatureModel::T4, TemperatureModel::T5, TemperatureModel::LM_AER,
  TemperatureModel::DPL
}
 Temperature models. More...
 
enum  Variable {
  Variable::G0 =0, Variable::D0 =1, Variable::G2 =2, Variable::D2 =3,
  Variable::FVC =4, Variable::ETA =5, Variable::Y =6, Variable::G =7,
  Variable::DV =8, Variable::G0 = 0, Variable::D0 = 1, Variable::G2 = 2,
  Variable::D2 = 3, Variable::FVC = 4, Variable::ETA = 5, Variable::Y = 6,
  Variable::G = 7, Variable::DV = 8
}
 List of possible shape variables. More...
 
enum  Type : Index {
  Type::DP, Type::LP, Type::VP, Type::SDVP,
  Type::HTP, Type::DP, Type::LP, Type::VP,
  Type::SDVP, Type::HTP
}
 Type of line shape to compute. More...
 

Functions

String temperaturemodel2string (TemperatureModel type) noexcept
 Turns selected TemperatureModel type into a string. More...
 
TemperatureModel string2temperaturemodel (const String &type)
 Turns predefined strings into a TemperatureModel type. More...
 
std::ostream & operator<< (std::ostream &os, Variable v)
 Output operator for Variable to be human-readable. More...
 
String variable2string (Variable type) noexcept
 Turns selected Variable type into a string. More...
 
Variable string2variable (const String &type)
 Turns predefined strings into a Variable type. More...
 
NumericSingleModelParameter (ModelParameters &mp, const String &type)
 Get a coefficient from ModelParameters by name. More...
 
std::ostream & operator<< (std::ostream &os, const ModelParameters &mp)
 Output operator for ModelParameters. More...
 
std::istream & operator>> (std::istream &is, ModelParameters &mp)
 Input operator for ModelParameters. More...
 
std::ostream & operator<< (std::ostream &os, const SingleSpeciesModel &ssm)
 Output operator for SingleSpeciesModel. More...
 
std::istream & operator>> (std::istream &is, SingleSpeciesModel &ssm)
 Input operator for SingleSpeciesModel. More...
 
String shapetype2string (Type type) noexcept
 Turns selected Type into a string. More...
 
Type string2shapetype (const String &type)
 Turns predefined strings into a Type. More...
 
std::ostream & operator<< (std::ostream &os, Output x)
 Output operator for LineShape::Output. More...
 
constexpr Output mirroredOutput (Output x) noexcept
 Output to be used by mirroring calls. More...
 
constexpr Output negativeOutput (Output x) noexcept
 Output turned negative. More...
 
constexpr Output si2cgs (Output x) noexcept
 Output turned from SI to CGS units. More...
 
constexpr Output differenceOutput (Output y, Output x) noexcept
 Diff of two output. More...
 
std::istream & from_artscat4 (std::istream &is, Model &lsc, const QuantumIdentifier &qid)
 
std::istream & from_linefunctiondata (std::istream &data, Model &lsc)
 
std::istream & from_linemixingdata (std::istream &data, Model &lsc)
 Legacy reading of old deprecated LineMixingData class. More...
 
std::istream & from_pressurebroadeningdata (std::istream &data, Model &lsc, const QuantumIdentifier &qid)
 
std::ostream & operator<< (std::ostream &os, const Model &m)
 
std::istream & operator>> (std::istream &is, Model &m)
 
String modelparameters2metadata (const ModelParameters mp, const Numeric T0)
 
bool modelparameterEmpty (const ModelParameters mp) noexcept
 
String shapetype2metadatastring (Type type) noexcept
 Turns selected Type into a human readable string. More...
 
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's main calculations. More...
 
String ModelShape2MetaData (const Model &m)
 
Model MetaData2ModelShape (const String &s)
 
ArrayOfString ModelMetaDataArray (const Model &m, const bool self, const bool bath, const ArrayOfSpeciesTag &sts, const Numeric T0)
 
std::istream & from_artscat4 (std::istream &is, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species, const QuantumIdentifier &qid)
 
std::istream & from_linefunctiondata (std::istream &data, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species)
 
std::istream & from_pressurebroadeningdata (std::istream &data, LineShape::Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species, const QuantumIdentifier &qid)
 Legacy reading of old deprecated PressureBroadeningData class. More...
 

Variables

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

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

Enumeration Type Documentation

◆ TemperatureModel [1/2]

Temperature models.

Enumerator
None 
T0 
T1 
T2 
T3 
T4 
T5 
LM_AER 
None 
T0 
T1 
T2 
T3 
T4 
T5 
LM_AER 
DPL 

Definition at line 56 of file linefunctiondata.h.

◆ TemperatureModel [2/2]

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

Enumerator
None 
T0 
T1 
T2 
T3 
T4 
T5 
LM_AER 
None 
T0 
T1 
T2 
T3 
T4 
T5 
LM_AER 
DPL 

Definition at line 76 of file lineshapemodel.h.

◆ Type [1/2]

enum LineShape::Type
strong
Enumerator
DP 
LP 
VP 
SDVP 
HTP 
DP 
LP 
VP 
SDVP 
HTP 

Definition at line 490 of file linefunctiondata.h.

◆ Type [2/2]

enum LineShape::Type : Index
strong

Type of line shape to compute.

Enumerator
DP 
LP 
VP 
SDVP 
HTP 
DP 
LP 
VP 
SDVP 
HTP 

Definition at line 788 of file lineshapemodel.h.

◆ Variable [1/2]

enum LineShape::Variable
strong

List of possible shape variables.

Enumerator
G0 
D0 
G2 
D2 
FVC 
ETA 
DV 
G0 
D0 
G2 
D2 
FVC 
ETA 
DV 

Definition at line 100 of file linefunctiondata.h.

◆ Variable [2/2]

enum LineShape::Variable
strong

List of possible shape variables.

Should correspond to strings in AllLineShapeVars()

Enumerator
G0 
D0 
G2 
D2 
FVC 
ETA 
DV 
G0 
D0 
G2 
D2 
FVC 
ETA 
DV 

Definition at line 162 of file lineshapemodel.h.

Function Documentation

◆ differenceOutput()

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

Diff of two output.

Definition at line 567 of file linefunctiondata.h.

References LineShape::Output::G0.

Referenced by LineRecord::GetShapeParams_dVMR(), and shapetype2metadatastring().

◆ from_artscat4() [1/2]

◆ from_artscat4() [2/2]

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

Definition at line 95 of file lineshapemodel.cc.

References LineShape::Model::mdata.

◆ from_linefunctiondata() [1/2]

◆ from_linefunctiondata() [2/2]

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

◆ from_linemixingdata()

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

◆ from_pressurebroadeningdata() [1/2]

◆ from_pressurebroadeningdata() [2/2]

◆ MetaData2ModelShape()

LineShape::Model LineShape::MetaData2ModelShape ( const String s)

◆ mirroredOutput()

constexpr Output LineShape::mirroredOutput ( Output  x)
noexcept

Output to be used by mirroring calls.

Definition at line 548 of file linefunctiondata.h.

References LineShape::Output::G0.

Referenced by Linefunctions::set_cross_section_of_band(), Linefunctions::set_lineshape(), and shapetype2metadatastring().

◆ ModelMetaDataArray()

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

Definition at line 641 of file lineshapemodel.cc.

Referenced by Absorption::Lines::MetaData(), and LineShape::Model::write().

◆ modelparameterEmpty()

◆ modelparameters2metadata()

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

Definition at line 605 of file lineshapemodel.cc.

Referenced by LineShape::ModelParameters::ModelParameters().

◆ ModelShape2MetaData()

◆ negativeOutput()

constexpr Output LineShape::negativeOutput ( Output  x)
noexcept

Output turned negative.

Definition at line 553 of file linefunctiondata.h.

References LineShape::Output::G0.

Referenced by shapetype2metadatastring().

◆ operator<<() [1/5]

std::ostream & LineShape::operator<< ( std::ostream &  os,
Variable  v 
)
inline

Output operator for Variable to be human-readable.

Definition at line 113 of file linefunctiondata.h.

References D0, D2, DV, ETA, FVC, G, G0, G2, and Y.

Referenced by LineShape::SingleSpeciesModel::MatchTypes(), modelparameterEmpty(), LineShape::Model::reserve(), shapetype2metadatastring(), vmrs(), and LineShape::Model::write().

◆ operator<<() [2/5]

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

◆ operator<<() [3/5]

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

◆ operator<<() [4/5]

◆ operator<<() [5/5]

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

◆ operator>>() [1/3]

◆ operator>>() [2/3]

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

◆ operator>>() [3/3]

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

◆ shapetype2metadatastring()

String LineShape::shapetype2metadatastring ( Type  type)
inlinenoexcept

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
String of Type

Definition at line 830 of file lineshapemodel.h.

References D0, LineShape::Output::D0, D2, LineShape::Output::D2, differenceOutput(), DP, DV, LineShape::Output::DV, ETA, LineShape::Output::ETA, Conversion::freq2kaycm(), FVC, LineShape::Output::FVC, G, LineShape::Output::G, G0, LineShape::Output::G0, G2, LineShape::Output::G2, HTP, LP, mirroredOutput(), negativeOutput(), operator<<(), SDVP, si2cgs(), string2shapetype(), vmrs(), VP, Y, and LineShape::Output::Y.

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

◆ shapetype2string()

String LineShape::shapetype2string ( Type  type)
inlinenoexcept

Turns selected Type into a string.

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

Parameters
[in]typeThe Type
Returns
String of Type

Definition at line 498 of file linefunctiondata.h.

References DP, HTP, LP, SDVP, and VP.

Referenced by operator<<(), and xml_write_to_stream().

◆ si2cgs()

constexpr Output LineShape::si2cgs ( Output  x)
noexcept

Output turned from SI to CGS units.

Definition at line 558 of file linefunctiondata.h.

References Conversion::freq2kaycm().

Referenced by shapetype2metadatastring().

◆ SingleModelParameter()

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

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 172 of file linefunctiondata.h.

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

Referenced by abs_linesChangeLineShapeModelParameterForMatchingLines(), LineShape::ModelParameters::ModelParameters(), and LineRecord::SetLineShapeModelParameter().

◆ string2shapetype()

Type LineShape::string2shapetype ( const String type)
inline

Turns predefined strings into a Type.

This function either acts as the inverse of shapetype2string or it throws a runtime error

Parameters
[in]typeThe Type string
Returns
The actual Type

Definition at line 509 of file linefunctiondata.h.

References DP, HTP, LP, SDVP, and VP.

Referenced by abs_linesSetLineShapeType(), abs_linesSetLineShapeTypeForMatch(), from_linefunctiondata(), operator>>(), shapetype2metadatastring(), and xml_read_from_stream().

◆ string2temperaturemodel()

TemperatureModel LineShape::string2temperaturemodel ( const String type)
inline

Turns predefined strings into a TemperatureModel type.

This function either acts as the inverse of temperaturemodel2string or it throws a runtime error

Parameters
[in]typeThe TemperatureModel string
Returns
The actual TemperatureModel type

Definition at line 82 of file linefunctiondata.h.

References LM_AER, None, T0, T1, T2, T3, T4, and T5.

Referenced by getLineShapeModelParametersType(), MetaData2ModelShape(), modelparameterEmpty(), and operator>>().

◆ string2variable()

Variable LineShape::string2variable ( const String type)
inline

Turns predefined strings into a Variable type.

This function either acts as the inverse of variable2string or it throws a runtime error

Parameters
[in]typeThe Variable string
Returns
The actual Variable type

Definition at line 145 of file linefunctiondata.h.

References D0, D2, DV, ETA, FVC, G, G0, G2, STRING2VARIABLEDEF, and Y.

Referenced by abs_linesChangeLineShapeModelParameterForMatchingLines(), abs_linesSetLineShapeModelParameterForMatchingLines(), LineRecord::GetLineShapeModelParameters(), MetaData2ModelShape(), ModelShape2MetaData(), and LineRecord::SetLineShapeModelParameters().

◆ temperaturemodel2string()

String LineShape::temperaturemodel2string ( TemperatureModel  type)
inlinenoexcept

Turns selected TemperatureModel type into a string.

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

Parameters
[in]typeThe temperature model type
Returns
String of temperature model type

Definition at line 68 of file linefunctiondata.h.

References LM_AER, None, T0, T1, T2, T3, T4, and T5.

Referenced by modelparameterEmpty(), ModelShape2MetaData(), and operator<<().

◆ variable2string()

String LineShape::variable2string ( Variable  type)
inlinenoexcept

Turns selected Variable type into a string.

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

Parameters
[in]typeThe Variable type
Returns
String of Variable type

Definition at line 128 of file linefunctiondata.h.

References D0, D2, DV, ETA, FVC, G, G0, G2, VARIABLE2STRINGDEF, and Y.

Referenced by ModelShape2MetaData().

◆ vmrs()

Vector LineShape::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'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

Returns 0s if type is Doppler line shape

Parameters
[in]atmospheric_vmrsVMRS in atmosphere
[in]atmospheric_speciesSpecies in atmosphere
[in]selfAn ID of whichever species is self
[in]lineshape_speciesSpecies affecting lineshape
[in]self_in_listAffects lineshape by itself?
[in]bath_in_listAffected lineshape by environment?
[in]typeThe type of line shape

Definition at line 474 of file lineshapemodel.cc.

References data, LineShape::Model::Data(), i, Array< base >::nelem(), ConstVectorView::nelem(), operator<<(), operator>>(), Species, and ConstVectorView::sum().

Referenced by atm_fields_compactAddConstant(), Absorption::Lines::BroadeningSpeciesVMR(), PressureBroadeningData::DataError(), Absorption::Lines::DoLineMixing(), Linefunctions::ExpectedDataSize(), LineRecord::GetPrepInternalDerivative(), LineRecord::GetPrepShapeParams(), LineRecord::GetPrepShapeParams_dT(), propmat_clearskyAddHitranLineMixingLines(), shapetype2metadatastring(), and test_hitran2017().

Variable Documentation

◆ nmaxInterpModels

constexpr Index LineShape::nmaxInterpModels =12

Definition at line 202 of file linefunctiondata.h.

◆ nmaxTempModelParams

constexpr Index LineShape::nmaxTempModelParams =3

Current max number of coefficients.

Definition at line 200 of file linefunctiondata.h.

Referenced by modelparameterEmpty().

◆ nVars

constexpr Index LineShape::nVars =9

Current max number of line shape variables.

Definition at line 201 of file linefunctiondata.h.

Referenced by abs_linesSetEmptyBroadeningParametersToEmpty(), and modelparameterEmpty().