Go to the documentation of this file.
34 #ifndef lineshapemodel_h
35 #define lineshapemodel_h
100 case TemperatureModel::None:
112 case TemperatureModel::T5:
114 case TemperatureModel::LM_AER:
133 return TemperatureModel::None;
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"))
145 return TemperatureModel::T5;
146 else if (type ==
String(
"LM_AER"))
147 return TemperatureModel::LM_AER;
148 else if (type ==
String(
"DPL"))
151 std::ostringstream os;
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
259 std::ostringstream os;
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")
305 std::ostringstream os;
306 os <<
"Type: " << type <<
", is not accepted. "
307 <<
"See documentation for accepted types\n";
308 throw std::runtime_error(os.str());
315 case TemperatureModel::None:
324 return (mp.X0 == 0 and mp.X1 == 0);
326 return (mp.X0 == 0 and mp.X1 == 0);
327 case TemperatureModel::T5:
329 case TemperatureModel::LM_AER:
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);
404 ModelParameters G2=ModelParameters{},
405 ModelParameters D2=ModelParameters{},
406 ModelParameters FVC=ModelParameters{},
407 ModelParameters ETA=ModelParameters{},
408 ModelParameters Y=ModelParameters{},
409 ModelParameters G=ModelParameters{},
410 ModelParameters
DV=ModelParameters{})
411 :
X({G0, D0, G2, D2, FVC, ETA, Y, G,
DV}) {}
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();
432 case TemperatureModel::None:
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;
444 case TemperatureModel::T5:
445 out =
x0 *
pow(T0 / T, 0.25 + 1.5 *
x1);
break;
446 case TemperatureModel::LM_AER:
466 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
468 case TemperatureModel::None:
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;
480 case TemperatureModel::T5:
481 out =
pow(T0 / T, 1.5 *
x1 + 0.25);
break;
482 case TemperatureModel::LM_AER:
485 out =
pow(T0 / T,
x1);
break;
502 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
504 case TemperatureModel::None:
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;
516 case TemperatureModel::T5:
517 out = 1.5 *
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * log(T0 / T);
break;
518 case TemperatureModel::LM_AER:
521 out =
x0 *
pow(T0 / T,
x1) * log(T0 / T);
break;
538 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
540 case TemperatureModel::None:
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;
552 case TemperatureModel::T5:
554 case TemperatureModel::LM_AER:
557 out =
pow(T0 / T,
x3);
break;
574 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
576 case TemperatureModel::None:
588 case TemperatureModel::T5:
590 case TemperatureModel::LM_AER:
593 out =
x2 *
pow(T0 / T,
x3) * log(T0 / T);
break;
610 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
612 case TemperatureModel::None:
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 -
626 case TemperatureModel::T5:
627 out = -
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * (1.5 *
x1 + 0.25) / T;
break;
628 case TemperatureModel::LM_AER:
648 Numeric out=std::numeric_limits<Numeric>::quiet_NaN();
650 case TemperatureModel::None:
655 out =
x0 *
x1 *
pow(T0 / T,
x1) / T0;
break;
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;
664 case TemperatureModel::T5:
665 out =
x0 *
pow(T0 / T, 1.5 *
x1 + 0.25) * (1.5 *
x1 + 0.25) / T0;
break;
666 case TemperatureModel::LM_AER:
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;});
773 for (
const auto& mp : ssm.
Data())
774 if (mp.type not_eq TemperatureModel::None)
775 os << mp.X0 <<
' ' << mp.X1 <<
' ' << mp.X2 <<
' ' << mp.X3 <<
' ';
781 for (
auto& mp : ssm.
Data())
782 if(mp.type not_eq TemperatureModel::None)
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"))
867 std::ostringstream os;
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;
896 return {
x.G0, -
x.D0,
x.G2, -
x.D2,
x.FVC,
x.ETA,
x.Y,
x.G, -
x.DV};
901 return {-
x.G0, -
x.D0, -
x.G2, -
x.D2, -
x.FVC, -
x.ETA, -
x.Y, -
x.G, -
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) {
1015 mdata.front().D0() = {TemperatureModel::T5, psf, nair, 0, 0};
1018 mdata.back().D0() = {TemperatureModel::T5, psf, nair, 0, 0};
1020 if (std::any_of(aer_interp.cbegin(), aer_interp.cend(), [](
auto x){return x not_eq 0;})) {
1021 mdata.front().Y().type = TemperatureModel::LM_AER;
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];
1026 mdata.front().G().type = TemperatureModel::LM_AER;
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];
1032 mdata.back().Y().type = TemperatureModel::LM_AER;
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];
1037 mdata.back().G().type = TemperatureModel::LM_AER;
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),
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; }
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);});
1417 std::ostream&
operator<<(std::ostream&,
const Model&);
1418 std::istream&
operator>>(std::istream&, Model&);
1453 namespace LegacyLineFunctionData {
1457 case TemperatureModel::None:
1469 case TemperatureModel::T5:
1471 case TemperatureModel::LM_AER:
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"))
1497 std::ostringstream os;
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")
1517 std::ostringstream os;
1518 os <<
"Type: " << type <<
", is not accepted. "
1519 <<
"See documentation for accepted types\n";
1520 throw std::runtime_error(os.str());
1526 namespace LegacyLineMixingData {
1531 LM_LBLRTM_O2NonResonant,
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")
1552 std::ostringstream os;
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:
1583 namespace LegacyPressureBroadeningData {
1588 PB_AIR_AND_WATER_BROADENING,
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")
1608 std::ostringstream os;
1609 os <<
"Type: " << type <<
", is not accepted. "
1610 <<
"See documentation for accepted types\n";
1611 throw std::runtime_error(os.str());
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:
1663 #endif // lineshapemodel_h
std::istream & operator>>(std::istream &is, ModelParameters &mp)
Input operator for ModelParameters.
void reserve(Index n)
Reserve function for Model.
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.
std::istream & from_linefunctiondata(std::istream &data, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species)
Model(Model &&m) noexcept
Init from moving a itself.
Output GetParams(Numeric T, Numeric T0, Numeric P, ConstVectorView vmrs) const noexcept
Compute all shape parameters.
std::array< ModelParameters, nVars > & Data() noexcept
Get internal Data reference.
Index temperaturemodel2legacynelem(TemperatureModel type) noexcept
Length per variable for temperature model.
Class to identify and match lines by their quantum numbers.
void resize(Index n)
Resize function for Model.
String variable2string(Variable type) noexcept
Turns selected Variable type into a string.
#define VARIABLE2STRINGDEF(X)
String ModelShape2MetaData(const Model &m)
constexpr Numeric special_linemixing_aer(Numeric T, ModelParameters mp) const noexcept
Line mixing as done by AER data in ARTS.
Numeric compute_dT(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt T.
TemperatureModel
Temperature models.
constexpr Output negativeOutput(Output x) noexcept
Output turned negative.
const std::array< ModelParameters, nVars > & Data() const noexcept
Get const internal Data reference.
bool OK(Type type, bool self, bool bath, const std::vector< SpeciesTag > &species) const noexcept
The Model is good to use.
std::vector< SingleSpeciesModel > & Data() noexcept
The line shape model data reference.
constexpr Numeric special_linemixing_aer_dT(Numeric T, ModelParameters mp) const noexcept
The temperature derivative of special_linemixing_aer.
#define RETURNINTERNALDERIVATIVE(TYPE)
constexpr Numeric freq2kaycm(T x)
const SingleSpeciesModel & operator[](Index i) const
Get a SingleSpeciesModel.
Variable string2variable(const String &type)
Turns predefined strings into a Variable type.
Vector y(Workspace &ws) noexcept
ArrayOfString AllLineShapeVars()
All available line shape variables.
Index size() const
Number of species in Model.
Model MetaData2ModelShape(const String &s)
String shapetype2metadatastring(Type type) noexcept
Turns selected Type into a human readable string.
std::ostream & operator<<(std::ostream &os, Variable v)
Output operator for Variable to be human-readable.
#define STRING2VARIABLEDEF(X)
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
bifstream & read(bifstream &bif)
Binary read for SingleSpeciesModel.
Output GetVMRDerivs(Numeric T, Numeric T0, Numeric P, const Index pos) const noexcept
Derivative of GetParams(...) wrt VMR.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
#define LSPDC(XVAR, DERIV, PVAR)
JacPropMatType
List of Jacobian properties for analytical line shape related derivatives.
LineShape::SingleSpeciesModel LineShapeSingleSpeciesModel
std::istream & from_artscat4(std::istream &is, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species, const QuantumIdentifier &qid)
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
JacPropMatType select_derivativeLineShape(const String &var, const String &coeff)
Return the derivative type based on string input.
Model(Index n=0) noexcept
Default init just sets the size.
String modelparameters2metadata(const ModelParameters mp, const Numeric T0)
Index typelm2nelem(LegacyLineMixingData::TypeLM type)
Line mixing types to number.
bofstream & write(bofstream &bof) const
Binary write for SingleSpeciesModel.
Index nelem() const
Number of species in Model.
Numeric compute(Numeric T, Numeric T0, Variable var) const noexcept
Compute the broadening parameter at the input.
Model(std::vector< SingleSpeciesModel > &&assm) noexcept
Init from moving a vector.
bool Match(const Model &other) const noexcept
Numeric pow(const Rational base, Numeric exp)
Power of.
A tag group can consist of the sum of several of these.
Main line shape model class.
Numeric compute_dX0(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x0.
Numeric compute_dX3(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x3.
Numeric compute_dX2(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x2.
Model(const Model &m) noexcept
Init from copying itself.
bool modelparameterEmpty(const ModelParameters mp) noexcept
Compute the line shape parameters for a single broadening species.
void Species(Index sp)
Set the Species.
Model & operator=(Model &&m)
Move and equals.
#define LSPCT(XVAR, PVAR)
#define MODELPARAMCASEGETTER(X)
friend std::istream & from_linefunctiondata(std::istream &data, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species)
Numeric & SingleModelParameter(ModelParameters &mp, const String &type)
Get a coefficient from ModelParameters by name.
Input manipulator class for doubles to enable nan and inf parsing.
#define MODELPARAMCASESETTER(X)
Coefficients and temperature model for SingleSpeciesModel.
friend std::istream & from_artscat4(std::istream &is, Type &type, bool &self, bool &bath, Model &m, ArrayOfSpeciesTag &species, const QuantumIdentifier &qid)
TypePB
Pressure broadening types that used to exist.
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.
constexpr Output mirroredOutput(Output x) noexcept
Output to be used by mirroring calls.
constexpr Index nmaxTempModelParams
Current max number of coefficients.
Routines for setting up the jacobian.
NUMERIC Numeric
The type to use for all floating point numbers.
Binary output file stream class.
Model & operator=(const Model &m)
Copy and equals.
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.
Model(const std::vector< SingleSpeciesModel > &assm) noexcept
Init from copying a vector.
Variable
List of possible shape variables.
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.
std::istream & from_linemixingdata(std::istream &data, Model &lsc)
Legacy reading of old deprecated LineMixingData class.
Type
Type of line shape to compute.
Index self_listed(const QuantumIdentifier &qid, LegacyPressureBroadeningData::TypePB t)
Pressure broadening if self exist.
ArrayOfString ModelMetaDataArray(const Model &m, const bool self, const bool bath, const ArrayOfSpeciesTag &sts, const Numeric T0)
std::vector< SingleSpeciesModel > mdata
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.
bool MatchTypes(const SingleSpeciesModel &other) const noexcept
SingleSpeciesModel & operator[](Index i)
Get a SingleSpeciesModel.
std::vector< Variable > lineshapetag2variablesvector(String type)
Line shape models from string.
Constants of physical expressions as constexpr.
const std::vector< SingleSpeciesModel > & Data() const noexcept
The line shape model data.
Computations of line shape derived parameters.
String temperaturemodel2string(TemperatureModel type) noexcept
Turns selected TemperatureModel type into a string.
my_basic_string< char > String
The String type for ARTS.
Numeric compute_dX1(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt x1.
void SetLineMixingModel(SingleSpeciesModel x)
Sets the same line mixing model to all species.
LineShape::Model LineShapeModel
constexpr Index nVars
Current max number of line shape variables.
String shapetype2string(Type type) noexcept
Turns selected Type into a string.
Numeric compute_dT0(Numeric T, Numeric T0, Variable var) const noexcept
Derivative of compute(...) wrt T0.
Index typepb2nelem(LegacyPressureBroadeningData::TypePB type)
Pressure broadening types to number of elements.
void Set(Variable var, const ModelParameters &x) noexcept
Set variable to a different ModelParameters.
ModelParameters Get(Variable var) const noexcept
Get variable by type.
This file contains basic functions to handle ASCII files.
Vector x(Workspace &ws) noexcept
Numeric GetInternalDeriv(Numeric T, Numeric T0, Numeric P, Index pos, ConstVectorView vmrs, JacPropMatType deriv) const noexcept
Derivative of GetParams(...) wrt Coefficient.
INDEX Index
The type to use for all integer numbers and indices.
TemperatureModel string2temperaturemodel(const String &type)
Turns predefined strings into a TemperatureModel type.
constexpr Output differenceOutput(Output y, Output x) noexcept
Diff of two output.
Model vector2modellm(Vector x, LegacyLineMixingData::TypeLM type)
LineShape::Model from legacy input vector.
LegacyPressureBroadeningData::TypePB string2typepb(String type)
Pressure broadening types from string.
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
bofstream & write(bofstream &bof) const
Binary write for Model.
Output GetTemperatureDerivs(Numeric T, Numeric T0, Numeric P, ConstVectorView vmrs) const noexcept
Derivative of GetParams(...) wrt T.
std::vector< Variable > linemixingtag2variablesvector(String type)
Line mixing models from string.
A constant view of a Vector.
LegacyLineMixingData::TypeLM string2typelm(String type)
Line mixing types from string.
std::array< ModelParameters, nVars > X
void Remove(Index i, ArrayOfSpeciesTag &specs)
Remove species and data at position.
TypeLM
Line mixing types that used to exist.
#define LSPCV(XVAR, PVAR)
ArrayOfString AllLineShapeCoeffs()
All available line shape coefficients.
bifstream & read(bifstream &bif)
Binary read for Model.
Binary output file stream class.
constexpr Output si2cgs(Output x) noexcept
Output turned from SI to CGS units.
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.