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);
427 qstr = quantum_string.substr(15, 15);
433 qstr = quantum_string.substr(30, 15);
441 qstr = quantum_string.substr(45, 15);
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];
544 throw std::runtime_error(
"Unidentified X for O2 in HITRAN parsing...");
549 throw std::runtime_error(
"Unidentified X for NO in HITRAN parsing...");
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;
662 if (qnf[
i] <
'0' || qnf[
i] >
'9') valid_num =
false;
664 throw std::runtime_error(
"Error parsing quantum number of type F5.1");
780 throw std::runtime_error(
781 "Missing definition of NO... this is a developer bug because it should fail earlier...");
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");
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...");
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...");
INDEX Index
The type to use for all integer numbers and indices.
#define RATIONAL_UNDEFINED
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
Array< QuantumClassGroup > mspecies
void postprocess_group2_hitran(QuantumIdentifier &qnr)
Index nelem() const
Number of elements.
#define SKIP_X_SPACES(container, nspaces)
Declarations having to do with the four output streams.
void parse_a2_hitran(Rational &qn, String &s, const Index species)
void parse_i2_hitran(Rational &qn, String &s, const Index species)
void postprocess_group5_hitran(QuantumIdentifier &qnr)
void postprocess_group6_hitran(QuantumIdentifier &qnr)
void parse_a1_pm_hitran(Rational &qn, String &s, const Index species)
void parse_a1_x_hitran(Rational &qn, String &s, const Index species)
void parse_a1_s_hitran(Rational &qn, String &s, const Index species)
const Array< SpeciesRecord > species_data
Species Data.
void parse_i3_hitran(Rational &qn, String &s, const Index species)
Parser for quantum numbers from HITRAN 2004 and later.
void parse_f51_hitran(Rational &qn, String &s, const Index species)
Array< QuantumClass > mclass
Array< QuantumGroup > mgroup
void parse_a1_sym_hitran(Rational &qn, String &s, const Index species)
void Species(Index sp)
Set the Species.
Implements rational numbers to work with other ARTS types.
constexpr Index toIndex(int n=1) const
Converts the value to index by n-scaled division.
void SetClassGroup(const String &species_name, const ClassIds iclass, const GroupIds igroup)
void extract(T &x, String &line, Index n)
Extract something from the beginning of a string.
void SetTransition(const QuantumNumbers &upper, const QuantumNumbers &lower)
Set to transition type identifier.
constexpr Rational LowerQuantumNumber(QuantumNumberType X) const noexcept
Return a lower quantum number by copy.
Class to identify and match lines by their quantum numbers.
void postprocess_group6oh_hitran(QuantumIdentifier &qnr)
void parse_a3_hitran(Rational &qn, String &s, const Index species)
Index nelem() const
Number of elements.
Declarations required for the calculation of absorption coefficients.
void parse_a5_hitran(Rational &qn, String &s, const Index species)
Index species_index_from_species_name(String name)
Return species index for given species name.
void trim()
Trim leading and trailing whitespace.
void Set(Index qn, Rational r)
Set quantum number at position.
constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept
Return a upper quantum number by copy.
void postprocess_group1_hitran(QuantumIdentifier &qnr)
Post-processing functions.
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
void parse_a1_br_hitran(Rational &qn, String &s, const Index species)
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
void parse_space(Rational &qn, String &s, const Index species)
Parsing functions.
void Parse(QuantumIdentifier &qid, const String &quantum_string) const
Parse quantum numbers from string.
Index nelem(const Lines &l)
Number of lines.
void parse_i1_hitran(Rational &qn, String &s, const Index species)
void parse_a4_hitran(Rational &qn, String &s, const Index species)
QuantumParserHITRAN2004()
Constructor initializing the parser.
Class mapping quantum numbers to parsing functions.