Go to the documentation of this file.
49 std::vector<QuantumNumberType> nums(0);
52 if (qnstr not_eq
"") {
53 std::istringstream str(qnstr);
54 while (not str.eof()) {
59 std::ostringstream os;
60 os <<
"The quantum number key: \"" << part <<
"\" is invalid.\n";
61 throw std::runtime_error(os.str());
71 const String& artscat_file,
74 const String& globalquantumnumbers,
75 const String& localquantumnumbers,
76 const String& normalization_option,
77 const String& mirroring_option,
78 const String& population_option,
79 const String& lineshapetype_option,
80 const String& cutoff_option,
82 const Numeric& linemixinglimit_value,
86 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
89 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
97 shared_ptr<istream> ifs =
nullptr;
99 istream& is_xml = *ifs;
112 std::vector<Absorption::SingleLineExternal> v(0);
114 for (
Index i=0; i<num_arrays; i++) {
123 Index artscat_version;
125 if (version ==
"3") {
127 }
else if (version.substr(0, 8) !=
"ARTSCAT-") {
129 os <<
"The ARTS line file you are trying to read does not contain a valid version tag.\n"
130 <<
"Probably it was created with an older version of ARTS that used different units.";
131 throw runtime_error(os.str());
133 istringstream is(version.substr(8));
134 is >> artscat_version;
137 if (artscat_version < 3 or artscat_version > 5) {
139 os <<
"Unknown ARTS line file version: " << version;
140 throw runtime_error(os.str());
145 while (go_on and n<
nelem) {
146 switch(artscat_version) {
157 throw std::runtime_error(
"Bad version!");
163 }
else if (v.back().line.F0() < fmin) {
165 }
else if (v.back().line.F0() > fmax) {
202 const String& artscat_file,
205 const String& globalquantumnumbers,
206 const String& localquantumnumbers,
207 const String& normalization_option,
208 const String& mirroring_option,
209 const String& population_option,
210 const String& lineshapetype_option,
211 const String& cutoff_option,
213 const Numeric& linemixinglimit_value,
217 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
220 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
228 shared_ptr<istream> ifs =
nullptr;
230 istream& is_xml = *ifs;
245 Index artscat_version;
247 if (version ==
"3") {
249 }
else if (version.substr(0, 8) !=
"ARTSCAT-") {
251 os <<
"The ARTS line file you are trying to read does not contain a valid version tag.\n"
252 <<
"Probably it was created with an older version of ARTS that used different units.";
253 throw runtime_error(os.str());
255 istringstream is(version.substr(8));
256 is >> artscat_version;
259 if (artscat_version < 3 or artscat_version > 5) {
261 os <<
"Unknown ARTS line file version: " << version;
262 throw runtime_error(os.str());
265 std::vector<Absorption::SingleLineExternal> v(0);
271 switch(artscat_version) {
282 throw std::runtime_error(
"Bad version!");
288 }
else if (v.back().line.F0() < fmin) {
290 }
else if (v.back().line.F0() > fmax) {
296 getline(is_xml, line);
331 const String& globalquantumnumbers,
332 const String& localquantumnumbers,
333 const Index& ignore_missing,
334 const String& normalization_option,
335 const String& mirroring_option,
336 const String& population_option,
337 const String& lineshapetype_option,
338 const String& cutoff_option,
340 const Numeric& linemixinglimit_value,
346 std::set<Index> unique_species;
348 for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
350 unique_species.insert(sp->Species());
355 String tmpbasename = basename;
356 if (basename.length() && basename[basename.length() - 1] !=
'/') {
363 for (
auto it = unique_species.begin(); it != unique_species.end(); it++) {
371 globalquantumnumbers,
373 normalization_option,
376 lineshapetype_option,
379 linemixinglimit_value,
383 for (
auto& newband: more_abs_lines) {
386 if (band.Match(newband)) {
387 for (
Index k=0; k<newband.NumLines(); k++) {
388 band.AppendSingleLine(newband.Line(k));
397 }
catch (
const std::exception& e) {
398 if (not ignore_missing) {
399 std::ostringstream os;
400 os <<
"Errors in calls by *propmat_clearskyAddZeeman*:\n";
402 throw std::runtime_error(os.str());
410 band.sort_by_frequency();
412 if (normalization_option !=
"None")
414 if (mirroring_option !=
"None")
416 if (population_option !=
"None")
418 if (lineshapetype_option !=
"None")
420 if (cutoff_option !=
"None")
433 return HitranType::Pre2004;
434 else if (s ==
"Post2004")
435 return HitranType::Post2004;
436 else if (s ==
"Online")
439 std::ostringstream os;
440 os <<
"The type \"" << s <<
"\" is an invalid hitran type\n";
441 throw std::runtime_error(os.str());
447 const String& hitran_file,
450 const String& globalquantumnumbers,
451 const String& localquantumnumbers,
452 const String& hitran_type,
453 const String& normalization_option,
454 const String& mirroring_option,
455 const String& population_option,
456 const String& lineshapetype_option,
457 const String& cutoff_option,
459 const Numeric& linemixinglimit_value,
463 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
466 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
475 std::vector<Absorption::SingleLineExternal> v(0);
479 switch (hitran_version) {
480 case HitranType::Post2004:
483 case HitranType::Pre2004:
490 throw std::runtime_error(
"A bad developer did not throw in time to stop this message.\nThe HitranType enum class has to be fully updated!\n");
496 }
else if (v.back().line.F0() < fmin) {
498 }
else if (v.back().line.F0() > fmax) {
526 const String& lblrtm_file,
529 const String& globalquantumnumbers,
530 const String& localquantumnumbers,
531 const String& normalization_option,
532 const String& mirroring_option,
533 const String& population_option,
534 const String& lineshapetype_option,
535 const String& cutoff_option,
537 const Numeric& linemixinglimit_value,
541 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
544 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
550 std::vector<Absorption::SingleLineExternal> v(0);
559 }
else if (v.back().line.F0() < fmin) {
561 }
else if (v.back().line.F0() > fmax) {
589 const String& mytran2_file,
592 const String& globalquantumnumbers,
593 const String& localquantumnumbers,
594 const String& normalization_option,
595 const String& mirroring_option,
596 const String& population_option,
597 const String& lineshapetype_option,
598 const String& cutoff_option,
600 const Numeric& linemixinglimit_value,
604 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
607 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
613 std::vector<Absorption::SingleLineExternal> v(0);
622 }
else if (v.back().line.F0() < fmin) {
624 }
else if (v.back().line.F0() > fmax) {
655 const String& globalquantumnumbers,
656 const String& localquantumnumbers,
657 const String& normalization_option,
658 const String& mirroring_option,
659 const String& population_option,
660 const String& lineshapetype_option,
661 const String& cutoff_option,
663 const Numeric& linemixinglimit_value,
667 const std::vector<QuantumNumberType> global_nums =
string2vecqn(globalquantumnumbers);
670 const std::vector<QuantumNumberType> local_nums =
string2vecqn(localquantumnumbers);
676 std::vector<Absorption::SingleLineExternal> v(0);
685 }
else if (v.back().line.F0() < fmin) {
687 }
else if (v.back().line.F0() > fmax) {
723 std::map<String, int> names;
725 String true_basename = basename;
726 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
727 true_basename +=
'.';
730 auto name = lines.SpeciesName();
731 const String fname = true_basename + name;
734 fname +
'.' + std::to_string(names[name]++) +
".xml",
746 String true_basename = basename;
747 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
748 true_basename +=
'.';
753 auto specname = band.SpeciesName();
756 for (
auto& thisname: specs) {
758 else if (thisname == specname) any =
true;
762 specs.push_back(specname);
776 auto& name = specs[i];
777 auto& lines = alps[i];
780 true_basename + name +
".xml",
791 std::map<String, int> names;
793 String true_basename = basename;
794 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
795 true_basename +=
'.';
798 for (
auto& lines : spec_lines) {
799 auto name = lines.SpeciesName();
800 const String fname = true_basename + name;
803 fname +
'.' + std::to_string(names[name]++) +
".xml",
818 for (
auto& band: lines) {
836 std::set<Index> unique_species;
838 for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
840 unique_species.insert(sp->Species());
845 String tmpbasename = basename;
846 if (basename.length() && basename[basename.length() - 1] !=
'/') {
853 for (
auto it = unique_species.begin(); it != unique_species.end(); it++) {
858 filename = tmpbasename +
species_data[*it].FullName(k) +
'.' + std::to_string(i) +
".xml";
882 std::size_t bands_found{0};
884 String tmpbasename = basename;
885 if (basename.length() && basename[basename.length() - 1] !=
'/') {
893 for (
Index k=0; k<(*it).Isotopologue().
nelem(); k++) {
895 filename = tmpbasename + (*it).FullName(k) +
".xml";
899 for (
auto& band: speclines) {
907 if (not bands_found and not robust)
908 throw std::runtime_error(
"Cannot find any bands in the directory you are reading");
910 out3 <<
"Found " << bands_found <<
" bands\n";
923 std::size_t bands_found{0};
926 std::set<Index> unique_species;
928 for (ArrayOfSpeciesTag::const_iterator sp = asp->begin(); sp != asp->end(); sp++) {
930 unique_species.insert(sp->Species());
935 String tmpbasename = basename;
936 if (basename.length() && basename[basename.length() - 1] !=
'/') {
943 for (
auto it = unique_species.begin(); it != unique_species.end(); it++) {
946 filename = tmpbasename +
species_data[*it].FullName(k) +
".xml";
950 for (
auto& band: speclines) {
958 if (not bands_found and not robust)
959 throw std::runtime_error(
"Cannot find any bands in the directory you are reading");
961 out3 <<
"Found " << bands_found <<
" bands\n";
980 os <<
"Usupported quantum number key: " << qn <<
'\n';
981 throw std::runtime_error(os.str());
985 for (
Index k=0; k<band.NumLines(); k++) {
987 band.LowerQuantumNumber(k, QN) =
x;
989 band.UpperQuantumNumber(k, QN) =
x;
1013 lines.truncate_global_quantum_numbers();
1016 for (
Index ind=0; ind<
x.nelem(); ind++) {
1017 if (
x[ind].Match(lines)) {
1026 for (
auto& line: lines.AllLines())
1027 x[match].AppendSingleLine(line);
1033 lines.sort_by_frequency();
1041 lines.RemoveUnusedLocalQuantums();
1052 for (
auto& rlines: replacing_lines) {
1053 Index number_of_matching_bands = 0;
1055 if (tlines.Match(rlines)) {
1056 number_of_matching_bands++;
1057 for (
auto& rline: rlines.AllLines()) {
1058 Index number_of_matching_single_lines = 0;
1059 for (
auto& tline: tlines.AllLines()) {
1060 if (tline.SameQuantumNumbers(rline)) {
1061 number_of_matching_single_lines++;
1066 if (number_of_matching_single_lines not_eq 1) {
1067 throw std::runtime_error(
"Error: Did not match to a single single line. This means the input data has not been understood. This function needs exactly one match.");
1070 tlines.sort_by_frequency();
1074 if (number_of_matching_bands not_eq 1) {
1075 throw std::runtime_error(
"Error: Did not match to a single set of absorption lines. This means the input data has not been understood. This function needs exactly one match.");
1084 std::vector<AbsorptionLines> addedlines(0);
1086 for (
auto& alines: appending_lines) {
1087 Index number_of_matching_bands = 0;
1089 if (tlines.Match(alines)) {
1090 number_of_matching_bands++;
1091 for (
auto& aline: alines.AllLines()) {
1092 Index number_of_matching_single_lines = 0;
1093 for (
auto& tline: tlines.AllLines()) {
1094 if (tline.SameQuantumNumbers(aline)) {
1095 number_of_matching_single_lines++;
1098 if (number_of_matching_single_lines not_eq 0) {
1099 throw std::runtime_error(
"Error: Did match to a single single line. This means the input data has not been understood. This function needs exactly zero matches.");
1101 tlines.AppendSingleLine(aline);
1103 tlines.sort_by_frequency();
1107 if (number_of_matching_bands == 0)
1108 addedlines.push_back(alines);
1109 else if (number_of_matching_bands not_eq 1) {
1110 throw std::runtime_error(
"Error: Did not match to a single set of absorption lines. This means the input data has not been understood. This function needs exactly one or zero matches.");
1114 for (
auto& lines: addedlines) {
1118 for (
auto& band: appending_lines)
1127 std::vector<Index> hits;
1128 for (
Index i=0; i<lines.NumLines(); i++) {
1129 if (lower and lines.F0(i) < f0)
1131 else if (not lower and lines.F0(i) > f0)
1136 std::sort(hits.begin(), hits.end());
1137 while(not hits.empty()) {
1138 lines.RemoveLine(hits.back());
1147 for (
auto& dlines: deleting_lines) {
1149 std::vector<Index> hits(0);
1151 if (tlines.Match(dlines)) {
1152 for (
auto& dline: dlines.AllLines()) {
1153 for (
Index i=0; i<tlines.NumLines(); i++) {
1154 if (tlines.AllLines()[i].SameQuantumNumbers(dline)) {
1161 std::sort(hits.begin(), hits.end());
1162 auto n = hits.size();
1163 hits.erase(std::unique(hits.begin(), hits.end()), hits.end());
1164 if(n not_eq hits.size()) {
1165 throw std::runtime_error(
"Removing the same line more than once is not accepted");
1169 while(not hits.empty()) {
1170 tlines.RemoveLine(hits.back());
1185 std::vector<Index> deleters(0);
1187 for (
Index iline=0; iline<band.NumLines(); iline++) {
1188 if (std::any_of(band.Line(iline).LowerQuantumNumbers().cbegin(),
1189 band.Line(iline).LowerQuantumNumbers().cend(),
1190 [](
auto x) ->
bool {return x.isUndefined();}) or
1191 std::any_of(band.Line(iline).UpperQuantumNumbers().cbegin(),
1192 band.Line(iline).UpperQuantumNumbers().cend(),
1193 [](
auto x) ->
bool {return x.isUndefined();})) {
1194 deleters.push_back(iline);
1198 while (deleters.size()) {
1199 band.RemoveLine(deleters.back());
1200 deleters.pop_back();
1205 out2 <<
"Deleted " << i <<
" lines.\n";
1215 std::vector<Index> deleters(0);
1217 for (
Index iline=0; iline<band.NumLines(); iline++) {
1221 if (Jlo.isUndefined() or Jup.isUndefined() or 1 <
abs(Jup - Jlo)) {
1222 deleters.push_back(iline);
1226 while (deleters.size()) {
1227 band.RemoveLine(deleters.back());
1228 deleters.pop_back();
1233 out2 <<
"Deleted " << i <<
" lines.\n";
1242 for (
Index i=band.NumLines() - 1; i>=0; i--) {
1243 if (band.UpperQuantumNumber(i, qn) > qn_val or band.LowerQuantumNumber(i, qn) > qn_val) {
1254 std::array<bool, LineShape::nVars> var_is_empty;
1257 for (
Index ispec=0; ispec<band.NumBroadeners(); ispec++) {
1258 var_is_empty.fill(
true);
1261 for (
Index iline=0; iline<band.NumLines(); iline++) {
1264 var_is_empty[ivar] =
false;
1270 for (
Index iline=0; iline<band.NumLines(); iline++) {
1272 if (var_is_empty[ivar]) {
1273 band.Line(iline).LineShape().Data()[ispec].Data()[ivar].type = LineShape::TemperatureModel::None;
1284 if (ignore_spec and not ignore_isot) {
1285 throw std::runtime_error(
"Cannot ignore the species and not ignore the isotopologue");
1298 this_id.
Species() = band.Species();
1302 const bool in_lines = band.QuantumIdentity().In(this_id);
1303 while (not in_lines and band.NumLines()) {
1336 lines.CutoffFreqValue(
x);
1360 if (QI.
In(band.QuantumIdentity())) {
1362 band.CutoffFreqValue(
x);
1386 const String& species_tag,
1430 if (QI.
In(band.QuantumIdentity())) {
1451 const String& species_tag,
1475 lines.Population(t);
1495 if (QI.
In(lines.QuantumIdentity()))
1496 lines.Population(t);
1514 const String& species_tag,
1538 lines.Normalization(t);
1558 if (QI.
In(lines.QuantumIdentity()))
1559 lines.Normalization(t);
1577 const String& species_tag,
1601 lines.LineShapeType(t);
1621 if (QI.
In(lines.QuantumIdentity()))
1622 lines.LineShapeType(t);
1640 const String& species_tag,
1663 lines.LinemixingLimit(
x);
1682 if (QI.
In(lines.QuantumIdentity()))
1683 lines.LinemixingLimit(
x);
1701 const String& species_tag,
1743 if (QI.
In(lines.QuantumIdentity()))
1762 const String& species_tag,
1782 const String& parameter_name,
1784 const Index& relative,
1785 const Index& loose_matching,
1788 Index parameter_switch = -1;
1790 if (parameter_name.
nelem() == 0)
1791 throw std::runtime_error(
"parameter_name is empty.\n");
1792 else if (parameter_name ==
"Central Frequency" or
1793 parameter_name ==
"Line Center")
1794 parameter_switch = 0;
1795 else if (parameter_name ==
"Line Strength")
1796 parameter_switch = 1;
1797 else if (parameter_name ==
"Lower State Energy")
1798 parameter_switch = 4;
1799 else if (parameter_name ==
"Einstein Coefficient")
1800 parameter_switch = 5;
1801 else if (parameter_name ==
"Lower Statistical Weight")
1802 parameter_switch = 6;
1803 else if (parameter_name ==
"Upper Statistical Weight")
1804 parameter_switch = 7;
1805 else if (parameter_name ==
"Lower Zeeman Coefficient")
1806 parameter_switch = 8;
1807 else if (parameter_name ==
"Upper Zeeman Coefficient")
1808 parameter_switch = 9;
1811 for (
Index k=0; k<band.NumLines(); k++) {
1814 switch (parameter_switch) {
1817 band.F0(k) += change;
1819 band.F0(k) *= 1.0e0 + change;
1823 band.I0(k) += change;
1825 band.I0(k) *= 1.0e0 + change;
1829 band.E0(k) += change;
1831 band.E0(k) *= 1.0e0 + change;
1835 band.A(k) += change;
1837 band.A(k) *= 1.0e0 + change;
1841 band.g_low(k) += change;
1843 band.g_low(k) *= 1.0e0 + change;
1847 band.g_upp(k) += change;
1849 band.g_upp(k) *= 1.0e0 + change;
1853 band.Line(k).Zeeman().gl() += change;
1855 band.Line(k).Zeeman().gl() *= 1.0e0 + change;
1859 band.Line(k).Zeeman().gu() += change;
1861 band.Line(k).Zeeman().gu() *= 1.0e0 + change;
1865 os <<
"Usupported paramter_name\n"
1867 <<
"\nSee method description for supported parameter names.\n";
1868 throw std::runtime_error(os.str());
1879 const String& parameter_name,
1881 const Index& relative,
1882 const Index& loose_matching,
1894 const String& parameter_name,
1896 const Index& relative,
1897 const Index& loose_matching,
1898 const String& species_tag,
1914 const String& parameter_name,
1916 const Index& loose_matching,
1919 Index parameter_switch = -1;
1921 if (parameter_name.
nelem() == 0)
1922 throw std::runtime_error(
"parameter_name is empty.\n");
1923 else if (parameter_name ==
"Central Frequency" or
1924 parameter_name ==
"Line Center")
1925 parameter_switch = 0;
1926 else if (parameter_name ==
"Line Strength")
1927 parameter_switch = 1;
1928 else if (parameter_name ==
"Lower State Energy")
1929 parameter_switch = 4;
1930 else if (parameter_name ==
"Einstein Coefficient")
1931 parameter_switch = 5;
1932 else if (parameter_name ==
"Lower Statistical Weight")
1933 parameter_switch = 6;
1934 else if (parameter_name ==
"Upper Statistical Weight")
1935 parameter_switch = 7;
1936 else if (parameter_name ==
"Lower Zeeman Coefficient")
1937 parameter_switch = 8;
1938 else if (parameter_name ==
"Upper Zeeman Coefficient")
1939 parameter_switch = 9;
1942 for (
Index k=0; k<band.NumLines(); k++) {
1945 switch (parameter_switch) {
1965 band.Line(k).Zeeman().gl() =
x;
1968 band.Line(k).Zeeman().gu() =
x;
1972 os <<
"Usupported paramter_name\n"
1974 <<
"\nSee method description for supported parameter names.\n";
1975 throw std::runtime_error(os.str());
1986 const String& parameter_name,
1988 const Index& loose_matching,
2000 const String& parameter_name,
2002 const Index& loose_matching,
2003 const String& species_tag,
2021 const String& coefficient,
2024 const Index& relative,
2027 const bool do_self = species == LineShape::self_broadening;
2028 const bool do_bath = species == LineShape::bath_broadening;
2036 for (
Index k=0; k<band.NumLines(); k++) {
2038 if (do_self and band.Self()) {
2044 }
else if (do_bath and band.Bath()) {
2051 for (
Index i=band.Self(); i<band.BroadeningSpecies().nelem()-band.Bath(); i++) {
2052 if (spec == band.BroadeningSpecies()[i].Species()) {
2071 const String& coefficient,
2074 const Index& relative,
2079 lines, QI, parameter, coefficient, species,
x, relative,
verbosity);
2088 const String& coefficient,
2091 const Index& relative,
2092 const String& species_tag,
2111 const String& coefficient,
2116 const bool do_self = species == LineShape::self_broadening;
2117 const bool do_bath = species == LineShape::bath_broadening;
2125 for (
Index k=0; k<band.NumLines(); k++) {
2127 if (do_self and band.Self()) {
2129 }
else if (do_bath and band.Bath()) {
2132 for (
Index i=band.Self(); i<band.BroadeningSpecies().nelem()-band.Bath(); i++) {
2133 if (spec == band.BroadeningSpecies()[i].Species()) {
2148 const String& coefficient,
2155 lines, QI, parameter, coefficient, species, new_value,
verbosity);
2164 const String& coefficient,
2167 const String& species_tag,
2188 const String& parameter_name,
2190 const Index& relative,
2194 std::ostringstream os;
2195 os <<
"Bad input. Must be energy level. Is: " << QI <<
'\n';
2196 throw std::runtime_error(os.str());
2199 Index parameter_switch = -1;
2201 if (parameter_name.
nelem() == 0)
2202 throw std::runtime_error(
"parameter_name is empty.\n");
2203 else if (parameter_name ==
"Statistical Weight")
2204 parameter_switch = 1;
2205 else if (parameter_name ==
"Zeeman Coefficient")
2206 parameter_switch = 2;
2209 for (
Index k=0; k<band.NumLines(); k++) {
2211 switch (parameter_switch) {
2214 band.g_low(k) += change;
2216 band.g_low(k) *= 1.0e0 + change;
2220 band.Line(k).Zeeman().gl() += change;
2222 band.Line(k).Zeeman().gl() *= 1.0e0 + change;
2226 os <<
"Usupported paramter_name\n"
2228 <<
"\nSee method description for supported parameter names.\n";
2229 throw std::runtime_error(os.str());
2233 switch (parameter_switch) {
2236 band.g_upp(k) += change;
2238 band.g_upp(k) *= 1.0e0 + change;
2242 band.Line(k).Zeeman().gu() += change;
2244 band.Line(k).Zeeman().gu() *= 1.0e0 + change;
2248 os <<
"Usupported paramter_name\n"
2250 <<
"\nSee method description for supported parameter names.\n";
2251 throw std::runtime_error(os.str());
2262 const String& parameter_name,
2264 const Index& relative,
2274 const String& parameter_name,
2276 const Index& relative,
2280 throw std::runtime_error(
"Mismatch between QID and change input lengths not allowed");
2290 const String& parameter_name,
2292 const Index& relative,
2296 throw std::runtime_error(
"Mismatch between QID and change input lengths not allowed");
2307 const String& parameter_name,
2312 std::ostringstream os;
2313 os <<
"Bad input. Must be energy level. Is: " << QI <<
'\n';
2314 throw std::runtime_error(os.str());
2317 Index parameter_switch = -1;
2319 if (parameter_name.
nelem() == 0)
2320 throw std::runtime_error(
"parameter_name is empty.\n");
2321 else if (parameter_name ==
"Statistical Weight")
2322 parameter_switch = 1;
2323 else if (parameter_name ==
"Zeeman Coefficient")
2324 parameter_switch = 2;
2327 for (
Index k=0; k<band.NumLines(); k++) {
2329 switch (parameter_switch) {
2334 band.Line(k).Zeeman().gl() =
x;
2338 os <<
"Usupported paramter_name\n"
2340 <<
"\nSee method description for supported parameter names.\n";
2341 throw std::runtime_error(os.str());
2345 switch (parameter_switch) {
2350 band.Line(k).Zeeman().gu() =
x;
2354 os <<
"Usupported paramter_name\n"
2356 <<
"\nSee method description for supported parameter names.\n";
2357 throw std::runtime_error(os.str());
2368 const String& parameter_name,
2379 const String& parameter_name,
2384 throw std::runtime_error(
"Mismatch between QID and change input lengths not allowed");
2394 const String& parameter_name,
2399 throw std::runtime_error(
"Mismatch between QID and change input lengths not allowed");
2428 Absorption::PopulationType::ByNLTEPopulationDistribution :
2429 Absorption::PopulationType::ByNLTEVibrationalTemperatures;
2432 for (
auto& band: spec_lines) {
2434 if (band.QuantumIdentity().UpperQuantumId().In(
id) or
2435 band.QuantumIdentity().LowerQuantumId().In(
id)) {
2436 for (
Index k=0; k<band.NumLines(); k++) {
2437 if (poptyp==Absorption::PopulationType::ByNLTEPopulationDistribution and
2438 (not std::isnormal(band.A(k)) or band.A(k) < 0)) {
2439 std::ostringstream os;
2440 os <<
"Error in band deemed for NLTE calculations by population distribution\n"
2441 <<
"some of the lines in the band below have a bad Einstein coefficient:\n"
2443 throw std::runtime_error(os.str());
2446 band.Population(poptyp);
2474 for (
Index k=band.NumLines()-1; k>=0; k--) {
2475 const Numeric fcut_upp = band.CutoffFreq(k);
2476 const Numeric fcut_low = band.CutoffFreqMinus(k, fmean);
2478 if (fmax < fcut_low or fmin > fcut_upp) {
2516 if (qid.
nelem() not_eq gs.
nelem())
throw std::runtime_error(
"Inputs not matching in size");
2526 if (qid.
nelem() not_eq gs.
nelem())
throw std::runtime_error(
"Inputs not matching in size");
2539 std::vector<T>
linspace(T s, T e,
typename std::vector<T>::size_type count) noexcept {
2540 std::vector<T> ls(count);
2544 }
else if (count == 1) {
2545 ls.front() = (e + s) / 2;
2548 const T step = (e - s) / T(count - 1);
2551 for (
typename std::vector<T>::size_type i = 1; i < count - 1; ++i)
2552 ls[i] = s + step * T(i);
2562 const Index& num_freqs,
2567 if (delta_f_low >= delta_f_upp) {
2568 throw std::runtime_error(
"The lower frequency delta has to be smaller "
2569 "than the upper frequency delta");
2570 }
else if (num_freqs == 0) {
2571 throw std::runtime_error(
"Need more than zero frequency points");
2573 throw std::runtime_error(
"No lines found. Error? Use *VectorSet* "
2574 "to resize *f_grid*");
2577 std::vector<Numeric> fout(0);
2579 for (
auto& band: lines) {
2580 for (
Index k=0; k<band.NumLines(); k++) {
2581 if (num_freqs > 1) {
2582 auto ftmp = linspace<Numeric>(band.F0(k)+delta_f_low, band.F0(k)+delta_f_upp, std::vector<Numeric>::size_type(num_freqs));
2583 for (
auto& f: ftmp) {
2584 if (f > 0) fout.push_back(f);
2587 fout.push_back(band.F0(k));
2593 std::sort(fout.begin(), fout.end());
2594 fout.erase(std::unique(fout.begin(), fout.end()), fout.end());
2595 f_grid.resize(fout.size());
2610 std::map<Index, Index> qns;
2613 for (
Index iline=0; iline<band.NumLines(); iline++) {
2623 for (
auto& qn: qns) {
void abs_lines_per_speciesReadSpeciesSplitCatalog(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Index &robust, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesReadSpeciesSplitCatalog.
void abs_linesSetPopulationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulationForMatch.
void abs_linesSetLineShapeModelParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &new_value, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeModelParameterForMatchingLines.
void Isotopologue(Index iso)
Set the Isotopologue.
void abs_linesCompact(ArrayOfAbsorptionLines &abs_lines, const Vector &f_grid, const Verbosity &)
WORKSPACE METHOD: abs_linesCompact.
void check_name(const String &expected_name)
Check tag name.
Class to identify and match lines by their quantum numbers.
void abs_linesSetQuantumNumberForMatch(ArrayOfAbsorptionLines &abs_lines, const String &qn, const Rational &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetQuantumNumberForMatch.
void abs_linesSetBaseParameterForMatchingLevel(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevel.
void abs_linesChangeBaseParameterForMatchingLevels(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &QID, const String ¶meter_name, const Vector &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLevels.
void nlteSetByQuantumIdentifiers(Index &nlte_do, ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const EnergyLevelMap &nlte_field, const Verbosity &)
WORKSPACE METHOD: nlteSetByQuantumIdentifiers.
void abs_lines_per_speciesSetPopulationForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulationForSpecies.
void abs_lines_per_speciesChangeBaseParameterForMatchingLevels(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &QID, const String ¶meter_name, const Vector &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLevels.
void abs_lines_per_speciesSetNormalization(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalization.
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
void abs_lines_per_speciesSetLineShapeModelParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &new_value, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeModelParameterForSpecies.
void abs_lines_per_speciesChangeBaseParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLines.
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 abs_linesSetCutoff(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoff.
Contains the absorption namespace.
void abs_lines_per_speciesSetNormalizationForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalizationForSpecies.
Verbosity verbosity(Workspace &ws) noexcept
void ReadJPL(ArrayOfAbsorptionLines &abs_lines, const String &jpl_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadJPL.
void abs_lines_per_speciesSetNormalizationForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalizationForMatch.
QuantumNumberType
Enum for Quantum Numbers used for indexing.
void abs_linesSetLineShapeType(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeType.
void abs_lines_per_speciesSetMirroring(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroring.
void abs_linesReadSpeciesSplitCatalog(ArrayOfAbsorptionLines &abs_lines, const String &basename, const Index &robust, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesReadSpeciesSplitCatalog.
Variable string2variable(const String &type)
Turns predefined strings into a Variable type.
void abs_linesSetEmptyBroadeningParametersToEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesSetEmptyBroadeningParametersToEmpty.
void abs_lines_per_speciesSetBaseParameterForMatchingLevel(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLevel.
void WriteXML(const String &file_format, const T &v, const String &f, const Index &no_clobber, const String &v_name, const String &f_name, const String &no_clobber_name, const Verbosity &verbosity)
WORKSPACE METHOD: WriteXML.
void abs_linesDeleteLinesWithQuantumNumberAbove(ArrayOfAbsorptionLines &abs_lines, const String &qn_id, const Index &qn_val, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteLinesWithQuantumNumberAbove.
ArrayOfArrayOfAbsorptionLines abs_lines_per_species(Workspace &ws) noexcept
void abs_lines_per_speciesSetPopulation(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulation.
void abs_linesDeleteBadF0(ArrayOfAbsorptionLines &abs_lines, const Numeric &f0, const Index &lower, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteBadF0.
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
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.
void abs_linesTruncateGlobalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesTruncateGlobalQuantumNumbers.
void abs_lines_per_speciesSetPopulationForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulationForMatch.
const Array< SpeciesRecord > species_data
Species Data.
QuantumNumberType string2quantumnumbertype(const String &s)
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.
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
void abs_linesSetNormalization(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalization.
Model GetAdvancedModel(const QuantumIdentifier &qid) noexcept
Returns an advanced Zeeman model.
void abs_lines_per_speciesSetEmpty(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesSetEmpty.
void abs_lines_per_speciesSetCutoffForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoffForSpecies.
void abs_linesSetBaseParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &x, const Index &loose_matching, const Verbosity &)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLines.
void ReadSplitARTSCAT(ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const Index &ignore_missing, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadSplitARTSCAT.
void abs_linesSetNormalizationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalizationForMatch.
void abs_lines_per_speciesSetT0ForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetT0ForSpecies.
EnergyLevelMap nlte_field(Workspace &ws) noexcept
void abs_linesSetMirroringForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroringForMatch.
This can be used to make arrays out of anything.
This file contains private function declarations and template instantiation to handle XML data files.
Absorption::Lines AbsorptionLines
A tag group can consist of the sum of several of these.
void abs_lines_per_speciesSetZeemanCoefficients(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetZeemanCoefficients.
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.
Index nelem(const Lines &l)
Number of lines.
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
void abs_lines_per_speciesSetLinemixingLimitForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimitForMatch.
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
void abs_linesSetT0ForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0ForMatch.
void abs_lines_per_speciesWriteSpeciesSplitXML(const String &output_format, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesWriteSpeciesSplitXML.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
bool modelparameterEmpty(const ModelParameters mp) noexcept
void ReadArrayOfARTSCAT(ArrayOfAbsorptionLines &abs_lines, const String &artscat_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadArrayOfARTSCAT.
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
void Species(Index sp)
Set the Species.
void ReadMytran2(ArrayOfAbsorptionLines &abs_lines, const String &mytran2_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadMytran2.
void read_from_stream(istream &is)
Reads next XML tag.
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
void abs_linesChangeLineShapeModelParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeLineShapeModelParameterForMatchingLines.
void abs_lines_per_speciesChangeLineShapeModelParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeLineShapeModelParameterForMatchingLines.
void abs_linesSetLinemixingLimitForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimitForMatch.
String quantumnumbertype2string(QuantumNumberType s)
Numeric & SingleModelParameter(ModelParameters &mp, const String &type)
Get a coefficient from ModelParameters by name.
Index nelem() const
Returns the number of elements.
void abs_linesChangeBaseParameterForMatchingLines(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLines.
void abs_lines_per_speciesSetMirroringForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroringForMatch.
void SetTransition(const QuantumNumbers &upper, const QuantumNumbers &lower)
Set to transition type identifier.
void ReadHITRAN(ArrayOfAbsorptionLines &abs_lines, const String &hitran_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &hitran_type, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadHITRAN.
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
void abs_linesSetPopulation(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulation.
void abs_lines_per_speciesSetLineShapeType(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeType.
void abs_lines_per_speciesSetCutoffForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoffForMatch.
void abs_linesReplaceWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &replacing_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesReplaceWithLines.
HitranType string2hitrantype(const String &s)
NUMERIC Numeric
The type to use for all floating point numbers.
void abs_lines_per_speciesSetBaseParameterForMatchingLevels(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfQuantumIdentifier &QID, const String ¶meter_name, const Vector &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLevels.
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.
Array< ArrayOfAbsorptionLines > ArrayOfArrayOfAbsorptionLines
void abs_linesCleanupEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesCleanupEmpty.
Vector f_grid(Workspace &ws) noexcept
void abs_lines_per_speciesChangeBaseParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &relative, const Index &loose_matching, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForSpecies.
Variable
List of possible shape variables.
void abs_speciesSet(ArrayOfArrayOfSpeciesTag &abs_species, Index &abs_xsec_agenda_checked, Index &propmat_clearsky_agenda_checked, const ArrayOfString &names, const Verbosity &verbosity)
WORKSPACE METHOD: abs_speciesSet.
void ReadLBLRTM(ArrayOfAbsorptionLines &abs_lines, const String &lblrtm_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadLBLRTM.
void abs_lines_per_speciesSetLinemixingLimit(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimit.
void abs_linesSetZeemanCoefficients(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &qid, const Vector &gs, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesSetZeemanCoefficients.
Workspace methods and template functions for supergeneric XML IO.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
void abs_linesSetT0(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0.
Index nelem() const
Number of elements.
void abs_lines_per_speciesCompact(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Vector &f_grid, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesCompact.
constexpr QType Type() const
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
Index nlte_do(Workspace &ws) noexcept
void abs_lines_per_speciesSetCutoff(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetCutoff.
void abs_lines_per_speciesSetLineShapeModelParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &new_value, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeModelParameterForMatchingLines.
void abs_linesSetCutoffForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoffForMatch.
ArrayOfAbsorptionLines abs_lines(Workspace &ws) noexcept
void abs_linesChangeBaseParameterForMatchingLevel(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &relative, const Verbosity &)
WORKSPACE METHOD: abs_linesChangeBaseParameterForMatchingLevel.
void ReadARTSCAT(ArrayOfAbsorptionLines &abs_lines, const String &artscat_file, const Numeric &fmin, const Numeric &fmax, const String &globalquantumnumbers, const String &localquantumnumbers, const String &normalization_option, const String &mirroring_option, const String &population_option, const String &lineshapetype_option, const String &cutoff_option, const Numeric &cutoff_value, const Numeric &linemixinglimit_value, const Verbosity &verbosity)
WORKSPACE METHOD: ReadARTSCAT.
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
void abs_linesDeleteLinesWithBadOrHighChangingJs(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithBadOrHighChangingJs.
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
void abs_lines_per_speciesChangeLineShapeModelParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String ¶meter, const String &coefficient, const String &species, const Numeric &x, const Index &relative, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeLineShapeModelParameterForSpecies.
void abs_lines_per_speciesChangeBaseParameterForMatchingLevel(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &relative, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesChangeBaseParameterForMatchingLevel.
NormalizationType string2normalizationtype(const String &in)
SingleLineExternal ReadFromMytran2Stream(istream &is)
Read from Mytran2 The MYTRAN2 format is as follows (directly taken from the abs_my....
void abs_lines_per_speciesSetLinemixingLimitForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Numeric &x, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimitForSpecies.
void abs_linesWriteSpeciesSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSpeciesSplitXML.
void abs_lines_per_speciesSetT0(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetT0.
void f_gridFromAbsorptionLines(Vector &f_grid, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &delta_f_low, const Numeric &delta_f_upp, const Index &num_freqs, const Verbosity &)
WORKSPACE METHOD: f_gridFromAbsorptionLines.
void abs_lines_per_speciesSetMirroringForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroringForSpecies.
void abs_lines_per_speciesSetLineShapeTypeForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &type, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeTypeForSpecies.
constexpr Index nVars
Current max number of line shape variables.
void abs_lines_per_speciesWriteSplitXML(const String &output_format, const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesWriteSplitXML.
void abs_linesWriteSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSplitXML.
bool find_xml_file_existence(String &filename)
As find_xml_file but does not throw in the main body.
This file contains basic functions to handle ASCII files.
void abs_lines_per_speciesSetBaseParameterForMatchingLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &loose_matching, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForMatchingLines.
void abs_linesKeepBands(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &qid, const Index &ignore_spec, const Index &ignore_isot, const Verbosity &)
WORKSPACE METHOD: abs_linesKeepBands.
void abs_lines_per_speciesSetLineShapeTypeForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeTypeForMatch.
void abs_linesSetMirroring(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroring.
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
const QuantumNumbers & EnergyLevelQuantumNumbers() const noexcept
Return the energy level quantum numbers by const reference.
std::vector< T > linspace(T s, T e, typename std::vector< T >::size_type count) noexcept
void abs_lines_per_speciesSetT0ForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetT0ForMatch.
void abs_linesSetLineShapeTypeForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeTypeForMatch.
CutoffType string2cutofftype(const String &in)
void abs_linesDeleteWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &deleting_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteWithLines.
void abs_linesDeleteLinesWithUndefinedLocalQuanta(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithUndefinedLocalQuanta.
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
void abs_lines_per_speciesSetBaseParameterForSpecies(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &change, const Index &loose_matching, const String &species_tag, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesSetBaseParameterForSpecies.
void abs_linesSetLinemixingLimit(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimit.
void abs_lines_per_speciesSetQuantumNumberForMatch(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &qn, const Rational &x, const QuantumIdentifier &QI, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetQuantumNumberForMatch.
bool In(const QuantumIdentifier &other) const
Return if this is in other.
PopulationType
Describes the type of population level counter.
void abs_linesRemoveUnusedLocalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesRemoveUnusedLocalQuantumNumbers.
std::vector< QuantumNumberType > string2vecqn(const String &qnstr)
Get a list of quantum numbers from a string.
void abs_lines_per_speciesCreateFromLines(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfAbsorptionLines &abs_lines, const ArrayOfArrayOfSpeciesTag &tgs, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesCreateFromLines.
void xml_find_and_open_input_file(std::shared_ptr< istream > &ifs, const String &filename, const Verbosity &verbosity)
Open plain or zipped xml file.
PopulationType string2populationtype(const String &in)
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
Index Species() const
Molecular species index.
Index nelem() const
Number of elements.
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.
Implements rational numbers to work with other ARTS types.
void abs_lines_per_speciesReadSplitCatalog(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesReadSplitCatalog.
void abs_linesRemoveBand(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &qid, const Verbosity &)
WORKSPACE METHOD: abs_linesRemoveBand.
MirroringType string2mirroringtype(const String &in)
void abs_linesAppendWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &appending_lines, const Index &safe, const Verbosity &)
WORKSPACE METHOD: abs_linesAppendWithLines.
void abs_linesSetBaseParameterForMatchingLevels(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &QID, const String ¶meter_name, const Vector &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevels.
void abs_linesPrintDefinedQuantumNumbers(const ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesPrintDefinedQuantumNumbers.
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
void xml_read_header_from_stream(istream &is, FileType &ftype, NumericType &ntype, EndianType &etype, const Verbosity &verbosity)
Reads XML header and root tag.