ARTS 2.5.9 (git: 825fa5f2)
gas_abs_lookup.h
Go to the documentation of this file.
1/* Copyright (C) 2002-2012 Stefan Buehler <sbuehler@ltu.se>
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 USA. */
17
26#ifndef gas_abs_lookup_h
27#define gas_abs_lookup_h
28
29#include "species_tags.h"
30#include "absorption.h"
32#include "matpackIV.h"
33#include "messages.h"
34
35// Declare existance of some classes:
36class bifstream;
37class bofstream;
38class Agenda;
39class Workspace;
40
42
46 public:
48 : species(),
50 f_grid(),
51 p_grid(),
52 vmrs_ref(),
53 t_ref(),
54 t_pert(),
55 nls_pert(),
56 xsec() { /* Nothing to do here */
57 }
58
59 // Documentation is with the implementation!
60 void Adapt(const ArrayOfArrayOfSpeciesTag& current_species,
61 ConstVectorView current_f_grid,
62 const Verbosity& verbosity);
63
64 // Documentation is with the implementation!
65 void Extract(Matrix& sga,
66 const ArrayOfSpeciesTag& select_abs_species,
67 const Index& p_interp_order,
68 const Index& t_interp_order,
69 const Index& h2o_interp_order,
70 const Index& f_interp_order,
71 const Numeric& p,
72 const Numeric& T,
73 ConstVectorView abs_vmrs,
74 ConstVectorView new_f_grid,
75 const Numeric& extpolfac) const;
76
77 const Vector& GetFgrid() const;
78
79 const Vector& GetPgrid() const;
80
81 Species::Species GetSpeciesIndex(const Index& isp) const {
82 return species[isp].Species();
83 }
84
85 // IO functions must be friends:
86 friend void xml_read_from_stream(istream& is_xml,
87 GasAbsLookup& gal,
88 bifstream* pbifs,
89 const Verbosity& verbosity);
90 friend void xml_write_to_stream(ostream& os_xml,
91 const GasAbsLookup& gal,
92 bofstream* pbofs,
93 const String& name,
94 const Verbosity& verbosity);
95
96 friend void abs_lookupCalc( // Workspace reference:
97 Workspace& ws,
98 // WS Output:
99 GasAbsLookup& abs_lookup,
100 Index& abs_lookup_is_adapted,
101 // WS Input:
102 const ArrayOfArrayOfSpeciesTag& abs_species,
103 const ArrayOfArrayOfSpeciesTag& abs_nls,
104 const Vector& f_grid,
105 const Vector& abs_p,
106 const Matrix& abs_vmrs,
107 const Vector& abs_t,
108 const Vector& abs_t_pert,
109 const Vector& abs_nls_pert,
110 const Agenda& abs_xsec_agenda,
111 // GIN
112 const Numeric& lowest_vmr,
113 // Verbosity object:
114 const Verbosity& verbosity);
115
116 friend void abs_lookupTestAccuracy( // Workspace reference:
117 Workspace& ws,
118 // WS Input:
119 const GasAbsLookup& abs_lookup,
120 const Index& abs_lookup_is_adapted,
121 const Index& abs_p_interp_order,
122 const Index& abs_t_interp_order,
123 const Index& abs_nls_interp_order,
124 const Agenda& abs_xsec_agenda,
125 // Verbosity object:
126 const Verbosity& verbosity);
127
128 friend void abs_lookupTestAccMC( // Workspace reference:
129 Workspace& ws,
130 // WS Input:
131 const GasAbsLookup& abs_lookup,
132 const Index& abs_lookup_is_adapted,
133 const Index& abs_p_interp_order,
134 const Index& abs_t_interp_order,
135 const Index& abs_nls_interp_order,
136 const Index& mc_seed,
137 const Agenda& abs_xsec_agenda,
138 // Verbosity object:
139 const Verbosity& verbosity);
140
141 friend void nca_read_from_file(const int ncid,
142 GasAbsLookup& gal,
143 const Verbosity&);
144
145 friend void nca_write_to_file(const int ncid,
146 const GasAbsLookup& gal,
147 const Verbosity&);
148
151
154
156 Vector& Fgrid() {return f_grid;}
157
160
162 Vector& Pgrid() {return p_grid;}
163
166
168 Matrix& VMRs() {return vmrs_ref;}
169
171 Vector& Tref() {return t_ref;}
172
174 Vector& Tpert() {return t_pert;}
175
178
180 Tensor4& Xsec() {return xsec;}
181
182 friend ostream& operator<<(ostream& os, const GasAbsLookup& gal);
183
184 private:
187
189
196
198
200
202
210
212
214
216
222
224
232
234
237
239
251
253
266
268
300};
301
302#endif // gas_abs_lookup_h
Declarations required for the calculation of absorption coefficients.
The Agenda class.
Definition: agenda_class.h:69
A constant view of a Vector.
Definition: matpackI.h:521
An absorption lookup table.
friend void nca_read_from_file(const int ncid, GasAbsLookup &gal, const Verbosity &)
Reads a GasAbsLookup table from a NetCDF file.
Vector & NLSPert()
The vector of perturbations for the VMRs of the nonlinear species.
Vector p_grid
The pressure grid for the table [Pa].
Tensor4 xsec
Absorption cross sections.
Vector log_p_grid
The natural log of the pressure grid.
Matrix & VMRs()
The reference VMR profiles.
Vector & LogPgrid()
The natural log of the pressure grid.
ArrayOfArrayOfSpeciesTag & Species()
The species tags for which the table is valid.
friend void abs_lookupCalc(Workspace &ws, GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfSpeciesTag &abs_nls, const Vector &f_grid, const Vector &abs_p, const Matrix &abs_vmrs, const Vector &abs_t, const Vector &abs_t_pert, const Vector &abs_nls_pert, const Agenda &abs_xsec_agenda, const Numeric &lowest_vmr, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lookupCalc.
Definition: m_abs_lookup.cc:65
Vector t_pert
The vector of temperature perturbations [K].
Tensor4 & Xsec()
Absorption cross sections.
const Vector & GetPgrid() const
friend void abs_lookupTestAccMC(Workspace &ws, const GasAbsLookup &abs_lookup, const Index &abs_lookup_is_adapted, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Index &mc_seed, const Agenda &abs_xsec_agenda, const Verbosity &verbosity)
Vector & Tpert()
The vector of temperature perturbations [K].
Vector f_grid
The frequency grid [Hz].
Matrix vmrs_ref
The reference VMR profiles.
friend ostream & operator<<(ostream &os, const GasAbsLookup &gal)
Output operatior for GasAbsLookup.
const Vector & GetFgrid() const
ArrayOfLagrangeInterpolation flag_default
Frequency grid positions.
Vector & Pgrid()
The pressure grid for the table [Pa].
ArrayOfIndex & NonLinearSpecies()
The species tags with non-linear treatment.
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
void Adapt(const ArrayOfArrayOfSpeciesTag &current_species, ConstVectorView current_f_grid, const Verbosity &verbosity)
Adapt lookup table to current calculation.
friend void xml_read_from_stream(istream &is_xml, GasAbsLookup &gal, bifstream *pbifs, const Verbosity &verbosity)
Reads GasAbsLookup from XML input stream.
Species::Species GetSpeciesIndex(const Index &isp) const
friend void abs_lookupTestAccuracy(Workspace &ws, const GasAbsLookup &abs_lookup, const Index &abs_lookup_is_adapted, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const Agenda &abs_xsec_agenda, const Verbosity &verbosity)
Vector & Tref()
The reference temperature profile [K].
Vector & Fgrid()
The frequency grid [Hz].
Vector t_ref
The reference temperature profile [K].
void Extract(Matrix &sga, const ArrayOfSpeciesTag &select_abs_species, const Index &p_interp_order, const Index &t_interp_order, const Index &h2o_interp_order, const Index &f_interp_order, const Numeric &p, const Numeric &T, ConstVectorView abs_vmrs, ConstVectorView new_f_grid, const Numeric &extpolfac) const
Extract scalar gas absorption coefficients from the lookup table.
ArrayOfLagrangeInterpolation & FLAGDefault()
Frequency grid positions.
friend void xml_write_to_stream(ostream &os_xml, const GasAbsLookup &gal, bofstream *pbofs, const String &name, const Verbosity &verbosity)
Writes GasAbsLookup to XML output stream.
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
friend void nca_write_to_file(const int ncid, const GasAbsLookup &gal, const Verbosity &)
Writes a GasAbsLookup table to a NetCDF file.
The Matrix class.
Definition: matpackI.h:1285
The Tensor4 class.
Definition: matpackIV.h:435
The Vector class.
Definition: matpackI.h:910
Workspace class.
Definition: workspace_ng.h:53
Binary output file stream class.
Definition: bifstream.h:43
Binary output file stream class.
Definition: bofstream.h:42
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
Declarations having to do with the four output streams.