ARTS
2.3.1285(git:92a29ea9-dirty)
|
Class to identify and match lines by their quantum numbers. More...
#include <quantum.h>
Public Types | |
enum | QType : Index { TRANSITION, ENERGY_LEVEL, ALL, NONE } |
Ways to identify quantum numbers. More... | |
Public Member Functions | |
constexpr | QuantumIdentifier () noexcept |
Initialize with no matches. More... | |
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. More... | |
constexpr | QuantumIdentifier (const Index spec, const Index isot, const QuantumNumbers &upper, const QuantumNumbers &lower) noexcept |
Initialize with transition identifier type. More... | |
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. More... | |
constexpr | QuantumIdentifier (const Index spec, const Index isot, const QuantumNumbers &qnr) noexcept |
Initialize with energy level identifier type. More... | |
QuantumIdentifier (String x) | |
Construct a new Quantum Identifier object from text. More... | |
void | Species (Index sp) |
Set the Species. More... | |
void | Isotopologue (Index iso) |
Set the Isotopologue. More... | |
void | SetTransition (const QuantumNumbers &upper, const QuantumNumbers &lower) |
Set to transition type identifier. More... | |
void | SetEnergyLevel (const QuantumNumbers &q) |
Set tp energy level identifier. More... | |
void | SetAll () |
Set to All identifier. More... | |
void | SetNone () |
Set to NONE identifier. More... | |
void | SetTransition () |
Set key to transition type. More... | |
void | SetFromString (String str) |
Set from a String object. More... | |
void | SetFromStringForCO2Band (String upper, String lower, String iso) |
Set CO2 transition from String objects. More... | |
constexpr QType | Type () const |
void | Type (QType x) |
Set Type. More... | |
String | TypeStr () const |
String | SpeciesName () const |
Return the Species by name. More... | |
constexpr Index | Species () const |
Return the Species by index. More... | |
Index & | Species () |
Return the Species by index reference. More... | |
constexpr Index | Isotopologue () const |
Return the Isotopologue by index. More... | |
Index & | Isotopologue () |
Return the Isotopologue by index reference. More... | |
const std::array< QuantumNumbers, 2 > & | QuantumMatch () const |
Return the quantum numbers array const reference. More... | |
std::array< QuantumNumbers, 2 > & | QuantumMatch () |
Return the quantum numbers array reference. More... | |
constexpr QuantumIdentifier | UpperQuantumId () const noexcept |
Return a quantum identifer as if it wants to match to upper energy level. More... | |
constexpr QuantumIdentifier | LowerQuantumId () const noexcept |
Return a quantum identifer as if it wants to match to lower energy level. More... | |
const QuantumNumbers & | UpperQuantumNumbers () const noexcept |
Return the upper quantum numbers by const reference. More... | |
const QuantumNumbers & | LowerQuantumNumbers () const noexcept |
Return the lower quantum numbers by const reference. More... | |
constexpr Rational | UpperQuantumNumber (QuantumNumberType X) const noexcept |
Return a upper quantum number by copy. More... | |
constexpr Rational | LowerQuantumNumber (QuantumNumberType X) const noexcept |
Return a lower quantum number by copy. More... | |
Rational & | UpperQuantumNumber (QuantumNumberType X) noexcept |
Return a upper quantum number by copy. More... | |
Rational & | LowerQuantumNumber (QuantumNumberType X) noexcept |
Return a lower quantum number by copy. More... | |
const QuantumNumbers & | EnergyLevelQuantumNumbers () const noexcept |
Return the energy level quantum numbers by const reference. More... | |
constexpr Rational | EnergyLevelQuantumNumber (QuantumNumberType X) const noexcept |
Return a energy level quantum number by copy. More... | |
QuantumNumbers & | UpperQuantumNumbers () |
Return the upper quantum numbers by reference. More... | |
QuantumNumbers & | LowerQuantumNumbers () |
Return the lower quantum numbers by reference. More... | |
QuantumNumbers & | EnergyLevelQuantumNumbers () |
Return the energy level quantum numbers by reference. More... | |
bool | In (const QuantumIdentifier &other) const |
Return if this is in other. More... | |
bool | InLower (const QuantumIdentifier &other) const |
Return if this is in other's lower energy state. More... | |
bool | InUpper (const QuantumIdentifier &other) const |
Return if this is in other's upper energy state. More... | |
bool | any_quantumnumbers () const |
Check if there are any quantum numbers defined. More... | |
bool | IsEnergyLevelType () const |
Check if *this is a energy level type of identifier. More... | |
Static Public Member Functions | |
static bool | validIndexForType (Index x) noexcept |
Checks if input is a valid Type. More... | |
static QType | string2Type (const String &str) noexcept |
Static Public Attributes | |
static constexpr Index | TRANSITION_UPPER_INDEX = 0 |
Upper level index. More... | |
static constexpr Index | TRANSITION_LOWER_INDEX = 1 |
Lower level index. More... | |
static constexpr Index | ENERGY_LEVEL_INDEX = 0 |
Energy level index. More... | |
Private Attributes | |
QType | mqtype |
Index | mspecies |
Index | miso |
std::array< QuantumNumbers, 2 > | mqm |
Class to identify and match lines by their quantum numbers.
Describes a transition, an energy level, all numbers or none as matchable. Useful to match to line energy levels and to identify lines themselves.
For transitions, the QI contains upper and lower quantum numbers. For energy levels, it only holds one set of quantum numbers which are then matched against the upper and lower qns of the lines. For all and none no quantum numbers are considered
File format: Transition: SPECIES_NAME-ISOTOPE TR UP QUANTUMNUMBERS LO QUANTUMNUMBERS Energy level: SPECIES_NAME-ISOTOPE EN QUANTUMNUMBERS All lines: SPECIES_NAME-ISOTOPE ALL No lines: SPECIES_NAME-ISOTOPE NONE
Example written out: H2O-161 TR UP J 0/1 v1 2/3 LO J 1/1 v2 1/2 H2O-161 EN J 0/1 v1 2/3 H2O-161 ALL H2O-161 NONE
enum QuantumIdentifier::QType : Index |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlineexplicit |
bool QuantumIdentifier::any_quantumnumbers | ( | ) | const |
Check if there are any quantum numbers defined.
Definition at line 392 of file quantum.cc.
References ALL, ENERGY_LEVEL, FINAL_ENTRY, NONE, and TRANSITION.
|
inlinenoexcept |
|
inlinenoexcept |
Return the energy level quantum numbers by const reference.
Definition at line 617 of file quantum.h.
Referenced by abs_linesKeepBands().
|
inline |
bool QuantumIdentifier::In | ( | const QuantumIdentifier & | other | ) | const |
Return if this is in other.
All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.
[in] | other | Another quantum identifier |
Definition at line 117 of file quantum.cc.
References ALL, FINAL_ENTRY, i, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.
Referenced by abs_linesChangeBaseParameterForMatchingLines(), abs_linesChangeLineShapeModelParameterForMatchingLines(), abs_linesRemoveBand(), abs_linesSetBaseParameterForMatchingLines(), abs_linesSetCutoffForMatch(), abs_linesSetLinemixingLimitForMatch(), abs_linesSetLineShapeModelParameterForMatchingLines(), abs_linesSetLineShapeTypeForMatch(), abs_linesSetMirroringForMatch(), abs_linesSetNormalizationForMatch(), abs_linesSetPopulationForMatch(), abs_linesSetT0ForMatch(), and nlteSetByQuantumIdentifiers().
bool QuantumIdentifier::InLower | ( | const QuantumIdentifier & | other | ) | const |
Return if this is in other's lower energy state.
All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.
[in] | other | Another quantum identifier |
Definition at line 86 of file quantum.cc.
References ALL, ENERGY_LEVEL, FINAL_ENTRY, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.
bool QuantumIdentifier::InUpper | ( | const QuantumIdentifier & | other | ) | const |
Return if this is in other's upper energy state.
All quantum numbers defined in *this must be the same as the quantum numbers in other for a call to In() to return true. The numbers in other must not all be defined in *this.
[in] | other | Another quantum identifier |
Definition at line 55 of file quantum.cc.
References ALL, ENERGY_LEVEL, FINAL_ENTRY, miso, mqm, mqtype, mspecies, NONE, and TRANSITION.
|
inline |
|
inline |
Set the Isotopologue.
[in] | is | Isotopologue index-mapped |
Definition at line 487 of file quantum.h.
Referenced by abs_linesKeepBands(), SpeciesAuxData::getIsotopologueRatio(), SpeciesAuxData::getParam(), SpeciesAuxData::getParamType(), LineRecord::IsNotSameSpecIso(), Absorption::Lines::Isotopologue(), LineRecord::IsotopologueData(), jacobianAddAbsSpecies(), line_match_level(), line_match_line(), LineRecord::Name(), operator<<(), operator==(), partial_derivatives_lineshape_dependency(), LineRecord::ReadFromHitran2001Stream(), Absorption::ReadFromHitran2001Stream(), LineRecord::ReadFromHitran2004Stream(), Absorption::ReadFromHitran2004Stream(), Absorption::ReadFromHitranOnlineStream(), LineRecord::ReadFromLBLRTMStream(), Absorption::ReadFromLBLRTMStream(), LineRecord::ReadFromMytran2Stream(), Absorption::ReadFromMytran2Stream(), species_iso_match(), and species_match().
|
inline |
|
inline |
|
inlinenoexcept |
Return a quantum identifer as if it wants to match to lower energy level.
Definition at line 582 of file quantum.h.
Referenced by nlteSetByQuantumIdentifiers().
|
inlinenoexcept |
Return a lower quantum number by copy.
Definition at line 602 of file quantum.h.
Referenced by postprocess_group1_hitran(), postprocess_group2_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), Absorption::SingleLine::SetAutomaticZeeman(), and update_id().
|
inlinenoexcept |
|
inlinenoexcept |
Return the lower quantum numbers by const reference.
Definition at line 592 of file quantum.h.
Referenced by abs_linesKeepBands(), Absorption::Lines::LowerQuantumNumbers(), QuantumParserHITRAN2004::Parse(), partial_derivatives_lineshape_dependency(), postprocess_group1_hitran(), postprocess_group2_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), and postprocess_group6oh_hitran().
|
inline |
|
inline |
Return the quantum numbers array const reference.
Definition at line 571 of file quantum.h.
Referenced by line_match_level(), line_match_line(), operator<<(), and operator==().
|
inline |
|
inline |
Set to All identifier.
Definition at line 503 of file quantum.h.
References ALL.
Referenced by jacobianAddAbsSpecies().
void QuantumIdentifier::SetEnergyLevel | ( | const QuantumNumbers & | q | ) |
Set tp energy level identifier.
[in] | q | Quantum numbers |
Definition at line 236 of file quantum.cc.
References ENERGY_LEVEL, and q.
void QuantumIdentifier::SetFromString | ( | String | str | ) |
Set from a String object.
[in] | str | The string to set this from |
Definition at line 241 of file quantum.cc.
References ALL, ENERGY_LEVEL, i, SpeciesRecord::Isotopologue(), Isotopologue, SpeciesRecord::Name(), Array< base >::nelem(), NONE, r, Species, global_data::species_data, _CS_basic_sstream_base< _CS_cT, _CS_Tr, _CS_Al >::str(), ThrowIfQuantumNumberNameInvalid(), TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.
Referenced by xml_read_from_stream().
Set CO2 transition from String objects.
[in] | upper | Upper state quantum numbers |
[in] | lower | Lower state quantum numbers |
[in] | iso | Isotopologue by string |
Definition at line 341 of file quantum.cc.
References my_basic_string< charT >::nelem().
|
inline |
void QuantumIdentifier::SetTransition | ( | const QuantumNumbers & | upper, |
const QuantumNumbers & | lower | ||
) |
Set to transition type identifier.
[in] | upper | Upper state quantum numbers |
[in] | lower | Lower state quantum numbers |
Definition at line 229 of file quantum.cc.
References TRANSITION.
Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), and Absorption::Lines::truncate_global_quantum_numbers().
|
inline |
Set key to transition type.
Definition at line 509 of file quantum.h.
References iso(), and TRANSITION.
|
inline |
Set the Species.
[in] | sp | Species index-mapped |
Definition at line 481 of file quantum.h.
Referenced by abs_linesKeepBands(), SpeciesAuxData::getIsotopologueRatio(), SpeciesAuxData::getParam(), SpeciesAuxData::getParamType(), LineRecord::IsNotSameSpecIso(), LineRecord::IsotopologueData(), jacobianAddAbsSpecies(), line_match_level(), line_match_line(), LineRecord::Name(), operator<<(), operator==(), QuantumParserHITRAN2004::Parse(), partial_derivatives_lineshape_dependency(), postprocess_group1_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), LineRecord::ReadFromHitran2001Stream(), Absorption::ReadFromHitran2001Stream(), LineRecord::ReadFromHitran2004Stream(), Absorption::ReadFromHitran2004Stream(), Absorption::ReadFromHitranOnlineStream(), LineRecord::ReadFromLBLRTMStream(), Absorption::ReadFromLBLRTMStream(), LineRecord::ReadFromMytran2Stream(), Absorption::ReadFromMytran2Stream(), LineShape::LegacyPressureBroadeningData::self_listed(), Absorption::Lines::Species(), species_match(), and LineRecord::SpeciesData().
|
inline |
|
inline |
String QuantumIdentifier::SpeciesName | ( | ) | const |
Return the Species by name.
Definition at line 225 of file quantum.cc.
References species_name_from_species_index().
Definition at line 538 of file quantum.h.
References ALL, ENERGY_LEVEL, NONE, and TRANSITION.
|
inline |
Definition at line 526 of file quantum.h.
Referenced by abs_linesChangeBaseParameterForMatchingLevel(), abs_linesKeepBands(), abs_linesSetBaseParameterForMatchingLevel(), jacobianAddShapeCatalogParameter(), line_match_line(), operator<<(), operator==(), and species_match().
String QuantumIdentifier::TypeStr | ( | ) | const |
Definition at line 203 of file quantum.cc.
References ALL, ENERGY_LEVEL, NONE, and TRANSITION.
|
inlinenoexcept |
Return a quantum identifer as if it wants to match to upper energy level.
Definition at line 577 of file quantum.h.
Referenced by nlteSetByQuantumIdentifiers().
|
inlinenoexcept |
Return a upper quantum number by copy.
Definition at line 597 of file quantum.h.
Referenced by postprocess_group1_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), Absorption::Lines::QuantumIdentityOfLine(), Absorption::SingleLine::SetAutomaticZeeman(), and update_id().
|
inlinenoexcept |
|
inlinenoexcept |
Return the upper quantum numbers by const reference.
Definition at line 587 of file quantum.h.
Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), partial_derivatives_lineshape_dependency(), postprocess_group1_hitran(), postprocess_group2_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), and Absorption::Lines::UpperQuantumNumbers().
|
inline |
|
inlinestaticnoexcept |
Checks if input is a valid Type.
Definition at line 532 of file quantum.h.
References stdarrayify().
|
static |
Energy level index.
Definition at line 475 of file quantum.h.
Referenced by operator<<(), and operator==().
|
private |
|
private |
|
private |
|
private |
|
static |
Lower level index.
Definition at line 472 of file quantum.h.
Referenced by line_match_line(), operator<<(), operator==(), and SetFromString().
|
static |
Upper level index.
Definition at line 469 of file quantum.h.
Referenced by line_match_level(), line_match_line(), operator<<(), operator==(), and SetFromString().