56 #define SKIP_X_SPACES(container, nspaces) \
57 container.push_back_n( \
58 QuantumFieldDescription(QuantumNumberType::FINAL_ENTRY, parse_space), \
100 this_class.push_back(
102 this_class.push_back(
104 this_class.push_back(
106 this_class.push_back(
114 this_class.push_back(
116 this_class.push_back(
118 this_class.push_back(
120 this_class.push_back(
122 this_class.push_back(
130 this_class.push_back(
132 this_class.push_back(
134 this_class.push_back(
141 this_class.push_back(
143 this_class.push_back(
145 this_class.push_back(
147 this_class.push_back(
149 this_class.push_back(
151 this_class.push_back(
153 this_class.push_back(
155 this_class.push_back(
165 this_class.push_back(
167 this_class.push_back(
169 this_class.push_back(
171 this_class.push_back(
173 this_class.push_back(
181 this_class.push_back(
183 this_class.push_back(
185 this_class.push_back(
187 this_class.push_back(
189 this_class.push_back(
191 this_class.push_back(
199 this_class.push_back(
201 this_class.push_back(
203 this_class.push_back(
205 this_class.push_back(
207 this_class.push_back(
209 this_class.push_back(
219 this_group.push_back(
221 this_group.push_back(
223 this_group.push_back(
225 this_group.push_back(
227 this_group.push_back(
233 this_group.push_back(
235 this_group.push_back(
237 this_group.push_back(
239 this_group.push_back(
241 this_group.push_back(
249 this_group.push_back(
256 this_group.push_back(
258 this_group.push_back(
260 this_group.push_back(
262 this_group.push_back(
270 this_group.push_back(
272 this_group.push_back(
274 this_group.push_back(
276 this_group.push_back(
283 this_group.push_back(
285 this_group.push_back(
287 this_group.push_back(
289 this_group.push_back(
296 this_group.push_back(
298 this_group.push_back(
300 this_group.push_back(
302 this_group.push_back(
304 this_group.push_back(
306 this_group.push_back(
312 this_group.push_back(
314 this_group.push_back(
316 this_group.push_back(
318 this_group.push_back(
320 this_group.push_back(
322 this_group.push_back(
330 this_group.push_back(
337 this_group.push_back(
339 this_group.push_back(
341 this_group.push_back(
343 this_group.push_back(
345 this_group.push_back(
347 this_group.push_back(
355 this_group.push_back(
362 this_group.push_back(
364 this_group.push_back(
366 this_group.push_back(
368 this_group.push_back(
376 this_group.push_back(
383 this_group.push_back(
385 this_group.push_back(
387 this_group.push_back(
389 this_group.push_back(
391 this_group.push_back(
411 const String& quantum_string)
const {
422 qstr = quantum_string.substr(0, 15);
423 for (
Index i = 0; i <
mclass[qclass].nelem(); i++) {
427 qstr = quantum_string.substr(15, 15);
428 for (
Index i = 0; i <
mclass[qclass].nelem(); i++) {
433 qstr = quantum_string.substr(30, 15);
434 for (
Index i = 0; i <
mgroup[qgroup].upper.nelem(); i++) {
435 mgroup[qgroup].upper[i].Parse(
441 qstr = quantum_string.substr(45, 15);
442 for (
Index i = 0; i <
mgroup[qgroup].lower.nelem(); i++) {
443 mgroup[qgroup].lower[i].Parse(
500 const char ch = s[0];
502 if ((ch ==
'+' || ch ==
'-') &&
510 throw std::runtime_error(
"Error parsing quantum number Sym");
511 }
else if ((ch ==
'd' || ch ==
'q') &&
517 }
else if (ch ==
'e' || ch ==
'f') {
519 }
else if (ch ==
'+' || ch ==
'-') {
521 }
else if (ch !=
' ')
522 throw std::runtime_error(
"Error parsing quantum number Sym");
534 const char ch = s[0];
538 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::O2_X_is_X));
540 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::O2_X_is_a));
542 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::O2_X_is_b));
544 throw std::runtime_error(
"Unidentified X for O2 in HITRAN parsing...");
547 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::NO_X_is_X));
549 throw std::runtime_error(
"Unidentified X for NO in HITRAN parsing...");
553 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::OH_X_is_X));
555 qn =
Rational(
Index(QuantumNumberTypeLabelsHitran::OH_X_is_A));
557 throw std::runtime_error(
"Unidentified X for OH in HITRAN parsing...");
563 throw std::runtime_error(
"Unidentified X for ClO in HITRAN parsing...");
588 String qnf = s.substr(0, 5);
595 if (as.
nelem() == 2) {
599 nom = strtol(as[0].c_str(), &endptr, 10);
600 if (endptr != as[0].c_str() + as[0].
nelem()) {
601 throw std::runtime_error(
"Error parsing quantum number of type A5");
606 else if (as[1] ==
"0")
609 throw std::runtime_error(
"Error parsing quantum number of type A5");
635 String qnf = s.substr(0, 5);
642 if (as.
nelem() == 2) {
646 nom = strtol(as[0].c_str(), &endptr, 10);
647 if (endptr != as[0].c_str() + as[0].
nelem()) {
648 throw std::runtime_error(
"Error parsing quantum number of type F5.1");
653 else if (as[1] ==
"0")
656 throw std::runtime_error(
"Error parsing quantum number of type F5.1");
660 bool valid_num =
true;
661 for (
Index i = 0; valid_num && i < qnf.
nelem(); i++)
662 if (qnf[i] <
'0' || qnf[i] >
'9') valid_num =
false;
664 throw std::runtime_error(
"Error parsing quantum number of type F5.1");
726 Index(QuantumNumberTypeLabelsHitran::O2_X_is_X)) {
731 Index(QuantumNumberTypeLabelsHitran::O2_X_is_a)) {
736 Index(QuantumNumberTypeLabelsHitran::O2_X_is_b)) {
743 Index(QuantumNumberTypeLabelsHitran::O2_X_is_X)) {
748 Index(QuantumNumberTypeLabelsHitran::O2_X_is_a)) {
753 Index(QuantumNumberTypeLabelsHitran::O2_X_is_b)) {
774 Index(QuantumNumberTypeLabelsHitran::NO_X_is_X)) {
780 throw std::runtime_error(
781 "Missing definition of NO... this is a developer bug because it should fail earlier...");
784 Index(QuantumNumberTypeLabelsHitran::NO_X_is_X)) {
790 throw std::runtime_error(
791 "Missing definition of NO... this is a developer bug because it should fail earlier...");
800 throw std::runtime_error(
801 "Missing definition of ClO... this is a developer bug because it should fail earlier...");
810 throw std::runtime_error(
811 "Missing definition of ClO... this is a developer bug because it should fail earlier...");
813 throw std::runtime_error(
814 "Unknown species accessing postprocessing of Hitran data... this is a developer bug");
832 Index(QuantumNumberTypeLabelsHitran::OH_X_is_X)) {
836 Index(QuantumNumberTypeLabelsHitran::OH_X_is_A)) {
850 throw std::runtime_error(
"Cannot understand value for OH");
852 throw std::runtime_error(
853 "Missing definition of OH... this is a developer bug because it should fail earlier...");
857 Index(QuantumNumberTypeLabelsHitran::OH_X_is_X)) {
861 Index(QuantumNumberTypeLabelsHitran::OH_X_is_A)) {
875 throw std::runtime_error(
"Cannot understand value for OH");
880 throw std::runtime_error(
881 "Missing definition of OH... this is a developer bug because it should fail earlier...");