49 std::vector<QuantumNumberType> nums(0);
52 if (qnstr not_eq
"") {
54 while (not str.eof()) {
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());
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) {
185 abs_lines.reserve(x.size());
187 abs_lines.push_back(x.back());
188 abs_lines.back().sort_by_frequency();
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());
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);
310 abs_lines.reserve(x.size());
312 abs_lines.push_back(x.back());
313 abs_lines.back().sort_by_frequency();
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;
347 for (
auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
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) {
385 for (
auto& band: abs_lines) {
386 if (band.Match(newband)) {
387 for (
Index k=0; k<newband.NumLines(); k++) {
388 band.AppendSingleLine(newband.Line(k));
394 abs_lines.push_back(newband);
397 }
catch (
const std::exception& e) {
398 if (not ignore_missing) {
400 os <<
"Errors in calls by *propmat_clearskyAddZeeman*:\n";
402 throw std::runtime_error(os.str());
409 for (
auto& band: abs_lines)
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")
434 else if (s ==
"Post2004")
436 else if (s ==
"Online")
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) {
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) {
509 abs_lines.reserve(x.size());
511 abs_lines.push_back(x.back());
512 abs_lines.back().sort_by_frequency();
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) {
572 abs_lines.reserve(x.size());
574 abs_lines.push_back(x.back());
575 abs_lines.back().sort_by_frequency();
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) {
635 abs_lines.reserve(x.size());
637 abs_lines.push_back(x.back());
638 abs_lines.back().sort_by_frequency();
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) {
698 abs_lines.reserve(x.size());
700 abs_lines.push_back(x.back());
701 abs_lines.back().sort_by_frequency();
723 std::map<String, int> names;
725 String true_basename = basename;
726 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
727 true_basename +=
'.';
729 for (
auto& lines : abs_lines) {
730 auto name = lines.SpeciesName();
731 const String fname = true_basename + name;
734 fname +
'.' + std::to_string(names[name]++) +
".xml",
735 0,
"",
"",
"", verbosity);
746 String true_basename = basename;
747 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
748 true_basename +=
'.';
752 for (
auto& band: abs_lines) {
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",
781 0,
"",
"",
"", verbosity);
791 std::map<String, int> names;
793 String true_basename = basename;
794 if (not(true_basename.back() ==
'.' or true_basename.back() ==
'/'))
795 true_basename +=
'.';
797 for (
auto& spec_lines : abs_lines_per_species) {
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",
804 0,
"",
"",
"", verbosity);
817 for (
auto& lines: abs_lines_per_species) {
818 for (
auto& band: lines) {
819 abs_lines.push_back(band);
836 std::set<Index> unique_species;
837 for (
auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
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) {
900 abs_lines.push_back(band);
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;
927 for (
auto asp = abs_species.begin(); asp != abs_species.end(); asp++) {
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) {
951 abs_lines.push_back(band);
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());
984 for (
auto& band: abs_lines) {
985 for (
Index k=0; k<band.NumLines(); k++) {
987 band.LowerQuantumNumber(k, QN) = x;
989 band.UpperQuantumNumber(k, QN) = x;
1002 for (
auto& band: abs_lines_per_species)
1012 for (
auto& lines: abs_lines) {
1013 lines.truncate_global_quantum_numbers();
1017 if (x[ind].Match(lines)) {
1026 for (
auto& line: lines.AllLines())
1027 x[match].AppendSingleLine(line);
1031 abs_lines = std::move(x);
1032 for (
auto& lines: abs_lines)
1033 lines.sort_by_frequency();
1040 for (
auto& lines: abs_lines) {
1041 lines.RemoveUnusedLocalQuantums();
1052 for (
auto& rlines: replacing_lines) {
1053 Index number_of_matching_bands = 0;
1054 for (
auto& tlines: abs_lines) {
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;
1088 for (
auto& tlines: abs_lines) {
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) {
1115 abs_lines.push_back(std::move(lines));
1118 for (
auto& band: appending_lines)
1119 abs_lines.push_back(band);
1126 for (
auto& lines: abs_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) {
1148 for (
auto& tlines: abs_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());
1184 for (
auto& band: abs_lines) {
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";
1214 for (
auto& band: abs_lines) {
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";
1241 for (
auto& band: abs_lines) {
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) {
1253 for (
auto& band: abs_lines) {
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]) {
1284 if (ignore_spec and not ignore_isot) {
1285 throw std::runtime_error(
"Cannot ignore the species and not ignore the isotopologue");
1296 for (
auto& band: abs_lines) {
1298 this_id.
Species() = band.Species();
1302 const bool in_lines = band.QuantumIdentity().In(this_id);
1303 while (not in_lines and band.NumLines()) {
1313 if (abs_lines[
i].NumLines() == 0) {
1314 abs_lines.erase(abs_lines.begin() +
i);
1334 for (
auto& lines: abs_lines) {
1336 lines.CutoffFreqValue(x);
1346 for (
auto& abs_lines: abs_lines_per_species)
1359 for (
auto& band: abs_lines) {
1360 if (QI.
In(band.QuantumIdentity())) {
1362 band.CutoffFreqValue(x);
1375 for (
auto& lines: abs_lines_per_species) {
1386 const String& species_tag,
1391 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1392 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1393 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1409 for (
auto& lines: abs_lines)
1418 for (
auto& abs_lines: abs_lines_per_species)
1429 for (
auto& band: abs_lines) {
1430 if (QI.
In(band.QuantumIdentity())) {
1442 for (
auto& abs_lines: abs_lines_per_species)
1451 const String& species_tag,
1456 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1457 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1458 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1474 for (
auto& lines: abs_lines)
1475 lines.Population(t);
1483 for (
auto& abs_lines: abs_lines_per_species)
1494 for (
auto& lines: abs_lines)
1495 if (QI.
In(lines.QuantumIdentity()))
1496 lines.Population(t);
1505 for (
auto& abs_lines: abs_lines_per_species)
1514 const String& species_tag,
1519 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1520 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1521 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1537 for (
auto& lines: abs_lines)
1538 lines.Normalization(t);
1546 for (
auto& abs_lines: abs_lines_per_species)
1557 for (
auto& lines: abs_lines)
1558 if (QI.
In(lines.QuantumIdentity()))
1559 lines.Normalization(t);
1568 for (
auto& abs_lines: abs_lines_per_species)
1577 const String& species_tag,
1582 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1583 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1584 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1600 for (
auto& lines: abs_lines)
1601 lines.LineShapeType(t);
1609 for (
auto& abs_lines: abs_lines_per_species)
1620 for (
auto& lines: abs_lines)
1621 if (QI.
In(lines.QuantumIdentity()))
1622 lines.LineShapeType(t);
1631 for (
auto& abs_lines: abs_lines_per_species)
1640 const String& species_tag,
1645 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1646 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1647 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1662 for (
auto& lines: abs_lines)
1663 lines.LinemixingLimit(x);
1671 for (
auto& abs_lines: abs_lines_per_species)
1681 for (
auto& lines: abs_lines)
1682 if (QI.
In(lines.QuantumIdentity()))
1683 lines.LinemixingLimit(x);
1692 for (
auto& abs_lines: abs_lines_per_species)
1701 const String& species_tag,
1706 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1707 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1708 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
1723 for (
auto& lines: abs_lines)
1732 for (
auto& abs_lines: abs_lines_per_species)
1742 for (
auto& lines: abs_lines)
1743 if (QI.
In(lines.QuantumIdentity()))
1753 for (
auto& abs_lines: abs_lines_per_species)
1762 const String& species_tag,
1767 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1768 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1769 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
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;
1810 for (
auto& band: abs_lines) {
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,
1885 for (
auto& lines: abs_lines_per_species)
1894 const String& parameter_name,
1896 const Index& relative,
1897 const Index& loose_matching,
1898 const String& species_tag,
1903 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
1904 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
1905 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
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;
1941 for (
auto& band: abs_lines) {
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,
1991 for (
auto& lines: abs_lines_per_species)
2000 const String& parameter_name,
2002 const Index& loose_matching,
2003 const String& species_tag,
2008 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2009 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
2010 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
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;
2035 for (
auto& band: abs_lines) {
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,
2077 for (
auto& lines: abs_lines_per_species)
2079 lines, QI, parameter, coefficient, species, x, relative, verbosity);
2088 const String& coefficient,
2091 const Index& relative,
2092 const String& species_tag,
2097 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2098 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
2099 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
2101 abs_lines_per_species[ispec], QI, parameter, coefficient, species, x, relative, verbosity);
2111 const String& coefficient,
2116 const bool do_self = species == LineShape::self_broadening;
2117 const bool do_bath = species == LineShape::bath_broadening;
2124 for (
auto& band: abs_lines) {
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,
2153 for (
auto& lines: abs_lines_per_species)
2155 lines, QI, parameter, coefficient, species, new_value, verbosity);
2164 const String& coefficient,
2167 const String& species_tag,
2172 abs_speciesSet(target_species, t1, t2, {species_tag}, verbosity);
2173 for (
Index ispec=0; ispec<abs_species.
nelem(); ispec++) {
2174 if (std::equal(abs_species[ispec].begin(), abs_species[ispec].
end(), target_species[0].begin())) {
2176 abs_lines_per_species[ispec], QI, parameter, coefficient, species, new_value, verbosity);
2188 const String& parameter_name,
2190 const Index& relative,
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;
2208 for (
auto& band: abs_lines) {
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,
2267 for (
auto& lines: abs_lines_per_species)
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");
2300 for (
auto& lines: abs_lines_per_species)
2307 const String& parameter_name,
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;
2326 for (
auto& band: abs_lines) {
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,
2372 for (
auto& lines: abs_lines_per_species)
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");
2403 for (
auto& lines: abs_lines_per_species)
2431 for (
auto& spec_lines: abs_lines_per_species) {
2432 for (
auto& band: spec_lines) {
2433 for (
auto&
id: nlte_field.
Levels()) {
2434 if (band.QuantumIdentity().UpperQuantumId().In(
id) or
2435 band.QuantumIdentity().LowerQuantumId().In(
id)) {
2436 for (
Index k=0; k<band.NumLines(); k++) {
2438 (not std::isnormal(band.A(k)) or band.A(k) < 0)) {
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);
2472 for (
auto& band: abs_lines) {
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) {
2490 for (
auto& lines: abs_lines_per_species) {
2501 if (qid.
In(abs_lines[
i].QuantumIdentity())) {
2502 abs_lines.erase(abs_lines.begin()+
i);
2513 std::vector<T>
linspace(T s, T e,
typename std::vector<T>::size_type count) noexcept {
2514 std::vector<T> ls(count);
2518 }
else if (count == 1) {
2519 ls.front() = (e + s) / 2;
2522 const T step = (e - s) / T(count - 1);
2525 for (
typename std::vector<T>::size_type
i = 1;
i < count - 1; ++
i)
2526 ls[
i] = s + step * T(
i);
2536 const Index& num_freqs,
2541 if (delta_f_low >= delta_f_upp) {
2542 throw std::runtime_error(
"The lower frequency delta has to be smaller " 2543 "than the upper frequency delta");
2544 }
else if (num_freqs == 0) {
2545 throw std::runtime_error(
"Need more than zero frequency points");
2547 throw std::runtime_error(
"No lines found. Error? Use *VectorSet* " 2548 "to resize *f_grid*");
2551 std::vector<Numeric> fout(0);
2552 for (
auto& lines: abs_lines_per_species) {
2553 for (
auto& band: lines) {
2554 for (
Index k=0; k<band.NumLines(); k++) {
2555 if (num_freqs > 1) {
2556 auto ftmp = linspace<Numeric>(band.F0(k)+delta_f_low, band.F0(k)+delta_f_upp, std::vector<Numeric>::size_type(num_freqs));
2557 for (
auto& f: ftmp) {
2558 if (f > 0) fout.push_back(f);
2561 fout.push_back(band.F0(k));
2567 std::sort(fout.begin(), fout.end());
2568 fout.erase(std::unique(fout.begin(), fout.end()), fout.end());
2569 f_grid.
resize(fout.size());
2571 f_grid[
i] = fout[
i];
2584 std::map<Index, Index> qns;
2586 for (
auto& band: abs_lines) {
2587 for (
Index iline=0; iline<band.NumLines(); iline++) {
2597 for (
auto& qn: qns) {
INDEX Index
The type to use for all integer numbers and indices.
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_linesSetLineShapeTypeForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeTypeForMatch.
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
void abs_linesSetBaseParameterForMatchingLevels(ArrayOfAbsorptionLines &abs_lines, const ArrayOfQuantumIdentifier &QID, const String ¶meter_name, const Vector &change, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevels.
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_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 var(VectorView var, const Vector &y, const ArrayOfVector &ys, const Index start=0, const Index end=-1)
Compute the variance of the ranged ys.
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.
void abs_linesReadSpeciesSplitCatalog(ArrayOfAbsorptionLines &abs_lines, const String &basename, const Index &robust, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesReadSpeciesSplitCatalog.
void abs_linesSetEmptyBroadeningParametersToEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesSetEmptyBroadeningParametersToEmpty.
void abs_linesRemoveUnusedLocalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesRemoveUnusedLocalQuantumNumbers.
SingleLineExternal ReadFromHitran2001Stream(istream &is)
Read from HITRAN before 2004.
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_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.
Index nelem() const
Number of elements.
void Isotopologue(Index iso)
Set the Isotopologue.
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.
void abs_linesSetCutoff(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoff.
SingleLineExternal ReadFromArtscat3Stream(istream &is)
Read from ARTSCAT-3.
void abs_linesTruncateGlobalQuantumNumbers(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesTruncateGlobalQuantumNumbers.
void read_from_stream(istream &is)
Reads next XML tag.
void abs_linesSetBaseParameterForMatchingLevel(ArrayOfAbsorptionLines &abs_lines, const QuantumIdentifier &QI, const String ¶meter_name, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetBaseParameterForMatchingLevel.
void xml_find_and_open_input_file(std::shared_ptr< istream > &ifs, const String &filename, const Verbosity &verbosity)
Open plain or zipped xml file.
SingleLineExternal ReadFromMytran2Stream(istream &is)
Read from Mytran2 The MYTRAN2 format is as follows (directly taken from the abs_my.c documentation):
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 xml_read_header_from_stream(istream &is, FileType &ftype, NumericType &ntype, EndianType &etype, const Verbosity &verbosity)
Reads XML header and root tag.
SingleLineExternal ReadFromArtscat4Stream(istream &is)
Read from ARTSCAT-4.
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_lines_per_speciesSetMirroring(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetMirroring.
void abs_linesSetLineShapeType(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLineShapeType.
Index Species() const
Molecular species index.
void abs_lines_per_speciesSetNormalization(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetNormalization.
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_linesSetPopulationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulationForMatch.
const Tensor4 & Data() const noexcept
Energy level type.
void abs_linesDeleteLinesWithQuantumNumberAbove(ArrayOfAbsorptionLines &abs_lines, const String &qn_id, const Index &qn_val, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteLinesWithQuantumNumberAbove.
bool modelparameterEmpty(const ModelParameters mp) noexcept
void abs_linesDeleteBadF0(ArrayOfAbsorptionLines &abs_lines, const Numeric &f0, const Index &lower, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteBadF0.
void abs_linesSetNormalizationForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalizationForMatch.
void abs_linesSetQuantumNumberForMatch(ArrayOfAbsorptionLines &abs_lines, const String &qn, const Rational &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetQuantumNumberForMatch.
Numeric & SingleModelParameter(ModelParameters &mp, const String &type)
Get a coefficient from ModelParameters by name.
QuantumNumberType string2quantumnumbertype(const String &s)
bool empty() const
Returns true if variable size is zero.
const Vector & Energies() const noexcept
Energy level type.
MirroringType string2mirroringtype(const String &in)
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.
Model GetAdvancedModel(const QuantumIdentifier &qid) noexcept
Returns an advanced Zeeman model.
void nlteSetByQuantumIdentifiers(Index &nlte_do, ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const EnergyLevelMap &nlte_field, const Verbosity &)
WORKSPACE METHOD: nlteSetByQuantumIdentifiers.
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.
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 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_linesSetMirroringForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroringForMatch.
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.
basic_istringstream< char, string_char_traits< char >, alloc > istringstream
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.
Index nelem() const
Returns the number of elements.
QuantumNumberType
Enum for Quantum Numbers used for indexing.
const Array< SpeciesRecord > species_data
Species Data.
SingleLineExternal ReadFromArtscat5Stream(istream &is)
Read from ARTSCAT-5.
String quantumnumbertype2string(QuantumNumberType s)
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 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 abs_lines_per_speciesSetEmpty(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const ArrayOfArrayOfSpeciesTag &abs_species, const Verbosity &)
WORKSPACE METHOD: abs_lines_per_speciesSetEmpty.
void abs_linesSetNormalization(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetNormalization.
void abs_linesSetPopulation(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetPopulation.
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_linesReplaceWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &replacing_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesReplaceWithLines.
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.
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 abs_lines_per_speciesSetPopulation(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetPopulation.
Array< AbsorptionLines > ArrayOfAbsorptionLines
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.
void abs_linesSetLinemixingLimitForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimitForMatch.
_CS_string_type str() const
void ThrowIfNotOK() const
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_linesSetT0ForMatch(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0ForMatch.
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.
SingleLineExternal ReadFromHitranOnlineStream(istream &is)
Read from HITRAN online.
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.
CutoffType string2cutofftype(const String &in)
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 Species(Index sp)
Set the Species.
void abs_lines_per_speciesCompact(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Vector &f_grid, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lines_per_speciesCompact.
Implements rational numbers to work with other ARTS types.
const ArrayOfQuantumIdentifier & Levels() const noexcept
Energy level type.
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.
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.
A tag group can consist of the sum of several of these.
SingleLineExternal ReadFromLBLRTMStream(istream &is)
Read from LBLRTM.
Variable
List of possible shape variables.
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.
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 abs_lines_per_speciesSetLinemixingLimit(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLinemixingLimit.
SingleLineExternal ReadFromJplStream(istream &is)
Read from JPL.
void SetTransition(const QuantumNumbers &upper, const QuantumNumbers &lower)
Set to transition type identifier.
Class to identify and match lines by their quantum numbers.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
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.
PopulationType string2populationtype(const String &in)
NUMERIC Numeric
The type to use for all floating point numbers.
void get_attribute_value(const String &aname, String &value)
Returns value of attribute as String.
Index nelem() const
Number of elements.
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 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_linesCleanupEmpty(ArrayOfAbsorptionLines &abs_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesCleanupEmpty.
PopulationType
Describes the type of population level counter.
void abs_linesSetCutoffForMatch(ArrayOfAbsorptionLines &abs_lines, const String &type, const Numeric &x, const QuantumIdentifier &QI, const Verbosity &)
WORKSPACE METHOD: abs_linesSetCutoffForMatch.
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_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.
basic_ostringstream< char, string_char_traits< char >, alloc > ostringstream
void abs_lines_per_speciesSetLineShapeType(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const String &type, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetLineShapeType.
void check_name(const String &expected_name)
Check tag name.
This can be used to make arrays out of anything.
void abs_lines_per_speciesSetT0(ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Numeric &x, const Verbosity &v)
WORKSPACE METHOD: abs_lines_per_speciesSetT0.
void open_input_file(ifstream &file, const String &name)
Open a file for reading.
constexpr QType Type() const
HitranType string2hitrantype(const String &s)
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.
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
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.
NormalizationType string2normalizationtype(const String &in)
void resize(Index n)
Resize function.
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.
bool empty() const
Check if variable is empty.
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.
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.
bool find_xml_file_existence(String &filename)
As find_xml_file but does not throw in the main body.
Absorption::Lines AbsorptionLines
void abs_linesWriteSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSplitXML.
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.
Index nelem(const Lines &l)
Number of lines.
Workspace methods and template functions for supergeneric XML IO.
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_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_linesSetT0(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetT0.
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_linesWriteSpeciesSplitXML(const String &output_format, const ArrayOfAbsorptionLines &abs_lines, const String &basename, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesWriteSpeciesSplitXML.
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.
void abs_linesAppendWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &appending_lines, const Index &safe, const Verbosity &)
WORKSPACE METHOD: abs_linesAppendWithLines.
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.
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
void abs_linesDeleteLinesWithUndefinedLocalQuanta(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithUndefinedLocalQuanta.
void abs_linesDeleteWithLines(ArrayOfAbsorptionLines &abs_lines, const ArrayOfAbsorptionLines &deleting_lines, const Verbosity &)
WORKSPACE METHOD: abs_linesDeleteWithLines.
void abs_linesSetLinemixingLimit(ArrayOfAbsorptionLines &abs_lines, const Numeric &x, const Verbosity &)
WORKSPACE METHOD: abs_linesSetLinemixingLimit.
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 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_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_linesDeleteLinesWithBadOrHighChangingJs(ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesDeleteLinesWithBadOrHighChangingJs.
SingleLineExternal ReadFromHitran2004Stream(istream &is)
Read from newer HITRAN.
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 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_linesCompact(ArrayOfAbsorptionLines &abs_lines, const Vector &f_grid, const Verbosity &)
WORKSPACE METHOD: abs_linesCompact.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
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.
Array< ArrayOfAbsorptionLines > ArrayOfArrayOfAbsorptionLines
void abs_linesPrintDefinedQuantumNumbers(const ArrayOfAbsorptionLines &abs_lines, const Verbosity &verbosity)
WORKSPACE METHOD: abs_linesPrintDefinedQuantumNumbers.
const QuantumNumbers & EnergyLevelQuantumNumbers() const noexcept
Return the energy level quantum numbers by const reference.
void abs_linesSetMirroring(ArrayOfAbsorptionLines &abs_lines, const String &type, const Verbosity &)
WORKSPACE METHOD: abs_linesSetMirroring.
std::vector< T > linspace(T s, T e, typename std::vector< T >::size_type count) noexcept
This file contains private function declarations and template instantiation to handle XML data files...
Type string2shapetype(const String &type)
Turns predefined strings into a Type.
bool In(const QuantumIdentifier &other) const
Return if this is in other.
constexpr Index nVars
Current max number of line shape variables.
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.
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.
std::vector< QuantumNumberType > string2vecqn(const String &qnstr)
Get a list of quantum numbers from a string.
Variable string2variable(const String &type)
Turns predefined strings into a Variable type.
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.