ARTS
2.4.0(git:4fb77825)
|
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 |
|
inlineconstexprnoexcept |
Initialize with no matches.
Definition at line 396 of file quantum.h.
Referenced by LowerQuantumId(), and UpperQuantumId().
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
Initialize with transition identifier type.
[in] | species | Species index-mapped |
[in] | iso | Isotopologue index-mapped |
[in] | ids | List of quantum number keys |
[in] | upper | Upper state quantum numbers |
[in] | lower | Lower state quantum numbers |
Definition at line 434 of file quantum.h.
References mqm, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.
|
inlineconstexprnoexcept |
|
inlineexplicit |
Construct a new Quantum Identifier object from text.
[in] | x | Text |
Definition at line 466 of file quantum.h.
References SetFromString(), and ARTS::Var::x().
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, J, mqm, mqtype, NONE, and TRANSITION.
|
inlineconstexprnoexcept |
Return a energy level quantum number by copy.
Definition at line 622 of file quantum.h.
References ENERGY_LEVEL_INDEX, and mqm.
|
inline |
Return the energy level quantum numbers by reference.
Definition at line 637 of file quantum.h.
References ENERGY_LEVEL_INDEX, and mqm.
|
inlinenoexcept |
Return the energy level quantum numbers by const reference.
Definition at line 617 of file quantum.h.
References ENERGY_LEVEL_INDEX, and mqm.
Referenced by abs_linesKeepBands().
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, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.
Referenced by abs_linesRemoveBand(), abs_linesSetCutoffForMatch(), abs_linesSetLinemixingLimitForMatch(), abs_linesSetLineShapeTypeForMatch(), abs_linesSetMirroringForMatch(), abs_linesSetNormalizationForMatch(), abs_linesSetPopulationForMatch(), and abs_linesSetT0ForMatch().
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, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, and TRANSITION_LOWER_INDEX.
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, ENERGY_LEVEL_INDEX, J, miso, mqm, mqtype, mspecies, NONE, TRANSITION, and TRANSITION_UPPER_INDEX.
|
inline |
Check if *this is a energy level type of identifier.
Definition at line 684 of file quantum.h.
References ENERGY_LEVEL, and mqtype.
|
inline |
|
inlineconstexpr |
Return the Isotopologue by index.
Definition at line 565 of file quantum.h.
References miso.
Referenced by SetFromString().
|
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(), Absorption::Lines::Isotopologue(), jacobianAddAbsSpecies(), operator<<(), operator==(), species_iso_match(), and species_match().
|
inlineconstexprnoexcept |
Return a quantum identifer as if it wants to match to lower energy level.
Definition at line 582 of file quantum.h.
References miso, mqm, mspecies, QuantumIdentifier(), and TRANSITION_LOWER_INDEX.
|
inlineconstexprnoexcept |
Return a lower quantum number by copy.
Definition at line 602 of file quantum.h.
References mqm, and TRANSITION_LOWER_INDEX.
Referenced by postprocess_group1_hitran(), postprocess_group2_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), Absorption::SingleLine::SetAutomaticZeeman(), and update_id().
|
inlinenoexcept |
Return a lower quantum number by copy.
Definition at line 612 of file quantum.h.
References mqm, and TRANSITION_LOWER_INDEX.
|
inline |
Return the lower quantum numbers by reference.
Definition at line 632 of file quantum.h.
References mqm, and TRANSITION_LOWER_INDEX.
|
inlinenoexcept |
Return the lower quantum numbers by const reference.
Definition at line 592 of file quantum.h.
References mqm, and TRANSITION_LOWER_INDEX.
Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), 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.
References mqm.
Referenced by operator<<(), operator==(), and SetFromString().
|
inline |
Set to All identifier.
Definition at line 503 of file quantum.h.
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, ENERGY_LEVEL_INDEX, mqm, mqtype, 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, SpeciesRecord::Isotopologue(), Isotopologue(), mqtype, SpeciesRecord::Name(), Absorption::nelem(), NONE, QuantumMatch(), Species(), global_data::species_data, ThrowIfQuantumNumberNameInvalid(), TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.
Referenced by QuantumIdentifier(), SetFromStringForCO2Band(), and 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 iso(), my_basic_string< charT >::nelem(), and SetFromString().
|
inline |
|
inline |
Set key to transition type.
Definition at line 509 of file quantum.h.
References mqtype, and TRANSITION.
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 mqm, mqtype, TRANSITION, TRANSITION_LOWER_INDEX, and TRANSITION_UPPER_INDEX.
Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), and Absorption::Lines::truncate_global_quantum_numbers().
|
inline |
|
inlineconstexpr |
Return the Species by index.
Definition at line 559 of file quantum.h.
References mspecies.
Referenced by SetFromString().
|
inline |
Set the Species.
[in] | sp | Species index-mapped |
Definition at line 481 of file quantum.h.
References mspecies.
Referenced by abs_linesKeepBands(), SpeciesAuxData::getIsotopologueRatio(), SpeciesAuxData::getParam(), SpeciesAuxData::getParamType(), jacobianAddAbsSpecies(), operator<<(), operator==(), QuantumParserHITRAN2004::Parse(), postprocess_group1_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), LineShape::LegacyPressureBroadeningData::self_listed(), Absorption::Lines::Species(), and species_match().
String QuantumIdentifier::SpeciesName | ( | ) | const |
Return the Species by name.
Definition at line 225 of file quantum.cc.
References mspecies, and species_name_from_species_index().
Definition at line 538 of file quantum.h.
References ALL, ENERGY_LEVEL, NONE, and TRANSITION.
|
inlineconstexpr |
Definition at line 526 of file quantum.h.
References mqtype.
Referenced by abs_linesChangeBaseParameterForMatchingLevel(), abs_linesKeepBands(), abs_linesSetBaseParameterForMatchingLevel(), jacobianAddShapeCatalogParameter(), operator<<(), operator==(), and species_match().
|
inline |
String QuantumIdentifier::TypeStr | ( | ) | const |
Definition at line 203 of file quantum.cc.
References ALL, ENERGY_LEVEL, mqtype, NONE, and TRANSITION.
|
inlineconstexprnoexcept |
Return a quantum identifer as if it wants to match to upper energy level.
Definition at line 577 of file quantum.h.
References miso, mqm, mspecies, QuantumIdentifier(), and TRANSITION_UPPER_INDEX.
|
inlineconstexprnoexcept |
Return a upper quantum number by copy.
Definition at line 597 of file quantum.h.
References mqm, and TRANSITION_UPPER_INDEX.
Referenced by postprocess_group1_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), postprocess_group6oh_hitran(), Absorption::SingleLine::SetAutomaticZeeman(), and update_id().
|
inlinenoexcept |
Return a upper quantum number by copy.
Definition at line 607 of file quantum.h.
References mqm, and TRANSITION_UPPER_INDEX.
|
inline |
Return the upper quantum numbers by reference.
Definition at line 627 of file quantum.h.
References mqm, and TRANSITION_UPPER_INDEX.
|
inlinenoexcept |
Return the upper quantum numbers by const reference.
Definition at line 587 of file quantum.h.
References mqm, and TRANSITION_UPPER_INDEX.
Referenced by abs_linesKeepBands(), QuantumParserHITRAN2004::Parse(), postprocess_group1_hitran(), postprocess_group2_hitran(), postprocess_group5_hitran(), postprocess_group6_hitran(), and postprocess_group6oh_hitran().
|
inlinestaticnoexcept |
Checks if input is a valid Type.
Definition at line 532 of file quantum.h.
References ALL, ENERGY_LEVEL, NONE, stdarrayify(), TRANSITION, ARTS::Var::x(), and ARTS::Var::y().
|
staticconstexpr |
Energy level index.
Definition at line 475 of file quantum.h.
Referenced by EnergyLevelQuantumNumber(), EnergyLevelQuantumNumbers(), In(), InLower(), InUpper(), operator<<(), operator==(), and SetEnergyLevel().
|
private |
Definition at line 689 of file quantum.h.
Referenced by In(), InLower(), InUpper(), Isotopologue(), LowerQuantumId(), and UpperQuantumId().
|
private |
Definition at line 690 of file quantum.h.
Referenced by any_quantumnumbers(), EnergyLevelQuantumNumber(), EnergyLevelQuantumNumbers(), In(), InLower(), InUpper(), LowerQuantumId(), LowerQuantumNumber(), LowerQuantumNumbers(), QuantumIdentifier(), QuantumMatch(), SetEnergyLevel(), SetTransition(), UpperQuantumId(), UpperQuantumNumber(), and UpperQuantumNumbers().
|
private |
Definition at line 687 of file quantum.h.
Referenced by any_quantumnumbers(), In(), InLower(), InUpper(), IsEnergyLevelType(), SetAll(), SetEnergyLevel(), SetFromString(), SetNone(), SetTransition(), Type(), and TypeStr().
|
private |
Definition at line 688 of file quantum.h.
Referenced by In(), InLower(), InUpper(), LowerQuantumId(), Species(), SpeciesName(), and UpperQuantumId().
|
staticconstexpr |
Lower level index.
Definition at line 472 of file quantum.h.
Referenced by In(), InLower(), LowerQuantumId(), LowerQuantumNumber(), LowerQuantumNumbers(), operator<<(), operator==(), QuantumIdentifier(), SetFromString(), and SetTransition().
|
staticconstexpr |
Upper level index.
Definition at line 469 of file quantum.h.
Referenced by In(), InUpper(), operator<<(), operator==(), QuantumIdentifier(), SetFromString(), SetTransition(), UpperQuantumId(), UpperQuantumNumber(), and UpperQuantumNumbers().