ARTS 2.5.9 (git: 825fa5f2)
absorption.cc
Go to the documentation of this file.
1/* Copyright (C) 2000-2012
2 Stefan Buehler <sbuehler@ltu.se>
3 Axel von Engeln <engeln@uni-bremen.de>
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 2, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 USA. */
19
33#include "absorption.h"
34#include "arts.h"
35#include "arts_conversions.h"
36#include "auto_md.h"
37#include "file.h"
38#include "linescaling.h"
39#include "lineshape.h"
40#include "logic.h"
41#include "math_funcs.h"
42#include "messages.h"
43#include "partfun.h"
44#include <algorithm>
45#include <cfloat>
46#include <cmath>
47#include <cstdlib>
48#include <map>
49
50#include "global_data.h"
51
52void checkPartitionFunctions(const ArrayOfArrayOfAbsorptionLines& abs_lines_per_species) {
53 for (auto& abs_lines: abs_lines_per_species) {
54 for (auto& band: abs_lines) {
56 "Species: ", band.Isotopologue().FullName(), " has no partition function\n",
57 "You must recompile ARTS partition functions with data for this species to continue your calculations,\n"
58 "or exclude the species from your computation setup")
59 }
60 }
61}
62
64 const Species::IsotopologueRatios& isoratios) {
65
66 for (auto& abs_lines: abs_lines_per_species) {
67 for (auto& band: abs_lines) {
68 ARTS_USER_ERROR_IF (std::isnan(isoratios[band.Isotopologue()]),
69 "Species: ", band.Isotopologue().FullName(), " has no isotopologue ratios\n",
70 "You must add its isotopologue ratios to your included data or\n"
71 "exclude the species from your computation setup")
72 }
73 }
74}
75
89}
90
92
104 const String& species_name,
105 const ArrayOfArrayOfSpeciesTag& abs_species,
106 const Matrix& abs_vmrs) {
107 const Index index = find_first_species(abs_species, Species::fromShortName(species_name));
108
109 vmr.resize(abs_vmrs.ncols());
110 if (index < 0)
111 vmr = -99;
112 else
113 vmr = abs_vmrs(index, Range(joker));
114}
void checkIsotopologueRatios(const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species, const Species::IsotopologueRatios &isoratios)
Check that isotopologue ratios for the given species are correctly defined.
Definition: absorption.cc:63
void checkPartitionFunctions(const ArrayOfArrayOfAbsorptionLines &abs_lines_per_species)
Check that ARTS was compiled for all requested species tags.
Definition: absorption.cc:52
void set_vmr_from_first_species(Vector &vmr, const String &species_name, const ArrayOfArrayOfSpeciesTag &abs_species, const Matrix &abs_vmrs)
set_abs_from_first_species.
Definition: absorption.cc:103
Numeric wavenumber_to_joule(Numeric e)
A little helper function to convert energy from units of wavenumber (cm^-1) to Joule (J).
Definition: absorption.cc:87
Declarations required for the calculation of absorption coefficients.
The global header file for ARTS.
Common ARTS conversions.
This can be used to make arrays out of anything.
Definition: array.h:48
Index ncols() const noexcept
Definition: matpackI.h:1080
The Matrix class.
Definition: matpackI.h:1285
The range class.
Definition: matpackI.h:160
The Vector class.
Definition: matpackI.h:910
void resize(Index n)
Resize function.
Definition: matpackI.cc:390
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
This file contains basic functions to handle ASCII files.
Constains various line scaling functions.
Header file for logic.cc.
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
const Joker joker
Declarations having to do with the four output streams.
constexpr auto kaycm2joule(auto x) noexcept
Conversion from cm-1 to Joule.
constexpr bool has_partfun(const Species::IsotopeRecord &ir) noexcept
Definition: partfun.h:153
Index find_first_species(const ArrayOfArrayOfSpeciesTag &specs, Species::Species spec) noexcept