ARTS  2.4.0(git:4fb77825)
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::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
}
 List of possible shape variables. More...
 
enum  Type : Index {
  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...
 
String modelparameters2metadata (const ModelParameters mp, const Numeric T0)
 
NumericSingleModelParameter (ModelParameters &mp, const String &type)
 Get a coefficient from ModelParameters by name. More...
 
bool modelparameterEmpty (const ModelParameters mp) noexcept
 
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...
 
String shapetype2metadatastring (Type type) noexcept
 Turns selected Type into a human readable 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...
 
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...
 
std::ostream & operator<< (std::ostream &, const Model &)
 
std::istream & operator>> (std::istream &, Model &)
 
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_linemixingdata (std::istream &data, Model &lsc)
 Legacy reading of old deprecated LineMixingData class. More...
 
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 = 4
 Current max number of coefficients. More...
 
constexpr Index nVars = 9
 Current max number of line shape variables. More...
 

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

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 
DPL 

Definition at line 76 of file lineshapemodel.h.

◆ Type

enum LineShape::Type : Index
strong

Type of line shape to compute.

Enumerator
DP 
LP 
VP 
SDVP 
HTP 

Definition at line 788 of file lineshapemodel.h.

◆ Variable

enum LineShape::Variable
strong

List of possible shape variables.

Should correspond to strings in AllLineShapeVars()

Enumerator
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 
)
constexprnoexcept

Diff of two output.

Definition at line 919 of file lineshapemodel.h.

References ARTS::Var::x(), and ARTS::Var::y().

◆ from_artscat4()

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

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,
LineShape::Model lsc 
)

◆ from_pressurebroadeningdata()

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

◆ MetaData2ModelShape()

◆ mirroredOutput()

constexpr Output LineShape::mirroredOutput ( Output  x)
constexprnoexcept

Output to be used by mirroring calls.

Definition at line 895 of file lineshapemodel.h.

References ARTS::Var::x().

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

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

◆ modelparameterEmpty()

bool LineShape::modelparameterEmpty ( const ModelParameters  mp)
inlinenoexcept

Definition at line 313 of file lineshapemodel.h.

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

Referenced by abs_linesSetEmptyBroadeningParametersToEmpty().

◆ modelparameters2metadata()

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

Definition at line 605 of file lineshapemodel.cc.

◆ ModelShape2MetaData()

◆ negativeOutput()

constexpr Output LineShape::negativeOutput ( Output  x)
constexprnoexcept

Output turned negative.

Definition at line 900 of file lineshapemodel.h.

References ARTS::Var::x().

◆ operator<<() [1/5]

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

Definition at line 523 of file lineshapemodel.cc.

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

◆ 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

Output operator for SingleSpeciesModel.

Definition at line 771 of file lineshapemodel.h.

References LineShape::SingleSpeciesModel::Data().

◆ operator<<() [4/5]

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

Output operator for LineShape::Output.

Definition at line 888 of file lineshapemodel.h.

References ARTS::Var::x().

◆ operator<<() [5/5]

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

Output operator for Variable to be human-readable.

Definition at line 176 of file lineshapemodel.h.

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

◆ operator>>() [1/3]

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

Definition at line 530 of file lineshapemodel.cc.

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

◆ operator>>() [2/3]

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

◆ operator>>() [3/3]

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

Input operator for SingleSpeciesModel.

Definition at line 780 of file lineshapemodel.h.

References LineShape::SingleSpeciesModel::Data().

◆ 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 DP.

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 805 of file lineshapemodel.h.

References DP.

Referenced by xml_write_to_stream().

◆ si2cgs()

constexpr Output LineShape::si2cgs ( Output  x)
constexprnoexcept

Output turned from SI to CGS units.

Definition at line 905 of file lineshapemodel.h.

References Conversion::freq2kaycm(), and ARTS::Var::x().

◆ 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 295 of file lineshapemodel.h.

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

◆ 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 855 of file lineshapemodel.h.

References DP.

Referenced by abs_linesSetLineShapeType(), abs_linesSetLineShapeTypeForMatch(), from_linefunctiondata(), 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 131 of file lineshapemodel.h.

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

Referenced by getLineShapeModelParametersType(), MetaData2ModelShape(), 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 246 of file lineshapemodel.h.

References G0, and STRING2VARIABLEDEF.

Referenced by abs_linesChangeLineShapeModelParameterForMatchingLines(), abs_linesSetLineShapeModelParameterForMatchingLines(), MetaData2ModelShape(), and ModelShape2MetaData().

◆ 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 98 of file lineshapemodel.h.

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

Referenced by 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 218 of file lineshapemodel.h.

References G0, and VARIABLE2STRINGDEF.

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 Array< base >::nelem(), ConstVectorView::nelem(), Species, and ConstVectorView::sum().

Referenced by Linefunctions::apply_lineshapemodel_jacobian_scaling(), atm_fields_compactAddConstant(), Absorption::Lines::BroadeningSpeciesVMR(), propmat_clearskyAddHitranLineMixingLines(), Linefunctions::set_cross_section_of_band(), and test_hitran2017().

Variable Documentation

◆ nmaxTempModelParams

constexpr Index LineShape::nmaxTempModelParams = 4
constexpr

Current max number of coefficients.

Definition at line 353 of file lineshapemodel.h.

◆ nVars

constexpr Index LineShape::nVars = 9
constexpr

Current max number of line shape variables.

Definition at line 356 of file lineshapemodel.h.

Referenced by abs_linesSetEmptyBroadeningParametersToEmpty().