41 for(
size_t i=0;
i<mlocalquanta.size();
i++)
42 if(mlocalquanta[
i] == qnt)
43 return mlines[k].LowerQuantumNumber(
i);
44 return mquantumidentity.LowerQuantumNumber(qnt);
48 for(
size_t i=0;
i<mlocalquanta.size();
i++)
49 if(mlocalquanta[
i] == qnt)
50 return mlines[k].UpperQuantumNumber(
i);
51 return mquantumidentity.UpperQuantumNumber(qnt);
55 for(
size_t i=0;
i<mlocalquanta.size();
i++)
56 if(mlocalquanta[
i] == qnt)
57 return mlines[k].LowerQuantumNumber(
i);
58 return mquantumidentity.LowerQuantumNumber(qnt);
62 for(
size_t i=0;
i<mlocalquanta.size();
i++)
63 if(mlocalquanta[
i] == qnt)
64 return mlines[k].UpperQuantumNumber(
i);
65 return mquantumidentity.UpperQuantumNumber(qnt);
69 auto x = mlines[k].LineShape().GetParams(T, mT0, P,
vmrs);
71 if (not DoLineMixing(P)) x.
Y = x.G = x.DV = 0;
77 auto x = mlines[k].LineShape().GetTemperatureDerivs(T, mT0, P,
vmrs);
79 if (not DoLineMixing(P)) x.
Y = x.G = x.DV = 0;
86 if(mselfbroadening and spec == mquantumidentity.Species())
91 if(spec == mbroadeningspecies[
i].
Species())
97 return Index(mbroadeningspecies.size())-
Index(mbathbroadening);
103 const auto self = vmr_qid.Species() == mquantumidentity.Species();
104 const auto& ls = mlines[k].LineShape();
106 if (mselfbroadening and
self) {
107 auto x = ls.GetVMRDerivs(T, mT0, P, 0);
111 T, mT0, P, ls.nelem() - 1));
113 if (not DoLineMixing(P)) x.Y = x.G = x.DV = 0;
116 }
else if (mbathbroadening and
self)
117 return {0, 0, 0, 0, 0, 0, 0, 0, 0};
119 auto x = ls.GetVMRDerivs(T, mT0, P, LineShapePos(vmr_qid));
123 T, mT0, P, ls.nelem() - 1));
125 if (not DoLineMixing(P)) x.Y = x.G = x.DV = 0;
132 const auto self = derivative.Mode() == LineShape::self_broadening;
133 const auto bath = derivative.Mode() == LineShape::bath_broadening;
134 const auto& ls = mlines[k].LineShape();
136 if(derivative.QuantumIdentity().Species() not_eq
Species() or
137 derivative.QuantumIdentity().Isotopologue() not_eq
Isotopologue())
139 else if(
self and mselfbroadening)
140 return ls.GetInternalDeriv(
141 T, mT0, P, 0,
vmrs, derivative.PropMatType());
143 return ls.GetInternalDeriv(
145 else if(bath and mbathbroadening)
146 return ls.GetInternalDeriv(
147 T, mT0, P, ls.nelem() - 1,
vmrs, derivative.PropMatType());
151 return ls.GetInternalDeriv(
169 static map<String, SpecIsoMap> ArtsMap;
172 static bool hinit =
false;
181 ArtsMap[buf] = indicies;
197 if (is.eof())
return data;
200 if (!is)
throw runtime_error(
"Stream bad.");
209 if (line.
nelem() == 0 && is.eof())
return data;
227 if (artsid.length() != 0) {
230 const map<String, SpecIsoMap>::const_iterator
i = ArtsMap.find(artsid);
231 if (i == ArtsMap.end()) {
233 os <<
"ARTS Tag: " << artsid <<
" is unknown.";
234 throw runtime_error(os.
str());
259 icecream >> data.
line.
E0();
283 for (
Index j = 0; j < naux; j++) {
298 }
catch (
const std::runtime_error&) {
302 if (tgam != data.
T0) {
303 agam = agam *
pow(tgam / data.
T0, nair);
304 sgam = sgam *
pow(tgam / data.
T0, nself);
330 static map<String, SpecIsoMap> ArtsMap;
333 static bool hinit =
false;
343 ArtsMap[buf] = indicies;
359 if (is.eof())
return data;
362 if (!is)
throw runtime_error(
"Stream bad.");
371 if (line.
nelem() == 0 && is.eof())
return data;
389 if (artsid.length() != 0) {
392 const map<String, SpecIsoMap>::const_iterator
i = ArtsMap.find(artsid);
393 if (i == ArtsMap.end()) {
395 os <<
"ARTS Tag: " << artsid <<
" is unknown.";
396 throw runtime_error(os.
str());
435 String mquantum_numbers_str;
436 getline(icecream, mquantum_numbers_str);
438 mquantum_numbers_str.trim();
448 Rational(atoi(mquantum_numbers_str.substr(0, 3).c_str())));
451 Rational(atoi(mquantum_numbers_str.substr(6, 3).c_str())));
454 Rational(atoi(mquantum_numbers_str.substr(3, 3).c_str())));
457 Rational(atoi(mquantum_numbers_str.substr(9, 3).c_str())));
460 if (mquantum_numbers_str.nelem() >= 25) {
462 String vstr = mquantum_numbers_str.substr(0, 3);
464 for (
Index vi = 0; vi < 3; vi++) {
476 String qstr1 = mquantum_numbers_str.substr(4, 12);
477 String qstr2 = mquantum_numbers_str.substr(4 + 12 + 1, 12);
479 for (
Index qi = 0; qi < 3; qi++) {
480 if (qstr1.substr(0, 4) !=
" ")
485 for (
Index qi = 3; qi < 6; qi++) {
486 if (qstr2.substr(0, 4) !=
" ")
523 static map<String, SpecIsoMap> ArtsMap;
526 static bool hinit =
false;
529 bool lmd_found =
false;
539 ArtsMap[buf] = indicies;
555 if (is.eof())
return data;
558 if (!is)
throw runtime_error(
"Stream bad.");
567 if (line.
nelem() == 0 && is.eof())
return data;
586 if (artsid.length() != 0) {
589 const map<String, SpecIsoMap>::const_iterator
i = ArtsMap.find(artsid);
590 if (i == ArtsMap.end()) {
592 os <<
"ARTS Tag: " << artsid <<
" is unknown.";
593 throw runtime_error(os.
str());
639 }
else if (token ==
"QN") {
645 os <<
"Unknown quantum number tag: " << token;
646 throw std::runtime_error(os.
str());
656 if (token ==
"LO")
break;
659 if (!is || token !=
"LO") {
661 os <<
"Error in catalog. Lower quantum number tag 'LO' not found.";
662 throw std::runtime_error(os.str());
671 }
else if (token ==
"LM") {
675 }
else if (token ==
"LF") {
683 }
else if (token ==
"ZM") {
687 }
else if (token ==
"LSM") {
696 if (token ==
"CUT") {
698 data.
cutoff = CutoffType::LineByLineOffset;
702 if (token ==
"LML") {
707 else if (token ==
"MTM") {
715 else if (token ==
"LNT") {
724 os <<
"Unknown line modifications given: " << token;
725 throw std::runtime_error(os.
str());
731 os <<
"Unknown line data tag: " << token;
732 throw std::runtime_error(os.
str());
736 }
catch (
const std::runtime_error& e) {
738 os <<
"Parse error in catalog line: " << endl;
741 throw std::runtime_error(os.
str());
780 static bool hinit =
false;
812 iso_tags.resize(n_iso);
813 for (
Index j = 0; j < n_iso; ++j) {
824 hiso[mo].resize(
max(iso_tags) % 10 + 1);
828 for (
Index j = 0; j < n_iso; ++j) {
833 hiso[mo][iso_tags[j] % 10] = j;
855 if (is.eof())
return data;
858 if (!is)
throw runtime_error(
"Stream bad.");
867 if (line.
nelem() == 0 && is.eof())
return data;
871 if (line[line.
nelem() - 1] == 13) {
872 line.erase(line.
nelem() - 1, 1);
888 if (missing != hspec[mo]) {
894 if ((nChar == 161 && line[158] !=
' ') || nChar > 161) {
896 os <<
"Invalid HITRAN 2004 line data record with " << nChar
897 <<
" characters (expected: 160).";
898 throw std::runtime_error(os.
str());
920 if (iso < hiso[mo].
nelem())
927 <<
", isotopologue iso = " << iso <<
" is unknown.";
928 throw std::runtime_error(os.
str());
938 const Numeric w2Hz = Constant::c * 100.;
944 data.
line.
F0() = v * w2Hz;
959 const Numeric hi2arts = 1e-2 * Constant::c;
966 data.
line.
I0() = s * hi2arts;
988 const Numeric w2Hz = Constant::c * 1e2;
990 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
996 agam = gam * hi2arts;
1002 sgam = gam * hi2arts;
1005 if (0 == sgam) sgam = agam;
1041 const Numeric w2Hz = Constant::c * 1e2;
1043 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
1055 const String qstr = line.substr(0, 15 * 4);
1151 std::vector<std::array<String, 2>> out(0);
1154 auto pos_semicolon = qns.find(
";");
1155 while (pos_semicolon < qns.length() and (pos_semicolon > 0)) {
1156 String var = qns.substr(0, pos_semicolon);
1157 qns.erase(0, pos_semicolon + 1);
1159 const auto pos_equality = var.find(
"=");
1160 out.push_back({var.substr(0, pos_equality), var.substr(pos_equality+1, var.length())});
1161 pos_semicolon = qns.find(
";");
1164 const auto pos_equality = qns.find(
"=");
1165 out.push_back({qns.substr(0, pos_equality), qns.substr(pos_equality+1, qns.length())});
1199 static bool hinit =
false;
1231 iso_tags.resize(n_iso);
1232 for (
Index j = 0; j < n_iso; ++j) {
1243 hiso[mo].resize(
max(iso_tags) % 10 + 1);
1247 for (
Index j = 0; j < n_iso; ++j) {
1248 if (0 < iso_tags[j])
1252 hiso[mo][iso_tags[j] % 10] = j;
1270 bool comment =
true;
1274 if (is.eof())
return data;
1277 if (!is)
throw runtime_error(
"Stream bad.");
1286 if (line.
nelem() == 0 && is.eof())
return data;
1290 if (line[line.
nelem() - 1] == 13) {
1291 line.erase(line.
nelem() - 1, 1);
1307 if (missing != hspec[mo]) {
1328 if (iso < hiso[mo].
nelem())
1335 <<
", isotopologue iso = " << iso <<
" is unknown.";
1336 throw std::runtime_error(os.
str());
1346 const Numeric w2Hz = Constant::c * 100.;
1352 data.
line.
F0() = v * w2Hz;
1367 const Numeric hi2arts = 1e-2 * Constant::c;
1374 data.
line.
I0() = s * hi2arts;
1396 const Numeric w2Hz = Constant::c * 1e2;
1398 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
1404 agam = gam * hi2arts;
1410 sgam = gam * hi2arts;
1413 if (0 == sgam) sgam = agam;
1449 const Numeric w2Hz = Constant::c * 1e2;
1451 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
1550 ss >> upper >> lower;
1588 static bool hinit =
false;
1620 iso_tags.resize(n_iso);
1621 for (
Index j = 0; j < n_iso; ++j) {
1632 hiso[mo].resize(
max(iso_tags) % 10 + 1);
1636 for (
Index j = 0; j < n_iso; ++j) {
1637 if (0 < iso_tags[j])
1641 hiso[mo][iso_tags[j] % 10] = j;
1659 bool comment =
true;
1663 if (is.eof())
return data;
1666 if (!is)
throw runtime_error(
"Stream bad.");
1675 if (line.
nelem() == 0 && is.eof())
return data;
1679 if (line[line.
nelem() - 1] == 13) {
1680 line.erase(line.
nelem() - 1, 1);
1696 if (missing != hspec[mo]) {
1704 os <<
"Invalid HITRAN 1986-2001 line data record with " << nChar
1705 <<
" characters (expected: 100)." << endl
1706 << line <<
" n: " << line.
nelem();
1707 throw runtime_error(os.
str());
1728 if (iso < hiso[mo].
nelem())
1735 <<
", isotopologue iso = " << iso <<
" is unknown.";
1736 throw runtime_error(os.
str());
1746 const Numeric w2Hz = Constant::c * 100.;
1752 data.
line.
F0() = v * w2Hz;
1768 const Numeric hi2arts = 1e-2 * Constant::c;
1775 data.
line.
I0() = s * hi2arts;
1796 const Numeric w2Hz = Constant::c * 1e2;
1798 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
1804 agam = gam * hi2arts;
1810 sgam = gam * hi2arts;
1813 if (0 == sgam) sgam = agam;
1849 const Numeric w2Hz = Constant::c * 1e2;
1851 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
1950 static bool hinit =
false;
1979 iso_tags.resize(n_iso);
1980 for (
Index j = 0; j < n_iso; ++j) {
1991 hiso[mo].resize(
max(iso_tags) % 10 + 1);
1995 for (
Index j = 0; j < n_iso; ++j) {
1996 if (0 < iso_tags[j])
2000 hiso[mo][iso_tags[j] % 10] = j;
2018 bool comment =
true;
2022 if (is.eof())
return data;
2025 if (!is)
throw std::runtime_error(
"Stream bad.");
2034 if (line.
nelem() == 0 && is.eof())
return data;
2038 if (line[line.
nelem() - 1] == 13) {
2039 line.erase(line.
nelem() - 1, 1);
2055 if (missing != hspec[mo]) {
2063 os <<
"Invalid HITRAN 1986-2001 line data record with " << nChar
2064 <<
" characters (expected: 100)." << endl
2065 << line <<
" n: " << line.
nelem();
2066 throw std::runtime_error(os.
str());
2088 if (iso < hiso[mo].
nelem())
2095 <<
", isotopologue iso = " << iso <<
" is unknown.";
2096 throw std::runtime_error(os.
str());
2106 const Numeric w2Hz = Constant::c * 100.;
2112 data.
line.
F0() = v * w2Hz;
2128 const Numeric hi2arts = 1e-2 * Constant::c;
2131 if (line[6] ==
'D') line[6] =
'E';
2137 data.
line.
I0() = s * hi2arts;
2158 const Numeric w2Hz = Constant::c * 1e2;
2160 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
2166 agam = gam * hi2arts;
2172 sgam = gam * hi2arts;
2175 if (0 == sgam) sgam = agam;
2211 const Numeric w2Hz = Constant::c * 1e2;
2213 const Numeric hi2arts = w2Hz / Conversion::ATM2PA;
2246 String helper = line.substr(0, 9);
2247 Index DJ = -helper.compare(3, 1,
"Q");
2248 Index DN = -helper.compare(0, 1,
"Q");
2249 Index N = atoi(helper.substr(1, 2).c_str());
2250 Index J = atoi(helper.substr(4, 2).c_str());
2306 if (test == -1 || test == -3)
2326 throw std::runtime_error(
"There is an error in the line mixing\n");
2379 Y /= Conversion::ATM2PA;
2380 G /= Conversion::ATM2PA / Conversion::ATM2PA;
2409 }
else if (test == -3) {
2436 const std::vector<QuantumNumberType>& localquantas,
2437 const std::vector<QuantumNumberType>& globalquantas)
2439 std::vector<Lines> lines(0);
2440 std::vector<Rational> lowerquanta_local(localquantas.size());
2441 std::vector<Rational> upperquanta_local(localquantas.size());
2442 std::vector<Rational> lowerquanta_global(globalquantas.size());
2443 std::vector<Rational> upperquanta_global(globalquantas.size());
2446 while(external_lines.size()) {
2447 auto& sle = external_lines.back();
2450 std::transform(localquantas.cbegin(), localquantas.cend(), lowerquanta_local.begin(),
2451 [&](
auto qn){
return sle.quantumidentity.LowerQuantumNumber(qn);});
2452 std::transform(localquantas.cbegin(), localquantas.cend(), upperquanta_local.begin(),
2453 [&](
auto qn){
return sle.quantumidentity.UpperQuantumNumber(qn);});
2454 std::transform(globalquantas.cbegin(), globalquantas.cend(), lowerquanta_global.begin(),
2455 [&](
auto qn){
return sle.quantumidentity.LowerQuantumNumber(qn);});
2456 std::transform(globalquantas.cbegin(), globalquantas.cend(), upperquanta_global.begin(),
2457 [&](
auto qn){
return sle.quantumidentity.UpperQuantumNumber(qn);});
2460 auto line = sle.line;
2461 line.LowerQuantumNumbers() = lowerquanta_local;
2462 line.UpperQuantumNumbers() = upperquanta_local;
2465 const QuantumIdentifier qid(sle.quantumidentity.Species(), sle.quantumidentity.Isotopologue(),
2466 globalquantas, upperquanta_global, lowerquanta_global);
2469 auto band = std::find_if(lines.begin(), lines.end(), [&](
const Lines& li){
return li.MatchWithExternal(sle, qid);});
2470 if (band not_eq lines.end()) {
2471 band -> AppendSingleLine(line);
2473 lines.push_back(
Lines(sle.selfbroadening, sle.bathbroadening, sle.cutoff,
2474 sle.mirroring, sle.population, sle.normalization,
2475 sle.lineshapetype, sle.T0, sle.cutofffreq,
2476 sle.linemixinglimit, qid, localquantas, sle.species, {line}));
2478 external_lines.pop_back();
2499 os << line.
F0() <<
' ' 2502 << line.
g_low() <<
' ' 2503 << line.
g_upp() <<
' ' 2556 return spr.
Name() +
"-" +
2584 os <<
"\nLines meta-data:\n";
2585 os <<
'\t' <<
"Species identity:\n";
2594 os <<
'\t' <<
"The reference temperature for all line parameters is " 2597 os <<
'\t' <<
"If applicable, there is no line mixing limit.\n";
2599 os <<
'\t' <<
"If applicable, there is a line mixing limit at " 2603 os <<
"\tNo line data is available.\n";
2606 os <<
"\tThere are " <<
NumLines() <<
" lines available.\n";
2608 auto& line =
mlines.front();
2609 os <<
"\tThe front line has:\n";
2610 os <<
"\t\t" <<
"f0: " << line.F0() <<
" Hz\n";
2611 os <<
"\t\t" <<
"i0: " << line.I0() <<
" m^2/Hz\n";
2612 os <<
"\t\t" <<
"e0: " << line.E0() <<
" J\n";
2613 os <<
"\t\t" <<
"Lower stat. weight: " << line.g_low() <<
" [-]\n";
2614 os <<
"\t\t" <<
"Upper stat. weight: " << line.g_upp() <<
" [-]\n";
2615 os <<
"\t\t" <<
"A: " << line.A() <<
" 1/s\n";
2616 os <<
"\t\t" <<
"Zeeman splitting of lower state: " << line.Zeeman().gl() <<
" [-]\n";
2617 os <<
"\t\t" <<
"Zeeman splitting of upper state: " << line.Zeeman().gu() <<
" [-]\n";
2618 os <<
"\t\t" <<
"Lower state local quantum numbers:";
2621 <<
"=" << line.LowerQuantumNumber(i) <<
";";
2623 os <<
"\t\t" <<
"Upper state local quantum numbers:";
2626 <<
"=" << line.UpperQuantumNumber(i) <<
";";
2633 os <<
"\t\t" <<
"Line shape parameters (are normalized by sum(VMR)):\n";
2634 for(
auto& ls_form: ls_meta)
2635 os <<
"\t\t\t" << ls_form <<
"\n";
2646 std::vector<size_t> hits(0);
2651 for (
auto& line:
mlines) {
2652 if (line.LowerQuantumNumber(
i).isDefined() or line.UpperQuantumNumber(
i).isDefined()) {
2663 while (not hits.empty()) {
2672 for (
auto& line:
mlines) {
2673 line.LowerQuantumNumbers().erase(line.LowerQuantumNumbers().begin() + x);
2674 line.UpperQuantumNumbers().erase(line.UpperQuantumNumbers().begin() + x);
2682 std::equal(mlowerquanta.cbegin(), mlowerquanta.cend(), sl.mlowerquanta.cbegin(), sl.mlowerquanta.cend()) and
2683 std::equal(mupperquanta.cbegin(), mupperquanta.cend(), sl.mupperquanta.cbegin(), sl.mupperquanta.cend()) ;
2703 al.Population(), al.Normalization(), al.LineShapeType(),
2704 al.T0(), al.CutoffFreqValue(), al.LinemixingLimit(),
2705 al.QuantumIdentity(), al.LocalQuanta(), al.BroadeningSpecies());
2740 if (atm_vmrs.
nelem() not_eq atm_spec.
nelem())
2741 throw std::runtime_error(
"Bad species and vmr lists");
2744 if (atm_spec[
i].
nelem() and atm_spec[
i][0].Species() ==
Species())
2751 if (band.
Species() !=
id.Species())
2760 throw std::runtime_error(
"Cannot match energy level to line");
2766 if ((qn_id.isUndefined() and qn_line.isDefined()) or
2767 (qn_line.isDefined() and qn_line not_eq qn_id)) {
2776 if ((qn_id.isUndefined() and qn_line.isDefined()) or
2777 (qn_line.isDefined() and qn_line not_eq qn_id)) {
2788 if (band.
Species() !=
id.Species())
2797 throw std::runtime_error(
"Cannot match transition level to energy level");
2803 if ((qn_id.isUndefined() and qn_line.isDefined()) or
2804 (qn_line.isDefined() and qn_line not_eq qn_id)) {
2815 if (band.
Species() !=
id.Species())
2824 throw std::runtime_error(
"Cannot match transition level to energy level");
2830 if ((qn_id.isUndefined() and qn_line.isDefined()) or
2831 (qn_line.isDefined() and qn_line not_eq qn_id)) {
2842 if (band.
Species() !=
id.Species())
2851 throw std::runtime_error(
"Cannot match energy level to line");
2857 if ((qn_line.isUndefined() and qn_id.isDefined()) or
2858 (qn_id.isDefined() and qn_id not_eq qn_line)) {
2867 if ((qn_line.isUndefined() and qn_id.isDefined()) or
2868 (qn_id.isDefined() and qn_id not_eq qn_line)) {
2879 if (band.
Species() !=
id.Species())
2888 throw std::runtime_error(
"Cannot match transition level to energy level");
2894 if ((qn_line.isUndefined() and qn_id.isDefined()) or
2895 (qn_id.isDefined() and qn_id not_eq qn_line)) {
2906 if (band.
Species() !=
id.Species())
2915 throw std::runtime_error(
"Cannot match transition level to energy level");
2921 if ((qn_line.isUndefined() and qn_id.isDefined()) or
2922 (qn_id.isDefined() and qn_id not_eq qn_line)) {
2940 if (not
even(Jf + lf + 1))
2941 return -
sqrt(2 * Jf + 1) *
wigner3j(Jf, k, Ji, li, lf - li, -lf);
2943 return +
sqrt(2 * Jf + 1) *
wigner3j(Jf, k, Ji, li, lf - li, -lf);
2947 if (not
even(Jf + N))
2948 return -
sqrt(6 * (2 * Jf + 1) * (2 * Ji + 1)) *
wigner6j(1_rat, 1_rat, 1_rat, Ji, Jf, N);
2950 return +
sqrt(6 * (2 * Jf + 1) * (2 * Ji + 1)) *
wigner6j(1_rat, 1_rat, 1_rat, Ji, Jf, N);
2983 static bool hinit =
false;
3011 iso_tags.resize(n_iso);
3012 for (
Index j = 0; j < n_iso; ++j) {
3023 hiso[mo].resize(
max(iso_tags) % 10 + 1);
3027 for (
Index j = 0; j < n_iso; ++j) {
3028 if (0 < iso_tags[j])
3033 hiso[mo][iso_tags[j] % 10] = j;
3051 bool comment =
true;
3055 if (is.eof())
return data;
3058 if (!is)
throw runtime_error(
"Stream bad.");
3067 if (line.
nelem() == 0 && is.eof())
return data;
3083 if (missing != hspec[mo])
3088 if (0 == std::count(warned_missing.begin(), warned_missing.end(), mo)) {
3089 warned_missing.push_back(mo);
3110 if (iso < hiso[mo].
nelem())
3117 <<
", isotopologue iso = " << iso <<
" is unknown.";
3118 throw runtime_error(os.
str());
3130 data.
line.
F0() = v * 1E6;
3162 data.
line.
I0() = s * hi2arts;
3296 if (tgam != data.
T0) {
3297 agam *=
pow(tgam / data.
T0, nair);
3298 sgam *=
pow(tgam / data.
T0, nself);
3326 static map<Index, SpecIsoMap> JplMap;
3329 static bool hinit =
false;
3352 bool comment =
true;
3356 if (is.eof())
return data;
3359 if (!is)
throw runtime_error(
"Stream bad.");
3368 if (line.
nelem() == 0 && is.eof())
return data;
3385 data.
line.
F0() = v * 1E6;
3416 data.
line.
I0() = s / 1E12;
3454 tag = tag > 0 ? tag : -tag;
3460 const map<Index, SpecIsoMap>::const_iterator
i = JplMap.find(tag);
3461 if (i == JplMap.end()) {
3463 os <<
"JPL Tag: " << tag <<
" is unknown.";
3464 throw runtime_error(os.
str());
3541 if (std::any_of(
mlines.cbegin(),
mlines.cend(), [nb](
auto& line){
return line.LineShapeElems() != nb;}))
3545 if (std::any_of(
mlines.cbegin(),
mlines.cend(), [nq](
auto& line){
return line.LowerQuantumElems() != nq or line.UpperQuantumElems() != nq;}))
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
INDEX Index
The type to use for all integer numbers and indices.
std::vector< SingleLine > mlines
A list of individual lines.
LineShape::Type lineshapetype
std::ostream & operator<<(std::ostream &os, const ArrayOfAbsorptionLines &aol)
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
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.
Computations and data for a single absorption line.
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)
LineShape::Type mlineshapetype
Type of line shape.
void update_id(QuantumIdentifier &qid, const std::vector< std::array< String, 2 > > &upper_list, const std::vector< std::array< String, 2 > > &lower_list)
Updates the quantum identifier based on a lists of strings.
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
const ArrayOfSpeciesTag & BroadeningSpecies() const noexcept
Returns the broadening species.
String LowerQuantumNumbers() const noexcept
Lower quantum numbers string.
Index nelem() const
Number of elements.
void Isotopologue(Index iso)
Set the Isotopologue.
QuantumIdentifier::QType Index LowerQuantumNumbers Species
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
bool SameQuantumNumbers(const SingleLine &sl) const noexcept
Checks if the quantum numbers are the same of the two lines.
Numeric F0() const noexcept
Central frequency.
MirroringType mmirroring
Mirroring type.
SingleLineExternal ReadFromMytran2Stream(istream &is)
Read from Mytran2 The MYTRAN2 format is as follows (directly taken from the abs_my.c documentation):
Rational LowerQuantumNumber(size_t k, QuantumNumberType qnt) const noexcept
Quantum number lower level.
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
QuantumIdentifier mquantumidentity
Catalog ID.
void ReverseLines() noexcept
Reverses the order of the internal lines.
Index Isotopologue() const noexcept
Isotopologue Index.
String UpperQuantumNumbers() const noexcept
Upper quantum numbers string.
bool line_lower_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
Numeric reduced_magnetic_quadrapole(Rational Jf, Rational Ji, Rational N)
Compute the reduced magnetic quadrapole moment.
Constants of physical expressions as constexpr.
Main line shape model class.
MirroringType string2mirroringtype(const String &in)
Numeric SpeciesMass() const noexcept
Mass of the molecule.
void RemoveLocalQuantum(size_t)
Remove quantum numbers at the given position from all lines.
Index NumLines() const noexcept
Number of lines.
bool line_is_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier is equal to a line's identifier.
This file contains basic functions to handle ASCII files.
Contains the absorption namespace.
String shapetype2metadatastring(Type type) noexcept
Turns selected Type into a human readable string.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
const Numeric TORR2PA
Global constant, converts torr to Pa.
const std::vector< SingleSpeciesModel > & Data() const noexcept
Index nelem() const
Returns the number of elements.
QuantumNumberType
Enum for Quantum Numbers used for indexing.
basic_stringstream< char, string_char_traits< char >, alloc > stringstream
bool Self() const noexcept
Returns self broadening status.
PopulationType mpopulation
Line population distribution.
const Array< SpeciesRecord > species_data
Species Data.
SingleLine & Line(Index) noexcept
Returns a single line.
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
void RemoveLine(Index) noexcept
Removes a single line.
String quantumnumbertype2string(QuantumNumberType s)
Deals with internal derivatives, Jacobian definition, and OEM calculations.
LineShape::Output ShapeParameters_dT(size_t k, Numeric T, Numeric P, const Vector &vmrs) const noexcept
Line shape parameters temperature derivatives.
Rational UpperQuantumNumber(size_t k, QuantumNumberType qnt) const noexcept
Quantum number upper level.
const Array< IsotopologueRecord > & Isotopologue() const
std::vector< Lines > split_list_of_external_lines(std::vector< SingleLineExternal > &external_lines, const std::vector< QuantumNumberType > &localquantas={}, const std::vector< QuantumNumberType > &globalquantas={})
Splits a list of lines into proper Lines.
std::istream & operator>>(std::istream &, SingleLine &)
bool line_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
std::istream & from_artscat4(std::istream &is, Model &lsc, const QuantumIdentifier &qid)
Parser for quantum numbers from HITRAN 2004 and later.
Numeric mcutofffreq
cutoff frequency
bool line_upper_in_id(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
void ThrowIfQuantumNumberNameInvalid(String name)
Check for valid quantum number name and throws if it is invalid.
_CS_string_type str() const
Numeric reduced_rovibrational_dipole(Rational Jf, Rational Ji, Rational lf, Rational li, Rational k=Rational(1))
Compute the reduced rovibrational dipole moment.
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
Numeric wigner6j(const Rational j1, const Rational j2, const Rational j3, const Rational l1, const Rational l2, const Rational l3)
Wigner 6J symbol.
void Species(Index sp)
Set the Species.
CutoffType mcutoff
cutoff type, by band or by line
Implements rational numbers to work with other ARTS types.
bool Bath() const noexcept
Returns bath broadening status.
bool id_in_line_upper(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
Contains the lookup data for one species.
QuantumIdentifier::QType Isotopologue
Index Species() const noexcept
Species Index.
A tag group can consist of the sum of several of these.
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
Vector BroadeningSpeciesVMR(const ConstVectorView, const ArrayOfArrayOfSpeciesTag &) const
Returns the VMRs of the broadening species.
Numeric g_low() const noexcept
Lower level statistical weight.
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
void extract(T &x, String &line, Index n)
Extract something from the beginning of a string.
Class to identify and match lines by their quantum numbers.
void RemoveUnusedLocalQuantums()
Remove quantum numbers that are not used by even a single line.
Numeric E0() const noexcept
Lower level energy.
bool mbathbroadening
Does the line broadening have bath broadening.
void SetLineMixingModel(SingleSpeciesModel x)
NUMERIC Numeric
The type to use for all floating point numbers.
ArrayOfSpeciesTag mbroadeningspecies
A list of broadening species.
Numeric A() const noexcept
Einstein spontaneous emission.
Index nelem() const
Number of elements.
const String & Name() const
Declarations required for the calculation of absorption coefficients.
Numeric mlinemixinglimit
linemixing limit
ArrayOfString ModelMetaDataArray(const Model &m, const bool self, const bool bath, const ArrayOfSpeciesTag &sts, const Numeric T0)
Numeric pow(const Rational base, Numeric exp)
Power of.
std::ostream & operator<<(std::ostream &, const SingleLine &)
Numeric mT0
Reference temperature for all parameters of the lines.
std::istream & from_linemixingdata(std::istream &data, Model &lsc)
Legacy reading of old deprecated LineMixingData class.
LineShape::Output ShapeParameters(size_t k, Numeric T, Numeric P, const Vector &vmrs) const noexcept
Line shape parameters.
void Set(Index qn, Rational r)
Set quantum number at position.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
This can be used to make arrays out of anything.
String cutofftype2metadatastring(CutoffType in, Numeric cutoff)
bool mselfbroadening
Does the line broadening have self broadening.
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
constexpr Output differenceOutput(Output y, Output x) noexcept
Diff of two output.
NormalizationType string2normalizationtype(const String &in)
Parser for quantum number strings from HITRAN 2004 and later.
bool id_in_line(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
void Parse(QuantumIdentifier &qid, const String &quantum_string) const
Parse quantum numbers from string.
const std::vector< Rational > & UpperQuantumNumbers() const noexcept
Upper level quantum numbers.
Numeric wigner3j(const Rational j1, const Rational j2, const Rational j3, const Rational m1, const Rational m2, const Rational m3)
Wigner 3J symbol.
std::vector< QuantumNumberType > mlocalquanta
List of local quantum numbers, these must be defined.
A constant view of a Vector.
QuantumIdentifier quantumidentity
const std::vector< Rational > & LowerQuantumNumbers() const noexcept
Lower level quantum numbers.
SingleLine PopLine(Index) noexcept
Pops a single line.
std::vector< std::array< String, 2 > > split_quantum_numbers_from_hitran_online(String &qns)
std::istream & from_pressurebroadeningdata(std::istream &data, Model &lsc, const QuantumIdentifier &qid)
Index nelem(const Lines &l)
Number of lines.
Lines createEmptyCopy(const Lines &al) noexcept
Creates a copy of the input lines structure.
const LineShape::Model & LineShape() const noexcept
Line shape model.
LineShape::Output ShapeParameters_dVMR(size_t k, Numeric T, Numeric P, const QuantumIdentifier &vmr_qid) const noexcept
Line shape parameters vmr derivative.
Index LineShapePos(const Index &spec) const noexcept
Position among broadening species or -1.
Single line reading output.
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
Numeric ShapeParameter_dInternal(size_t k, Numeric T, Numeric P, const Vector &vmrs, const RetrievalQuantity &derivative) const noexcept
Line shape parameter internal derivative.
const QuantumIdentifier & QuantumIdentity() const noexcept
Returns identity status.
Zeeman::Model Zeeman() const noexcept
Zeeman model.
String populationtype2metadatastring(PopulationType in)
String normalizationtype2metadatastring(NormalizationType in)
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
constexpr bool even(const Rational r)
Returns true if even integer.
Numeric SelfVMR(const ConstVectorView, const ArrayOfArrayOfSpeciesTag &) const
Returns the VMR of the species.
const Numeric SPEED_OF_LIGHT
String SpeciesName() const noexcept
Species Name.
Numeric g_upp() const noexcept
Upper level statistical weight.
LineShape::Type LineShapeType() const noexcept
Returns lineshapetype style.
String mirroringtype2metadatastring(MirroringType in)
Input manipulator class for doubles to enable nan and inf parsing.
NormalizationType normalization
NormalizationType mnormalization
Line normalization type.
Numeric sqrt(const Rational r)
Square root.
Numeric I0() const noexcept
Reference line strength.
ArrayOfSpeciesTag species
bool id_in_line_lower(const Lines &band, const QuantumIdentifier &id, size_t line_index)
Checks if the external quantum identifier match a line's ID.
String MetaData() const
Returns a printable statement about the lines.
Numeric wavenumber_to_joule(Numeric e)
A little helper function to convert energy from units of wavenumber (cm^-1) to Joule (J)...
const std::vector< SingleLine > & AllLines() const noexcept
Lines.