Go to the documentation of this file.
44 if (!
mqnumbers[qnri].isUndefined() && !qnumbers2[qnri].isUndefined() &&
57 if (
miso not_eq other.
miso)
return false;
68 "One of your inputs is bad. You are using function comparing energy levels to the upper state of lines, but the types mismatch");
88 if (
miso not_eq other.
miso)
return false;
99 "One of your inputs is bad. You are using function comparing energy levels to the lower state of lines, but the types mismatch");
119 if (
miso not_eq other.
miso)
return false;
127 throw std::runtime_error(
128 "Can never compare different types of identifiers with QID.In(QID), one of your inputs is of wrong QuantumIdentifier type");
136 if (other_low[i].isUndefined()) {
137 }
else if (this_low[i].isUndefined())
139 else if (this_low[i] not_eq other_low[i])
142 if (other_upp[i].isUndefined()) {
143 }
else if (this_upp[i].isUndefined())
145 else if (this_upp[i] not_eq other_upp[i])
153 if (other_qn[i].isUndefined()) {
154 }
else if (this_qn[i].isUndefined())
156 else if (this_qn[i] not_eq other_qn[i])
171 os <<
"Invalid quantum number: " << name;
172 throw std::runtime_error(os.str());
190 if (qn[i].isDefined()) {
248 static map<String, SpecIsoMap> ArtsMap;
251 static bool hinit =
false;
261 ArtsMap[buf] = indicies;
267 std::istringstream is(str);
274 const map<String, SpecIsoMap>::const_iterator i = ArtsMap.find(token);
275 if (i == ArtsMap.end()) {
277 os <<
"ARTS Tag: " << token <<
" is unknown.";
278 throw runtime_error(os.str());
290 std::ostringstream os;
291 os <<
"Expected 'UP', but got: " << token;
292 throw std::runtime_error(os.str());
302 if (token ==
"LO")
break;
306 std::ostringstream os;
307 os <<
"Premature end of data, expected 'LO'.";
308 throw std::runtime_error(os.str());
317 }
else if (token ==
"EN") {
328 }
else if (token ==
"ALL") {
330 }
else if (token ==
"NONE") {
333 std::ostringstream os;
334 os <<
"Error parsing QuantumIdentifier. Expected TR or EN, but got: "
337 throw std::runtime_error(os.str());
344 assert(upper.
nelem() == 5);
345 assert(lower.
nelem() == 5);
346 assert(
iso.nelem() == 3);
348 std::ostringstream os;
350 os <<
"CO2-" <<
iso <<
" TR "
352 <<
"v1 " << upper[0] <<
" v2 " << upper[1] <<
" l2 " << upper[2] <<
" v3 "
353 << upper[3] <<
" r " << upper[4] <<
" "
355 <<
"v1 " << lower[0] <<
" v2 " << lower[1] <<
" l2 " << lower[2] <<
" v3 "
356 << lower[3] <<
" r " << lower[4];
369 os << spr.
Name() <<
"-";
397 for (
const auto& qns :
mqm)
do {
398 if (not qns[qni].isUndefined())
return true;
415 if (key == QuantumNumberType::parity) {
420 }
else if (key == QuantumNumberType::ElectronState) {
423 }
else if (key == QuantumNumberType::kronigParity) {
435 void update_id(
QuantumIdentifier& qid,
const std::vector<std::array<String, 2> >& upper_list,
const std::vector<std::array<String, 2> >& lower_list)
437 for (
auto& keyval: upper_list) {
440 std::ostringstream os;
441 os <<
"The key \"" << keyval[0] <<
"\" is an invalid input as a quantum number key";
442 std::cout <<
"WARNING: " << os.str() <<
'\n';
448 std::ostringstream os;
449 os <<
"The key \"" << keyval[0] <<
"\" and value \"" << keyval[1] <<
"\" are invalid input as a quantum number key and value pair";
450 std::cout <<
"WARNING: " << os.str() <<
'\n';
455 for (
auto& keyval: lower_list) {
458 std::ostringstream os;
459 os <<
"The key \"" << keyval[0] <<
"\" is an invalid input as a quantum number key";
460 std::cout <<
"WARNING: " << os.str() <<
'\n';
466 std::ostringstream os;
467 os <<
"The key \"" << keyval[0] <<
"\" and value \"" << keyval[1] <<
"\" are invalid input as a quantum number key and value pair";
468 std::cout <<
"WARNING: " << os.str() <<
'\n';
#define RATIONAL_UNDEFINED
void Isotopologue(Index iso)
Set the Isotopologue.
Container class for Quantum Numbers.
Class to identify and match lines by their quantum numbers.
const QuantumContainer & GetNumbers() const
Get the numbers.
Declarations required for the calculation of absorption coefficients.
void iso(Array< IsotopologueRecord >::iterator &ii, String name, const ArrayOfNumeric &coeff, const ArrayOfNumeric &temp_range, const Index &coefftype)
Initialize isotopologue and move iterator to next one.
constexpr Index Isotopologue() const
Return the Isotopologue by index.
constexpr Index Species() const
Return the Species by index.
bool any_quantumnumbers() const
Check if there are any quantum numbers defined.
bool InLower(const QuantumIdentifier &other) const
Return if this is in other's lower energy state.
Rational interpret_stringdata(const QuantumNumberType key, const String &val)
QuantumNumberType
Enum for Quantum Numbers used for indexing.
bool InUpper(const QuantumIdentifier &other) const
Return if this is in other's upper energy state.
const Array< SpeciesRecord > species_data
Species Data.
QuantumNumberType string2quantumnumbertype(const String &s)
static constexpr Index TRANSITION_LOWER_INDEX
Lower level index.
void SetEnergyLevel(const QuantumNumbers &q)
Set tp energy level identifier.
void SetFromString(String str)
Set from a String object.
Index nelem(const Lines &l)
Number of lines.
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
String SpeciesName() const
Return the Species by name.
static constexpr Index TRANSITION_UPPER_INDEX
Upper level index.
String species_name_from_species_index(const Index spec_ind)
Return species name for given species index.
void Species(Index sp)
Set the Species.
String quantumnumbertype2string(QuantumNumberType s)
std::array< QuantumNumbers, 2 > mqm
constexpr Rational LowerQuantumNumber(QuantumNumberType X) const noexcept
Return a lower quantum number by copy.
static constexpr Index ENERGY_LEVEL_INDEX
Energy level index.
std::ostream & operator<<(std::ostream &os, const QuantumNumbers &qn)
Output operator.
void SetFromStringForCO2Band(String upper, String lower, String iso)
Set CO2 transition from String objects.
Contains the lookup data for one species.
Index nelem() const
Number of elements.
void update_id(QuantumIdentifier &qid, const std::vector< std::array< String, 2 > > &upper_list, const std::vector< std::array< String, 2 > > &lower_list)
Updates the quantum identifier based on a lists of strings.
constexpr QType Type() const
void SetTransition()
Set key to transition type.
std::array< Rational, Index(QuantumNumberType::FINAL_ENTRY)> QuantumContainer
const Array< IsotopologueRecord > & Isotopologue() const
constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept
Return a upper quantum number by copy.
QuantumContainer mqnumbers
const String & Name() const
std::istream & operator>>(std::istream &is, QuantumNumbers &qn)
Input operator.
Header file for special_interp.cc.
void ThrowIfQuantumNumberNameInvalid(String name)
Check for valid quantum number name and throws if it is invalid.
bool Compare(const QuantumNumbers &qn) const
Compare Quantum Numbers Ignores any undefined numbers in the comparison.
INDEX Index
The type to use for all integer numbers and indices.
const std::array< QuantumNumbers, 2 > & QuantumMatch() const
Return the quantum numbers array const reference.
bool In(const QuantumIdentifier &other) const
Return if this is in other.
void Set(Index qn, Rational r)
Set quantum number at position.
Index nelem() const
Number of elements.
Implements rational numbers to work with other ARTS types.