ARTS 2.5.4 (git: 4c0d3b4d)
energylevelmap.h
Go to the documentation of this file.
1/* Copyright (C) 2019
2 Richard Larsson <ric.larsson@gmail.com>
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the
6 Free Software Foundation; either version 2, or (at your option) any
7 later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 USA. */
18
27#ifndef energylevelmap_h
28#define energylevelmap_h
29
30#include "absorptionlines.h"
31#include "matpackIV.h"
32#include "mystring.h"
33#include "quantum_numbers.h"
34
35// Output from EnergyLevelMap
36struct Output2{
39};
40
41// Output from EnergyLevelMap
42struct Output4{
47};
48
53 None_t,
55};
56
57constexpr EnergyLevelMapType toEnergyLevelMapType(std::string_view s) noexcept {
58 if (s == "Tensor3")
60 if (s == "Vector")
62 if (s == "Numeric")
64 if (s == "None")
67}
68
70
71constexpr std::string_view toString(EnergyLevelMapType x) noexcept {
72 switch(x) {
74 return "Tensor3";
76 return "Vector";
78 return "Numeric";
80 return "None";
82 {/* leave last */}
83 }
84 return "BAD EnergyLevelMapType";
85}
86
87inline std::ostream& operator<<(std::ostream& os, EnergyLevelMapType x) {return os << toString(x);}
88
94
95 [[nodiscard]] bool OK() const noexcept;
96
97 void ThrowIfNotOK() const ARTS_NOEXCEPT {ARTS_ASSERT (OK(), "Class in bad state");}
98
100 vib_energy(0), value(0, 0, 0, 0) {}
101
103 Index cols, const EnergyLevelMap& old) :
104 type(new_type), levels(old.levels), vib_energy(old.vib_energy),
105 value(old.levels.nelem(), pages, rows, cols) {ThrowIfNotOK();};
106
107 // Create Tensor3_t from the raw inputs
109
110 // Create Vector_t from the raw inputs
112
113 // Create Numeric_t from the raw inputs
115
116 // Create Vector_t from Tensor3_t
117 [[nodiscard]] EnergyLevelMap InterpToGridPos(Index atmosphere_dim, const ArrayOfGridPos& p, const ArrayOfGridPos& lat, const ArrayOfGridPos& lon) const;
118
119 // Create Numeric_t from Vector_t
120 [[nodiscard]] EnergyLevelMap operator[](Index ip) const;
121
122 // Create Numeric_t from Tensor3_t
123 [[nodiscard]] EnergyLevelMap operator()(Index ip, Index ilat, Index ilon) const;
124
126 // Numeric_t access //
128
134 [[nodiscard]] Output2 get_ratio_params(const AbsorptionLines& band, const Index& line_index) const;
135
141 [[nodiscard]] Output4 get_vibtemp_params(const AbsorptionLines& band, const Numeric T) const;
142};
143
144std::ostream& operator<<(std::ostream& os, const EnergyLevelMap& elm);
145
146#endif // energylevelmap_h
Contains the absorption namespace.
The Matrix class.
Definition: matpackI.h:1270
The Tensor4 class.
Definition: matpackIV.h:427
The Vector class.
Definition: matpackI.h:908
#define ARTS_NOEXCEPT
Definition: debug.h:80
#define ARTS_ASSERT(condition,...)
Definition: debug.h:83
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
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
This file contains the definition of String, the ARTS string class.
Index nelem(const Lines &l)
Number of lines.
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
Definition: oem.h:31
EnergyLevelMap operator[](Index ip) const
Output2 get_ratio_params(const AbsorptionLines &band, const Index &line_index) const
Get the output required for Population::NLTE.
bool OK() const noexcept
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
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