ARTS 2.5.11 (git: 6827797f)
energylevelmap.h
Go to the documentation of this file.
1
9#ifndef energylevelmap_h
10#define energylevelmap_h
11
12#include "absorptionlines.h"
13#include "matpack_data.h"
14#include "mystring.h"
15#include "quantum_numbers.h"
16
17// Output from EnergyLevelMap
18struct Output2{
19 Numeric r_low;
20 Numeric r_upp;
21};
22
23// Output from EnergyLevelMap
24struct Output4{
25 Numeric E_low;
26 Numeric E_upp;
27 Numeric T_low;
28 Numeric T_upp;
29};
30
35 None_t,
37};
38
39constexpr EnergyLevelMapType toEnergyLevelMapType(std::string_view s) noexcept {
40 if (s == "Tensor3")
42 if (s == "Vector")
44 if (s == "Numeric")
46 if (s == "None")
49}
50
52
53constexpr std::string_view toString(EnergyLevelMapType x) noexcept {
54 switch(x) {
56 return "Tensor3";
58 return "Vector";
60 return "Numeric";
62 return "None";
64 {/* leave last */}
65 }
66 return "BAD EnergyLevelMapType";
67}
68
69std::ostream& operator<<(std::ostream& os, EnergyLevelMapType x);
70
72 EnergyLevelMapType type{EnergyLevelMapType::None_t};
74 Vector vib_energy;
75 Tensor4 value;
76
77 [[nodiscard]] bool OK() const ARTS_NOEXCEPT;
78
79 void ThrowIfNotOK() const ARTS_NOEXCEPT {ARTS_ASSERT (OK(), "Class in bad state");}
80
82 vib_energy(0), value(0, 0, 0, 0) {}
83
84 EnergyLevelMap(EnergyLevelMapType new_type, Index pages, Index rows,
85 Index cols, const EnergyLevelMap& old) :
86 type(new_type), levels(old.levels), vib_energy(old.vib_energy),
87 value(old.levels.nelem(), pages, rows, cols) {ThrowIfNotOK();};
88
89 // Create Tensor3_t from the raw inputs
90 EnergyLevelMap(Tensor4 data, ArrayOfQuantumIdentifier levels, Vector energies=Vector(0));
91
92 // Create Vector_t from the raw inputs
93 EnergyLevelMap(const Matrix& data, ArrayOfQuantumIdentifier levels, Vector energies=Vector(0));
94
95 // Create Numeric_t from the raw inputs
96 EnergyLevelMap(const Vector& data, ArrayOfQuantumIdentifier levels, Vector energies=Vector(0));
97
98 // Create Vector_t from Tensor3_t
99 [[nodiscard]] EnergyLevelMap InterpToGridPos(Index atmosphere_dim, const ArrayOfGridPos& p, const ArrayOfGridPos& lat, const ArrayOfGridPos& lon) const;
100
101 // Create Numeric_t from Vector_t
102 [[nodiscard]] EnergyLevelMap operator[](Index ip) const;
103
104 // Create Numeric_t from Tensor3_t
105 [[nodiscard]] EnergyLevelMap operator()(Index ip, Index ilat, Index ilon) const;
106
108 // Numeric_t access //
110
116 [[nodiscard]] Output2 get_ratio_params(const AbsorptionLines& band, const Index& line_index) const;
117
123 [[nodiscard]] Output4 get_vibtemp_params(const AbsorptionLines& band, const Numeric T) const;
124
125 friend std::ostream& operator<<(std::ostream& os, const EnergyLevelMap& elm);
126};
127
128#endif // energylevelmap_h
Contains the absorption namespace.
#define ARTS_NOEXCEPT
Definition: debug.h:81
#define ARTS_ASSERT(condition,...)
Definition: debug.h:84
EnergyLevelMapType
constexpr EnergyLevelMapType toEnergyLevelMapType(std::string_view s) noexcept
std::ostream & operator<<(std::ostream &os, EnergyLevelMapType x)
EnergyLevelMapType toEnergyLevelMapTypeOrThrow(std::string_view s)
constexpr std::string_view toString(EnergyLevelMapType x) noexcept
This file contains the definition of String, the ARTS string class.
bool OK() const ARTS_NOEXCEPT
EnergyLevelMap operator[](Index ip) const
Output2 get_ratio_params(const AbsorptionLines &band, const Index &line_index) const
Get the output required for Population::NLTE.
EnergyLevelMap(EnergyLevelMapType new_type, Index pages, Index rows, Index cols, const EnergyLevelMap &old)
Output4 get_vibtemp_params(const AbsorptionLines &band, const Numeric T) const
Get the output required for Population::NLTE-VibrationalTemperatures.
EnergyLevelMap InterpToGridPos(Index atmosphere_dim, const ArrayOfGridPos &p, const ArrayOfGridPos &lat, const ArrayOfGridPos &lon) const
ArrayOfQuantumIdentifier levels
EnergyLevelMapType type
friend std::ostream & operator<<(std::ostream &os, const EnergyLevelMap &elm)
void ThrowIfNotOK() const ARTS_NOEXCEPT
EnergyLevelMap operator()(Index ip, Index ilat, Index ilon) const
Numeric r_upp
Numeric r_low
Numeric E_upp
Numeric T_upp
Numeric T_low
Numeric E_low