ARTS  2.0.49
gas_abs_lookup.h
Go to the documentation of this file.
1 /* Copyright (C) 2002-2008 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 "matpackIV.h"
30 #include "absorption.h"
31 #include "abs_species_tags.h"
32 #include "messages.h"
33 
34 // Declare existance of some classes:
35 class bifstream;
36 class bofstream;
37 class Agenda;
38 class Workspace;
39 
41 
44 class GasAbsLookup {
45 public:
48  f_grid(),
49  p_grid(),
50  vmrs_ref(),
51  t_ref(),
52  t_pert(),
53  nls_pert(),
54  xsec()
55  { /* Nothing to do here */ }
56 
57  // Documentation is with the implementation!
58  void Adapt( const ArrayOfArrayOfSpeciesTag& current_species,
59  ConstVectorView current_f_grid,
60  const Verbosity& verbosity );
61 
62  // Documentation is with the implementation!
63  void Extract( Matrix& sga,
64  const Index& p_interp_order,
65  const Index& t_interp_order,
66  const Index& h2o_interp_order,
67  const Index& f_index,
68  const Numeric& p,
69  const Numeric& T,
70  ConstVectorView abs_vmrs ) const;
71 
72  const Vector& GetFgrid() const;
73 
74  const Vector& GetPgrid() const;
75 
76  // IO functions must be friends:
77  friend void xml_read_from_stream( istream& is_xml,
78  GasAbsLookup& gal,
79  bifstream *pbifs,
80  const Verbosity& verbosity);
81  friend void xml_write_to_stream ( ostream& os_xml,
82  const GasAbsLookup& gal,
83  bofstream *pbofs,
84  const String& name,
85  const Verbosity& verbosity);
86 
87  friend void abs_lookupCreate(// WS Output:
88  GasAbsLookup& abs_lookup,
89  Index& abs_lookup_is_adapted,
90  // WS Input:
91  const ArrayOfArrayOfSpeciesTag& abs_species,
92  const ArrayOfArrayOfLineRecord& abs_lines_per_species,
93  const ArrayOfLineshapeSpec& abs_lineshape,
94  const ArrayOfArrayOfSpeciesTag& abs_nls,
95  const Vector& f_grid,
96  const Vector& abs_p,
97  const Matrix& abs_vmrs,
98  const Vector& abs_t,
99  const Vector& abs_t_pert,
100  const Vector& abs_nls_pert,
101  const Vector& abs_n2,
102  const ArrayOfString& abs_cont_names,
103  const ArrayOfString& abs_cont_models,
104  const ArrayOfVector& abs_cont_parameters,
105  const Verbosity& verbosity);
106 
107  friend Numeric calc_lookup_error(// Parameters for lookup table:
108  const GasAbsLookup& al,
109  const Index& abs_p_interp_order,
110  const Index& abs_t_interp_order,
111  const Index& abs_nls_interp_order,
112  const bool ignore_errors,
113  // Parameters for LBL:
114  const Vector& abs_n2,
115  const ArrayOfArrayOfLineRecord& abs_lines_per_species,
116  const ArrayOfLineshapeSpec& abs_lineshape,
117  const ArrayOfString& abs_cont_names,
118  const ArrayOfString& abs_cont_models,
119  const ArrayOfVector& abs_cont_parameters,
120  // Parameters for both:
121  const Numeric& local_p,
122  const Numeric& local_t,
123  const Vector& local_vmrs,
124  const Verbosity& verbosity);
125 
126  friend void abs_lookupTestAccuracy(// WS Input:
127  const GasAbsLookup& abs_lookup,
128  const Index& abs_lookup_is_adapted,
129  const Index& abs_p_interp_order,
130  const Index& abs_t_interp_order,
131  const Index& abs_nls_interp_order,
132  const Vector& abs_n2,
133  const ArrayOfArrayOfLineRecord& abs_lines_per_species,
134  const ArrayOfLineshapeSpec& abs_lineshape,
135  const ArrayOfString& abs_cont_names,
136  const ArrayOfString& abs_cont_models,
137  const ArrayOfVector& abs_cont_parameters,
138  const Verbosity& verbosity);
139 
140  friend void abs_lookupTestAccMC(// WS Input:
141  const GasAbsLookup& abs_lookup,
142  const Index& abs_lookup_is_adapted,
143  const Index& abs_p_interp_order,
144  const Index& abs_t_interp_order,
145  const Index& abs_nls_interp_order,
146  const Vector& abs_n2,
147  const ArrayOfArrayOfLineRecord& abs_lines_per_species,
148  const ArrayOfLineshapeSpec& abs_lineshape,
149  const ArrayOfString& abs_cont_names,
150  const ArrayOfString& abs_cont_models,
151  const ArrayOfVector& abs_cont_parameters,
152  const Index& mc_seed,
153  const Verbosity& verbosity);
154 
155 private:
156 
159 
161 
168 
170 
172 
174 
176 
178 
184 
186 
194 
196 
199 
201 
213 
215 
228 
230 
262 
263 };
264 
265 
266 ostream& operator<< (ostream& os, const GasAbsLookup& gal);
267 
268 #endif // gas_abs_lookup_h
Matrix
The Matrix class.
Definition: matpackI.h:767
GasAbsLookup::GetPgrid
const Vector & GetPgrid() const
Definition: gas_abs_lookup.cc:1072
GasAbsLookup::GetFgrid
const Vector & GetFgrid() const
Definition: gas_abs_lookup.cc:1066
GasAbsLookup::nonlinear_species
ArrayOfIndex nonlinear_species
The species tags with non-linear treatment.
Definition: gas_abs_lookup.h:167
absorption.h
Declarations required for the calculation of absorption coefficients.
GasAbsLookup::calc_lookup_error
friend Numeric calc_lookup_error(const GasAbsLookup &al, const Index &abs_p_interp_order, const Index &abs_t_interp_order, const Index &abs_nls_interp_order, const bool ignore_errors, const Vector &abs_n2, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters, const Numeric &local_p, const Numeric &local_t, const Vector &local_vmrs, const Verbosity &verbosity)
Compare lookup and LBL calculation.
Definition: m_abs_lookup.cc:2358
Tensor4
The Tensor4 class.
Definition: matpackIV.h:375
Agenda
The Agenda class.
Definition: agenda_class.h:44
GasAbsLookup
An absorption lookup table.
Definition: gas_abs_lookup.h:44
matpackIV.h
Array
This can be used to make arrays out of anything.
Definition: array.h:103
messages.h
Declarations having to do with the four output streams.
my_basic_string
The implementation for String, the ARTS string class.
Definition: mystring.h:62
GasAbsLookup::t_ref
Vector t_ref
The reference temperature profile [K].
Definition: gas_abs_lookup.h:198
GasAbsLookup::f_grid
Vector f_grid
The frequency grid [Hz].
Definition: gas_abs_lookup.h:171
GasAbsLookup::p_grid
Vector p_grid
The pressure grid for the table [Pa].
Definition: gas_abs_lookup.h:175
GasAbsLookup::GasAbsLookup
GasAbsLookup()
Definition: gas_abs_lookup.h:46
GasAbsLookup::abs_lookupTestAccMC
friend void abs_lookupTestAccMC(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 Vector &abs_n2, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters, const Index &mc_seed, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lookupTestAccMC.
Definition: m_abs_lookup.cc:2858
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:50
bifstream
Binary output file stream class.
Definition: bifstream.h:45
GasAbsLookup::nls_pert
Vector nls_pert
The vector of perturbations for the VMRs of the nonlinear species.
Definition: gas_abs_lookup.h:227
GasAbsLookup::abs_lookupTestAccuracy
friend void abs_lookupTestAccuracy(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 Vector &abs_n2, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lookupTestAccuracy.
Definition: m_abs_lookup.cc:2472
GasAbsLookup::xsec
Tensor4 xsec
Absorption cross sections.
Definition: gas_abs_lookup.h:261
abs_species_tags.h
Header file for stuff related to absorption species tags.
GasAbsLookup::abs_lookupCreate
friend void abs_lookupCreate(GasAbsLookup &abs_lookup, Index &abs_lookup_is_adapted, const ArrayOfArrayOfSpeciesTag &abs_species, const ArrayOfArrayOfLineRecord &abs_lines_per_species, const ArrayOfLineshapeSpec &abs_lineshape, 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 Vector &abs_n2, const ArrayOfString &abs_cont_names, const ArrayOfString &abs_cont_models, const ArrayOfVector &abs_cont_parameters, const Verbosity &verbosity)
WORKSPACE METHOD: abs_lookupCreate.
Definition: m_abs_lookup.cc:60
GasAbsLookup::species
ArrayOfArrayOfSpeciesTag species
The species tags for which the table is valid.
Definition: gas_abs_lookup.h:158
GasAbsLookup::Extract
void Extract(Matrix &sga, const Index &p_interp_order, const Index &t_interp_order, const Index &h2o_interp_order, const Index &f_index, const Numeric &p, const Numeric &T, ConstVectorView abs_vmrs) const
Extract scalar gas absorption coefficients from the lookup table.
Definition: gas_abs_lookup.cc:517
GasAbsLookup::log_p_grid
Vector log_p_grid
The natural log of the pressure grid.
Definition: gas_abs_lookup.h:183
Workspace
Workspace class.
Definition: workspace_ng.h:47
GasAbsLookup::Adapt
void Adapt(const ArrayOfArrayOfSpeciesTag &current_species, ConstVectorView current_f_grid, const Verbosity &verbosity)
Adapt lookup table to current calculation.
Definition: gas_abs_lookup.cc:120
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
operator<<
ostream & operator<<(ostream &os, const GasAbsLookup &gal)
Output operatior for GasAbsLookup.
Definition: gas_abs_lookup.cc:1079
GasAbsLookup::vmrs_ref
Matrix vmrs_ref
The reference VMR profiles.
Definition: gas_abs_lookup.h:193
GasAbsLookup::t_pert
Vector t_pert
The vector of temperature perturbations [K].
Definition: gas_abs_lookup.h:212
GasAbsLookup::xml_write_to_stream
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.
Definition: xml_io_compound_types.cc:90
Vector
The Vector class.
Definition: matpackI.h:555
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:300
GasAbsLookup::xml_read_from_stream
friend void xml_read_from_stream(istream &is_xml, GasAbsLookup &gal, bifstream *pbifs, const Verbosity &verbosity)
Reads GasAbsLookup from XML input stream.
Definition: xml_io_compound_types.cc:58
bofstream
Binary output file stream class.
Definition: bofstream.h:45