Go to the documentation of this file.
102 #define INPUT_QUANTUM(ID) \
103 if (s == #ID) return QuantumNumberType::ID
114 else if (s ==
"K")
return QuantumNumberType::Ka;
137 else if (s ==
"l")
return QuantumNumberType::l1;
154 else if (s ==
"ElecStateLabel")
return QuantumNumberType::ElectronState;
163 #define INPUT_QUANTUM(ID) \
164 if (s == QuantumNumberType::ID) return #ID
214 throw std::runtime_error(
"Bad quantum number type");
345 return std::accumulate(
347 return r.isUndefined() ? i : i + 1;
424 mqm({upper, lower}) {}
436 const std::vector<QuantumNumberType>& keys,
437 const std::vector<Rational>& upper,
438 const std::vector<Rational>& lower)
442 for(
size_t i=0; i<keys.size(); i++) {
534 return std::any_of(keys.cbegin(), keys.cend(), [
x](
auto y){return x == y;});
539 if (std::string(
"ENERGY_LEVEL") == str) {
541 }
else if (std::string(
"TRANSITION") == str) {
543 }
else if (std::string(
"ALL") == str) {
545 }
else if (std::string(
"NONE") == str) {
690 std::array<QuantumNumbers, 2>
mqm;
720 throw std::runtime_error(
"Programmer error --- added type is missing");
782 void update_id(
QuantumIdentifier& qid,
const std::vector<std::array<String, 2> >& upper_list,
const std::vector<std::array<String, 2> >& lower_list);
#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.
Rational & operator[](const QuantumNumberType qn) noexcept
Access operator.
const QuantumContainer & GetNumbers() const
Get the numbers.
Contains the rational class definition.
constexpr QuantumIdentifier UpperQuantumId() const noexcept
Return a quantum identifer as if it wants to match to upper energy level.
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.
void Type(QType x)
Set Type.
Header file for interpolation.cc.
#define INPUT_QUANTUM(ID)
bool InLower(const QuantumIdentifier &other) const
Return if this is in other's lower energy state.
constexpr Rational EnergyLevelQuantumNumber(QuantumNumberType X) const noexcept
Return a energy level quantum number by copy.
QuantumNumberType
Enum for Quantum Numbers used for indexing.
static bool validIndexForType(Index x) noexcept
Checks if input is a valid Type.
bool operator==(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is everything the same between the identifiers.
bool operator!=(const QuantumIdentifier &a, const QuantumIdentifier &b)
Is anything different between the identifiers.
bool InUpper(const QuantumIdentifier &other) const
Return if this is in other's upper energy state.
Vector y(Workspace &ws) noexcept
constexpr QuantumNumbers(Rational J, Rational N, Rational v) noexcept
bool IsValidQuantumNumberName(String name)
Check for valid quantum number name.
QuantumNumberType string2quantumnumbertype(const String &s)
void ThrowIfQuantumNumberNameInvalid(String name)
Check for valid quantum number name and throws if it is invalid.
Rational & LowerQuantumNumber(QuantumNumberType X) noexcept
Return a lower quantum number by copy.
This file contains the definition of Array.
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify(const T &first, const Ts &... the_rest)
Make a std::array of a list of variables (must be 1-long at least)
constexpr QuantumNumbers() noexcept
Initializer with undefined values.
static constexpr Index TRANSITION_LOWER_INDEX
Lower level index.
void SetEnergyLevel(const QuantumNumbers &q)
Set tp energy level identifier.
QuantumIdentifier(const Index spec, const Index isot, const std::vector< QuantumNumberType > &keys, const std::vector< Rational > &upper, const std::vector< Rational > &lower)
Initialize with transition identifier type.
void SetFromString(String str)
Set from a String object.
This can be used to make arrays out of anything.
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.
String SpeciesName() const
Return the Species by name.
static constexpr Index TRANSITION_UPPER_INDEX
Upper level index.
constexpr QuantumIdentifier(const QuantumIdentifier::QType &qt, const Index species, const Index iso) noexcept
Initialize with no quantum numbers defined but known species and matching type.
void Species(Index sp)
Set the Species.
constexpr QuantumIdentifier(const Index spec, const Index isot, const QuantumNumbers &upper, const QuantumNumbers &lower) noexcept
Initialize with transition identifier type.
Index & Isotopologue()
Return the Isotopologue by index reference.
void SetNone()
Set to NONE identifier.
QuantumNumbers & UpperQuantumNumbers()
Return the upper quantum numbers by reference.
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.
void Set(QuantumNumberType qn, Rational r)
Set quantum number at position.
constexpr QuantumIdentifier LowerQuantumId() const noexcept
Return a quantum identifer as if it wants to match to lower energy level.
void SetFromStringForCO2Band(String upper, String lower, String iso)
Set CO2 transition from String objects.
Index nNumbers() const
The number of defined quantum numbers.
std::ostream & operator<<(std::ostream &os, const QuantumNumbers &qn)
Output operator.
constexpr QType Type() const
std::istream & operator>>(std::istream &is, QuantumNumbers &qn)
Input operator.
void SetTransition()
Set key to transition type.
const QuantumNumbers & LowerQuantumNumbers() const noexcept
Return the lower quantum numbers by const reference.
void Set(String qn, Rational r)
Set quantum number at position.
std::array< Rational, Index(QuantumNumberType::FINAL_ENTRY)> QuantumContainer
QType
Ways to identify quantum numbers.
Rational & operator[](const Index qn) noexcept
Access operator.
constexpr Rational UpperQuantumNumber(QuantumNumberType X) const noexcept
Return a upper quantum number by copy.
static QType string2Type(const String &str) noexcept
QuantumContainer mqnumbers
Array< QuantumIdentifier > ArrayOfQuantumIdentifier
QuantumIdentifier(String x)
Construct a new Quantum Identifier object from text.
constexpr QuantumIdentifier(const Index spec, const Index isot, const QuantumNumbers &qnr) noexcept
Initialize with energy level identifier type.
bool IsEnergyLevelType() const
Check if *this is a energy level type of identifier.
QuantumNumbers & EnergyLevelQuantumNumbers()
Return the energy level quantum numbers by reference.
bool Compare(const QuantumNumbers &qn) const
Compare Quantum Numbers Ignores any undefined numbers in the comparison.
Index & Species()
Return the Species by index reference.
Array< QuantumNumbers > ArrayOfQuantumNumbers
Rational & UpperQuantumNumber(QuantumNumberType X) noexcept
Return a upper quantum number by copy.
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.
constexpr QuantumIdentifier() noexcept
Initialize with no matches.
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.
QuantumNumbers & LowerQuantumNumbers()
Return the lower quantum numbers by reference.
void Set(Index qn, Rational r)
Set quantum number at position.
constexpr Rational operator[](const Index qn) const noexcept
Access operator.
Implements rational numbers to work with other ARTS types.
This file contains the definition of String, the ARTS string class.
const QuantumNumbers & UpperQuantumNumbers() const noexcept
Return the upper quantum numbers by const reference.
void SetAll()
Set to All identifier.
constexpr Rational operator[](const QuantumNumberType qn) const noexcept
Access operator.
std::array< QuantumNumbers, 2 > & QuantumMatch()
Return the quantum numbers array reference.