34 #ifndef lineshapemodel_h 35 #define lineshapemodel_h 134 else if (type ==
String(
"T0"))
136 else if (type ==
String(
"T1"))
138 else if (type ==
String(
"T2"))
140 else if (type ==
String(
"T3"))
142 else if (type ==
String(
"T4"))
144 else if (type ==
String(
"T5"))
146 else if (type ==
String(
"LM_AER"))
148 else if (type ==
String(
"DPL"))
152 os <<
"Type: " << type <<
", is not accepted. " 153 <<
"See documentation for accepted types\n";
154 throw std::runtime_error(os.str());
219 #define VARIABLE2STRINGDEF(X) \ 233 #undef VARIABLE2STRINGDEF 247 #define STRING2VARIABLEDEF(X) \ 248 if (type == #X) return Variable::X 260 os <<
"Type: " << type <<
", is not accepted. " 261 <<
"See documentation for accepted types\n";
262 throw std::runtime_error(os.str());
277 Numeric inX0=std::numeric_limits<Numeric>::quiet_NaN(),
278 Numeric inX1=std::numeric_limits<Numeric>::quiet_NaN(),
279 Numeric inX2=std::numeric_limits<Numeric>::quiet_NaN(),
280 Numeric inX3=std::numeric_limits<Numeric>::quiet_NaN())
281 noexcept : type(intype), X0(inX0), X1(inX1), X2(inX2), X3(inX3) {}
298 else if (type ==
"X1")
300 else if (type ==
"X2")
302 else if (type ==
"X3")
306 os <<
"Type: " << type <<
", is not accepted. " 307 <<
"See documentation for accepted types\n";
308 throw std::runtime_error(os.str());
324 return (mp.
X0 == 0 and mp.
X1 == 0);
326 return (mp.
X0 == 0 and mp.
X1 == 0);
330 return (mp.
X0 == 0 and mp.
X1 == 0 and mp.
X2 == 0 and mp.
X3 == 0);
332 return (mp.
X0 == 0 and mp.
X2 == 0);
340 << mp.
X2 <<
' ' << mp.
X3 <<
' ';
347 is >> tmp >> mp.
X0 >> mp.
X1 >> mp.
X2 >> mp.
X3;
361 std::array<ModelParameters, nVars> X;
376 return mp.
X0 + (T - 200) * (mp.
X1 - mp.
X0) / (250 - 200);
378 return mp.
X2 + (T - 296) * (mp.
X3 - mp.
X2) / (340 - 296);
380 return mp.
X1 + (T - 250) * (mp.
X2 - mp.
X1) / (296 - 250);
392 return (mp.
X1 - mp.
X0) / (250 - 200);
394 return (mp.
X3 - mp.
X2) / (340 - 296);
396 return (mp.
X2 - mp.
X1) / (296 - 250);
413 #define x0 X[Index(var)].X0 414 #define x1 X[Index(var)].X1 415 #define x2 X[Index(var)].X2 416 #define x3 X[Index(var)].X3 430 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
437 out =
x0 *
pow(T0 / T,
x1);
break;
439 out =
x0 *
pow(T0 / T,
x1) * (1 +
x2 * log(T / T0));
break;
441 out =
x0 +
x1 * (T -
T0);
break;
443 out = (
x0 + x1 * (T0 / T - 1.)) *
pow(T0 / T,
x2);
break;
445 out =
x0 *
pow(T0 / T, 0.25 + 1.5 * x1);
break;
447 out = special_linemixing_aer(T, X[
Index(
var)]);
break;
449 out =
x0 *
pow(T0 / T, x1) +
x2 *
pow(T0 / T,
x3);
break;
466 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
473 out =
pow(T0 / T,
x1);
break;
475 out =
pow(T0 / T,
x1) * (1 +
x2 * log(T / T0));
break;
479 out =
pow(T0 / T,
x2);
break;
481 out =
pow(T0 / T, 1.5 *
x1 + 0.25);
break;
485 out =
pow(T0 / T,
x1);
break;
502 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
509 out =
x0 *
pow(T0 / T,
x1) * log(T0 / T);
break;
511 out =
x0 *
pow(T0 / T,
x1) * (
x2 * log(T / T0) + 1.) * log(T0 / T);
break;
513 out = (T -
T0);
break;
515 out =
pow(T0 / T,
x2) * (T0 / T - 1.);
break;
517 out = 1.5 *
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * log(T0 / T);
break;
521 out =
x0 *
pow(T0 / T,
x1) * log(T0 / T);
break;
538 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
547 out =
x0 *
pow(T0 / T,
x1) * log(T / T0);
break;
551 out =
pow(T0 / T,
x2) * (
x0 +
x1 * (T0 / T - 1)) * log(T0 / T);
break;
557 out =
pow(T0 / T,
x3);
break;
574 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
593 out =
x2 *
pow(T0 / T,
x3) * log(T0 / T);
break;
610 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
617 out = -
x0 *
x1 *
pow(T0 / T,
x1) / T;
break;
619 out = -
x0 *
x1 *
pow(T0 / T,
x1) * (
x2 * log(T / T0) + 1.) / T +
624 out = -
x2 *
pow(T0 / T,
x2) * (
x0 +
x1 * (T0 / T - 1.)) / T -
627 out = -
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * (1.5 *
x1 + 0.25) / T;
break;
629 out = special_linemixing_aer_dT(T, X[
Index(
var)]);
break;
648 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
657 out =
x0 *
x1 *
pow(T0 / T,
x1) * (
x2 * log(T / T0) + 1.) / T0 -
662 out =
x2 *
pow(T0 / T,
x2) * (
x0 +
x1 * (T0 / T - 1.)) / T0 +
663 x1 *
pow(T0 / T,
x2) / T;
break;
665 out =
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * (1.5 *
x1 + 0.25) /
T0;
break;
679 #define ACCESS_INTERNAL(VARPOS) \ 680 ModelParameters& VARPOS() noexcept { return X[Index(Variable::VARPOS)]; } \ 681 constexpr ModelParameters VARPOS() const noexcept { return X[Index(Variable::VARPOS)]; } 691 #undef ACCESS_INTERNAL 694 std::array<ModelParameters, nVars>&
Data() noexcept {
return X; }
697 const std::array<ModelParameters, nVars>&
Data() const noexcept {
return X; }
705 #define MODELPARAMCASESETTER(X) \ 720 #undef MODELPARAMCASESETTER 730 #define MODELPARAMCASEGETTER(X) case Variable::X: out = X(); break; 744 #undef MODELPARAMCASEGETTER 749 for (
auto&
data: X) {
759 for (
auto&
data: X) {
766 return std::equal (X.cbegin(), X.cend(), other.X.cbegin(), other.X.cend(), [](
const auto& a,
const auto& b){
return a.type == b.type;});
771 inline std::ostream&
operator<<(std::ostream& os,
773 for (
const auto& mp : ssm.
Data())
775 os << mp.
X0 <<
' ' << mp.
X1 <<
' ' << mp.
X2 <<
' ' << mp.
X3 <<
' ';
781 for (
auto& mp : ssm.
Data())
833 return "The line shape type is the Doppler profile\n";
835 return "The line shape type is the Lorentz profile.\n";
837 return "The line shape type is the Voigt profile.\n";
839 return "The line shape type is the speed-dependent Voigt profile.\n";
841 return "The line shape type is the Hartmann-Tran profile.\n";
858 else if (type ==
String(
"LP"))
860 else if (type ==
String(
"VP"))
862 else if (type ==
String(
"SDVP"))
864 else if (type ==
String(
"HTP"))
868 os <<
"Type: " << type <<
", is not accepted. " 869 <<
"See documentation for accepted types\n";
870 throw std::runtime_error(os.str());
889 return os <<
"G0: " << x.
G0 <<
" D0: " << x.
D0 <<
" G2: " << x.
G2 890 <<
" D2: " << x.
D2 <<
" FVC: " << x.
FVC <<
" ETA: " << x.
ETA 891 <<
" Y: " << x.
Y <<
" G: " << x.
G <<
" DV: " << x.
DV;
962 static constexpr
const char*
const bath_broadening =
"AIR";
965 static constexpr
const char*
const self_broadening =
"SELF";
974 std::vector<SingleSpeciesModel> mdata;
981 explicit Model(
const std::vector<SingleSpeciesModel>& assm) noexcept : mdata(assm) {}
987 explicit Model(std::vector<SingleSpeciesModel>&& assm) noexcept : mdata(std::move(assm)) {}
1012 std::array<Numeric, 12> aer_interp =
1013 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) noexcept : mdata(2) {
1020 if (std::any_of(aer_interp.cbegin(), aer_interp.cend(), [](
auto x){
return x not_eq 0;})) {
1022 mdata.front().Y().X0 = aer_interp[4];
1023 mdata.front().Y().X1 = aer_interp[5];
1024 mdata.front().Y().X2 = aer_interp[6];
1025 mdata.front().Y().X3 = aer_interp[7];
1027 mdata.front().G().X0 = aer_interp[8];
1028 mdata.front().G().X1 = aer_interp[9];
1029 mdata.front().G().X2 = aer_interp[10];
1030 mdata.front().G().X3 = aer_interp[11];
1033 mdata.back().Y().X0 = aer_interp[4];
1034 mdata.back().Y().X1 = aer_interp[5];
1035 mdata.back().Y().X2 = aer_interp[6];
1036 mdata.back().Y().X3 = aer_interp[7];
1038 mdata.back().G().X0 = aer_interp[8];
1039 mdata.back().G().X1 = aer_interp[9];
1040 mdata.back().G().X2 = aer_interp[10];
1041 mdata.back().G().X3 = aer_interp[11];
1049 bool OK(
Type type,
bool self,
bool bath,
const std::vector<SpeciesTag>& species)
const noexcept {
1051 Index k = species.size();
1053 bool needs_any = type not_eq
Type::DP;
1054 if (n not_eq k or m > n or (needs_any and not n))
1060 #define LSPC(XVAR, PVAR) \ 1062 Numeric T, Numeric T0, Numeric P [[maybe_unused]], ConstVectorView vmrs) \ 1065 std::inner_product( \ 1070 std::plus<Numeric>(), \ 1071 [=](auto& x, auto vmr) -> Numeric { \ 1072 return vmr * x.compute(T, T0, Variable::XVAR); \ 1086 #define LSPCV(XVAR, PVAR) \ 1087 Numeric d##XVAR##_dVMR(Numeric T, \ 1089 Numeric P [[maybe_unused]], \ 1090 const Index deriv_pos) const noexcept { \ 1091 if (deriv_pos not_eq -1) \ 1092 return PVAR * mdata[deriv_pos].compute(T, T0, Variable::XVAR); \ 1107 #define LSPCT(XVAR, PVAR) \ 1108 Numeric d##XVAR##_dT( \ 1109 Numeric T, Numeric T0, Numeric P [[maybe_unused]], ConstVectorView vmrs) \ 1112 std::inner_product( \ 1117 std::plus<Numeric>(), \ 1118 [=](auto& x, auto vmr) -> Numeric { \ 1119 return vmr * x.compute_dT(T, T0, Variable::XVAR); \ 1134 #define LSPDC(XVAR, DERIV, PVAR) \ 1135 Numeric d##XVAR##DERIV(Numeric T, \ 1137 Numeric P [[maybe_unused]], \ 1139 ConstVectorView vmrs) const noexcept { \ 1140 if (deriv_pos not_eq -1) \ 1141 return vmrs[deriv_pos] * PVAR * \ 1142 mdata[deriv_pos].compute##DERIV(T, T0, Variable::XVAR); \ 1181 LSPDC(G, _dT0, P* P)
1182 LSPDC(G, _dX0, P* P)
1183 LSPDC(G, _dX1, P* P)
1184 LSPDC(G, _dX2, P* P)
1185 LSPDC(G, _dX3, P* P)
1186 LSPDC(DV, _dT0, P* P)
1187 LSPDC(DV, _dX0, P* P)
1188 LSPDC(DV, _dX1, P* P)
1189 LSPDC(DV, _dX2, P* P)
1190 LSPDC(DV, _dX3, P* P)
1206 return {
G0(T, T0, P, vmrs),
1210 FVC(T, T0, P, vmrs),
1211 ETA(T, T0, P, vmrs),
1214 DV(T, T0, P, vmrs)};
1230 return {dG0_dT(T, T0, P, vmrs),
1231 dD0_dT(T, T0, P, vmrs),
1232 dG2_dT(T, T0, P, vmrs),
1233 dD2_dT(T, T0, P, vmrs),
1234 dFVC_dT(T, T0, P, vmrs),
1235 dETA_dT(T, T0, P, vmrs),
1236 dY_dT(T, T0, P, vmrs),
1237 dG_dT(T, T0, P, vmrs),
1238 dDV_dT(T, T0, P, vmrs)};
1252 return {dG0_dVMR(T, T0, P, pos),
1253 dD0_dVMR(T, T0, P, pos),
1254 dG2_dVMR(T, T0, P, pos),
1255 dD2_dVMR(T, T0, P, pos),
1256 dFVC_dVMR(T, T0, P, pos),
1257 dETA_dVMR(T, T0, P, pos),
1258 dY_dVMR(T, T0, P, pos),
1259 dG_dVMR(T, T0, P, pos),
1260 dDV_dVMR(T, T0, P, pos)};
1280 if (pos < 0)
return 0;
1282 #define RETURNINTERNALDERIVATIVE(TYPE) \ 1283 case JacPropMatType::LineShape##TYPE##X0: \ 1284 return d##TYPE##_dX0(T, T0, P, pos, vmrs); \ 1285 case JacPropMatType::LineShape##TYPE##X1: \ 1286 return d##TYPE##_dX1(T, T0, P, pos, vmrs); \ 1287 case JacPropMatType::LineShape##TYPE##X2: \ 1288 return d##TYPE##_dX2(T, T0, P, pos, vmrs); \ 1289 case JacPropMatType::LineShape##TYPE##X3: \ 1290 return d##TYPE##_dX3(T, T0, P, pos, vmrs) 1304 #undef RETURNINTERNALDERIVATIVE 1345 const std::vector<SingleSpeciesModel>&
Data() const noexcept {
return mdata; }
1348 std::vector<SingleSpeciesModel>&
Data() noexcept {
return mdata; }
1358 mdata.erase(mdata.begin() + i);
1359 specs.erase(specs.begin() + i);
1373 for (
auto& ssm : mdata) {
1381 return std::equal (mdata.cbegin(), mdata.cend(), other.mdata.cbegin(), other.mdata.cend(), [](
auto& a,
auto& b) {
return a.MatchTypes(b);});
1404 for (
auto& data: mdata)
1411 for (
auto& data: mdata)
1453 namespace LegacyLineFunctionData {
1481 if (type ==
String(
"DP"))
1483 else if (type ==
String(
"LP"))
1485 else if (type ==
String(
"VP"))
1487 else if (type ==
String(
"SDVP"))
1489 else if (type ==
String(
"HTP"))
1498 os <<
"Type: " << type <<
", is not accepted. " 1499 <<
"See documentation for accepted types\n";
1500 throw std::runtime_error(os.str());
1508 else if (type ==
"LM1")
1510 else if (type ==
"LM2")
1512 else if (type ==
"INT")
1514 else if (type ==
"ConstG")
1518 os <<
"Type: " << type <<
", is not accepted. " 1519 <<
"See documentation for accepted types\n";
1520 throw std::runtime_error(os.str());
1526 namespace LegacyLineMixingData {
1540 return TypeLM::LM_NONE;
1541 else if (type ==
"LL")
1542 return TypeLM::LM_LBLRTM;
1543 else if (type ==
"NR")
1544 return TypeLM::LM_LBLRTM_O2NonResonant;
1545 else if (type ==
"L2")
1546 return TypeLM::LM_2NDORDER;
1547 else if (type ==
"L1")
1548 return TypeLM::LM_1STORDER;
1549 else if (type ==
"BB")
1550 return TypeLM::LM_BYBAND;
1553 os <<
"Type: " << type <<
", is not accepted. " 1554 <<
"See documentation for accepted types\n";
1555 throw std::runtime_error(os.str());
1562 case TypeLM::LM_NONE:
1564 case TypeLM::LM_LBLRTM:
1566 case TypeLM::LM_LBLRTM_O2NonResonant:
1568 case TypeLM::LM_2NDORDER:
1570 case TypeLM::LM_1STORDER:
1572 case TypeLM::LM_BYBAND:
1583 namespace LegacyPressureBroadeningData {
1600 return TypePB::PB_NONE;
1601 else if (type ==
"N2")
1602 return TypePB::PB_AIR_BROADENING;
1603 else if (type ==
"WA")
1604 return TypePB::PB_AIR_AND_WATER_BROADENING;
1605 else if (type ==
"AP")
1606 return TypePB::PB_PLANETARY_BROADENING;
1609 os <<
"Type: " << type <<
", is not accepted. " 1610 <<
"See documentation for accepted types\n";
1611 throw std::runtime_error(os.str());
1618 if (t == TypePB::PB_PLANETARY_BROADENING and
1626 else if (t == TypePB::PB_AIR_AND_WATER_BROADENING and
1636 case TypePB::PB_NONE:
1638 case TypePB::PB_AIR_BROADENING:
1640 case TypePB::PB_AIR_AND_WATER_BROADENING:
1642 case TypePB::PB_PLANETARY_BROADENING:
1663 #endif // lineshapemodel_h
INDEX Index
The type to use for all integer numbers and indices.
Model(Numeric sgam, Numeric nself, Numeric agam, Numeric nair, Numeric psf, std::array< Numeric, 12 > aer_interp={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}) noexcept
Standard HITRAN init.
SingleSpeciesModel & operator[](Index i)
Get a SingleSpeciesModel.
std::istream & operator>>(std::istream &is, ModelParameters &mp)
Input operator for ModelParameters.
void var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the variance of the ranged ys.
TemperatureModel string2temperaturemodel(const String &type)
Turns predefined strings into a TemperatureModel type.
LegacyLineMixingData::TypeLM string2typelm(String type)
Line mixing types from string.
void vector2modelpb(LineShape::Type &mtype, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species, Vector x, LegacyPressureBroadeningData::TypePB type, bool self_in_list)
LineShape::Model from legacy input vector.
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.
std::istream & from_linefunctiondata(std::istream &data, Model &lsc)
Index typepb2nelem(LegacyPressureBroadeningData::TypePB type)
Pressure broadening types to number of elements.
#define MODELPARAMCASESETTER(X)
const std::array< ModelParameters, nVars > & Data() const noexcept
Get const internal Data reference.
Model(Model &&m) noexcept
Init from moving a itself.
void resize(Index n)
Resize function for Model.
constexpr ModelParameters(TemperatureModel intype=TemperatureModel::None, Numeric inX0=std::numeric_limits< Numeric >::quiet_NaN(), Numeric inX1=std::numeric_limits< Numeric >::quiet_NaN(), Numeric inX2=std::numeric_limits< Numeric >::quiet_NaN(), Numeric inX3=std::numeric_limits< Numeric >::quiet_NaN()) noexcept
#define RETURNINTERNALDERIVATIVE(TYPE)
std::vector< SingleSpeciesModel > & Data() noexcept
The line shape model data reference.
Output GetVMRDerivs(Numeric T, Numeric T0, Numeric P, const Index pos) const noexcept
Derivative of GetParams(...) wrt VMR.
std::vector< Variable > linemixingtag2variablesvector(String type)
Line mixing models.
Index temperaturemodel2legacynelem(TemperatureModel type) noexcept
Length per variable.
std::vector< SingleSpeciesModel > mdata
Routines for setting up the jacobian.
Model vector2modellm(Vector x, LegacyLineMixingData::TypeLM type)
LineShape::Model from legacy input vector.
Index Species() const
Molecular species index.
bool OK(Type type, bool self, bool bath, const std::vector< SpeciesTag > &species) const noexcept
The Model is good to use.
Numeric GetInternalDeriv(Numeric T, Numeric T0, Numeric P, Index pos, ConstVectorView vmrs, JacPropMatType deriv) const noexcept
Derivative of GetParams(...) wrt Coefficient.
Index size() const
Number of species in Model.
#define LSPDC(XVAR, DERIV, PVAR)
Constants of physical expressions as constexpr.
bofstream & write(bofstream &bof) const
Binary write for Model.
bool modelparameterEmpty(const ModelParameters mp) noexcept
bool MatchTypes(const SingleSpeciesModel &other) const noexcept
Main line shape model class.
constexpr Numeric special_linemixing_aer(Numeric T, ModelParameters mp) const noexcept
Line mixing as done by AER data in ARTS.
void reserve(Index n)
Reserve function for Model.
bifstream & read(bifstream &bif)
Binary read for Model.
Numeric & SingleModelParameter(ModelParameters &mp, const String &type)
Get a coefficient from ModelParameters by name.
Index typelm2nelem(LegacyLineMixingData::TypeLM type)
Line mixing types to number.
void Remove(Index i, ArrayOfSpeciesTag &specs)
Remove species and data at position.
LineShape::SingleSpeciesModel LineShapeSingleSpeciesModel
Numeric compute_dT(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt T.
LineShape::Model LineShapeModel
bofstream & write(bofstream &bof) const
Binary write for SingleSpeciesModel.
#define MODELPARAMCASEGETTER(X)
bool Match(const Model &other) const noexcept
This file contains basic functions to handle ASCII files.
Numeric compute(Numeric T, Numeric T0, Variable var) const noexcept
Compute the broadening parameter at the input.
const SingleSpeciesModel & operator[](Index i) const
Get a SingleSpeciesModel.
String shapetype2metadatastring(Type type) noexcept
Turns selected Type into a human readable string.
constexpr Output negativeOutput(Output x) noexcept
Output turned negative.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
constexpr SingleSpeciesModel(ModelParameters G0=ModelParameters{}, ModelParameters D0=ModelParameters{}, ModelParameters G2=ModelParameters{}, ModelParameters D2=ModelParameters{}, ModelParameters FVC=ModelParameters{}, ModelParameters ETA=ModelParameters{}, ModelParameters Y=ModelParameters{}, ModelParameters G=ModelParameters{}, ModelParameters DV=ModelParameters{})
Default initialization.
Numeric compute_dX0(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x0.
#define LSPCT(XVAR, PVAR)
const std::vector< SingleSpeciesModel > & Data() const noexcept
The line shape model data.
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
Computations of line shape derived parameters.
bool self_listed(const QuantumIdentifier &qid, LegacyPressureBroadeningData::TypePB t)
Pressure broadening if self exist.
std::istream & from_artscat4(std::istream &is, Model &lsc, const QuantumIdentifier &qid)
Model(std::vector< SingleSpeciesModel > &&assm) noexcept
Init from moving a vector.
#define LSPCV(XVAR, PVAR)
Output GetTemperatureDerivs(Numeric T, Numeric T0, Numeric P, ConstVectorView vmrs) const noexcept
Derivative of GetParams(...) wrt T.
constexpr Index nmaxTempModelParams
Current max number of coefficients.
void Species(Index sp)
Set the Species.
Binary output file stream class.
JacPropMatType select_derivativeLineShape(const String &var, const String &coeff)
Return the derivative type based on string input.
#define STRING2VARIABLEDEF(X)
A tag group can consist of the sum of several of these.
Variable
List of possible shape variables.
Coefficients and temperature model for SingleSpeciesModel.
std::ostream & operator<<(std::ostream &os, Variable v)
Output operator for Variable to be human-readable.
void Set(Variable var, const ModelParameters &x) noexcept
Set variable to a different ModelParameters.
LegacyPressureBroadeningData::TypePB string2typepb(String type)
Pressure broadening types from string.
Class to identify and match lines by their quantum numbers.
void SetLineMixingModel(SingleSpeciesModel x)
Sets the same line mixing model to all species.
NUMERIC Numeric
The type to use for all floating point numbers.
Model(const Model &m) noexcept
Init from copying itself.
ArrayOfString ModelMetaDataArray(const Model &m, const bool self, const bool bath, const ArrayOfSpeciesTag &sts, const Numeric T0)
String modelparameters2metadata(const ModelParameters mp, const Numeric T0)
String shapetype2string(Type type) noexcept
Turns selected Type into a string.
Numeric pow(const Rational base, Numeric exp)
Power of.
std::istream & from_linemixingdata(std::istream &data, Model &lsc)
Legacy reading of old deprecated LineMixingData class.
ArrayOfString AllLineShapeCoeffs()
All available line shape coefficients.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
This can be used to make arrays out of anything.
String temperaturemodel2string(TemperatureModel type) noexcept
Turns selected TemperatureModel type into a string.
Numeric compute_dX2(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x2.
constexpr Output differenceOutput(Output y, Output x) noexcept
Diff of two output.
Numeric compute_dT0(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt T0.
std::array< ModelParameters, nVars > & Data() noexcept
Get internal Data reference.
#define VARIABLE2STRINGDEF(X)
constexpr Output si2cgs(Output x) noexcept
Output turned from SI to CGS units.
#define ACCESS_INTERNAL(VARPOS)
A constant view of a Vector.
Model & operator=(const Model &m)
Copy and equals.
constexpr Output mirroredOutput(Output x) noexcept
Output to be used by mirroring calls.
Model(Index n=0) noexcept
Default init just sets the size.
Index nelem() const
Number of species in Model.
constexpr Numeric freq2kaycm(T x)
std::istream & from_pressurebroadeningdata(std::istream &data, Model &lsc, const QuantumIdentifier &qid)
Binary output file stream class.
Output GetParams(Numeric T, Numeric T0, Numeric P, ConstVectorView vmrs) const noexcept
Compute all shape parameters.
ArrayOfString AllLineShapeVars()
All available line shape variables.
Numeric compute_dX1(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x1.
Numeric compute_dX3(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x3.
constexpr Numeric special_linemixing_aer_dT(Numeric T, ModelParameters mp) const noexcept
The temperature derivative of special_linemixing_aer.
Model & operator=(Model &&m)
Move and equals.
TemperatureModel
Temperature models.
ModelParameters Get(Variable var) const noexcept
Get variable by type.
Compute the line shape parameters for a single broadening species.
Model(const std::vector< SingleSpeciesModel > &assm) noexcept
Init from copying a vector.
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
bifstream & read(bifstream &bif)
Binary read for SingleSpeciesModel.
constexpr Index nVars
Current max number of line shape variables.
String variable2string(Variable type) noexcept
Turns selected Variable type into a string.
Input manipulator class for doubles to enable nan and inf parsing.
String ModelShape2MetaData(const Model &m)
my_basic_string< char > String
The String type for ARTS.
Variable string2variable(const String &type)
Turns predefined strings into a Variable type.
std::vector< Variable > lineshapetag2variablesvector(String type)
Line shape models.
Model MetaData2ModelShape(const String &s)