ARTS  2.0.49
jacobian.h
Go to the documentation of this file.
1 /* Copyright (C) 2004-2008 Mattias Ekstrom <ekstrom@rss.chalmers.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 
24 #ifndef jacobian_h
25 #define jacobian_h
26 
27 #include <map>
28 #include <iostream>
29 #include <stdexcept>
30 #include "matpackI.h"
31 #include "array.h"
32 #include "mystring.h"
33 #include "make_array.h"
34 #include "bifstream.h"
35 #include "interpolation.h"
36 #include "logic.h"
37 #include "methods.h"
38 #include "ppath.h"
39 #include "agenda_class.h"
40 
41 
42 
46 public:
47 
50  msubtag(),
51  mmode(),
52  manalytical(-1),
53  mperturbation(0.),
54  mgrids()
55  { /* Nothing to do here. */ }
56 
57 
61  mmaintag(x.mmaintag),
62  msubtag(x.msubtag),
63  mmode(x.mmode),
66  mgrids(x.mgrids)
67  { /* Nothing left to do here. */ }
68 
70  RetrievalQuantity(const String& maintag,
71  const String& subtag,
72  const String& mode,
73  const Index& analytical,
74  const Numeric& perturbation,
75  const MakeArray<Vector>& grids ) :
76  mmaintag(maintag),
77  msubtag(subtag),
78  mmode(mode),
79  manalytical(analytical),
80  mperturbation(perturbation),
81  mgrids(grids)
82  {
83  // With Matpack, initialization of mgrids from grids should work correctly.
84  }
85 
87  const String& MainTag() const { return mmaintag; }
88  void MainTag( const String& mt ) { mmaintag = mt; }
90  const String& Subtag() const { return msubtag; }
91  void Subtag( const String& st ) { msubtag = st; }
93  const String& Mode() const { return mmode; }
94  void Mode( const String& m ) { mmode = m; }
96  const Index& Analytical() const { return manalytical; }
97  void Analytical( const Index& m ) { manalytical = m; }
99  const Numeric& Perturbation() const { return mperturbation; }
100  void Perturbation( const Numeric& p ) { mperturbation = p; }
102  const ArrayOfVector& Grids() const { return mgrids; }
103  void Grids( const ArrayOfVector& g ) { mgrids = g; }
104 
105 private:
106 
113 };
114 
118 ostream& operator << (ostream& os, const RetrievalQuantity& ot);
119 
121 
122 //======================================================================
123 // Functions related to calculation of Jacobian
124 //======================================================================
125 
126 void calc_nd_field( Tensor3View& nd,
127  const VectorView& p,
128  const Tensor3View& t);
129 
131  ostringstream& os,
132  const Vector& p_grid,
133  const Vector& lat_grid,
134  const Vector& lon_grid,
135  const Vector& p_retr,
136  const Vector& lat_retr,
137  const Vector& lon_retr,
138  const String& p_retr_name,
139  const String& lat_retr_name,
140  const String& lon_retr_name,
141  const Index& dim);
142 
144  const Vector& atm_grid,
145  const Vector& jac_grid,
146  const bool& is_pressure);
147 
149  const Vector& pert_grid,
150  const Vector& atm_limit);
151 
152 void get_perturbation_range( Range& range,
153  const Index& index,
154  const Index& length);
155 
157  const ArrayOfGridPos& p_gp,
158  const Index& p_pert_n,
159  const Range& p_range,
160  const Numeric& size,
161  const Index& method);
162 
164  const ArrayOfGridPos& p_gp,
165  const ArrayOfGridPos& lat_gp,
166  const Index& p_pert_n,
167  const Index& lat_pert_n,
168  const Range& p_range,
169  const Range& lat_range,
170  const Numeric& size,
171  const Index& method);
172 
174  const ArrayOfGridPos& p_gp,
175  const ArrayOfGridPos& lat_gp,
176  const ArrayOfGridPos& lon_gp,
177  const Index& p_pert_n,
178  const Index& lat_pert_n,
179  const Index& lon_pert_n,
180  const Range& p_range,
181  const Range& lat_range,
182  const Range& lon_range,
183  const Numeric& size,
184  const Index& method);
185 
187  Vector& b,
188  const Vector& x,
189  const Index& poly_coeff );
190 
191 void vmrunitscf(
192  Numeric& x,
193  const String& unit,
194  const Numeric& vmr,
195  const Numeric& p,
196  const Numeric& t );
197 
198 #endif // jacobian_h
RetrievalQuantity::Analytical
const Index & Analytical() const
Boolean to make analytical calculations (if possible).
Definition: jacobian.h:96
MatrixView
The MatrixView class.
Definition: matpackI.h:668
get_perturbation_limit
void get_perturbation_limit(ArrayOfIndex &limit, const Vector &pert_grid, const Vector &atm_limit)
Get limits for perturbation of a box.
Definition: jacobian.cc:288
RetrievalQuantity::Grids
const ArrayOfVector & Grids() const
Grids.
Definition: jacobian.h:102
check_retrieval_grids
bool check_retrieval_grids(ArrayOfVector &grids, ostringstream &os, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Vector &p_retr, const Vector &lat_retr, const Vector &lon_retr, const String &p_retr_name, const String &lat_retr_name, const String &lon_retr_name, const Index &dim)
Check that the retrieval grids are defined for each atmosphere dim.
Definition: jacobian.cc:104
interpolation.h
Header file for interpolation.cc.
perturbation_field_1d
void perturbation_field_1d(VectorView field, const ArrayOfGridPos &p_gp, const Index &p_pert_n, const Range &p_range, const Numeric &size, const Index &method)
Calculate the 1D perturbation for a relative perturbation.
Definition: jacobian.cc:370
RetrievalQuantity::mmode
String mmode
Definition: jacobian.h:109
ArrayOfRetrievalQuantity
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Definition: jacobian.h:120
RetrievalQuantity::RetrievalQuantity
RetrievalQuantity(const String &maintag, const String &subtag, const String &mode, const Index &analytical, const Numeric &perturbation, const MakeArray< Vector > &grids)
Constructor that sets the values.
Definition: jacobian.h:70
RetrievalQuantity::mperturbation
Numeric mperturbation
Definition: jacobian.h:111
array.h
This file contains the definition of Array.
RetrievalQuantity::Subtag
void Subtag(const String &st)
Definition: jacobian.h:91
matpackI.h
Tensor3View
The Tensor3View class.
Definition: matpackIII.h:234
Array< Vector >
RetrievalQuantity::Perturbation
void Perturbation(const Numeric &p)
Definition: jacobian.h:100
polynomial_basis_func
void polynomial_basis_func(Vector &b, const Vector &x, const Index &poly_coeff)
Calculates polynomial basis functions.
Definition: jacobian.cc:513
agenda_class.h
Declarations for agendas.
perturbation_field_3d
void perturbation_field_3d(Tensor3View field, const ArrayOfGridPos &p_gp, const ArrayOfGridPos &lat_gp, const ArrayOfGridPos &lon_gp, const Index &p_pert_n, const Index &lat_pert_n, const Index &lon_pert_n, const Range &p_range, const Range &lat_range, const Range &lon_range, const Numeric &size, const Index &method)
Calculate the 3D perturbation for a relative perturbation.
Definition: jacobian.cc:466
RetrievalQuantity::RetrievalQuantity
RetrievalQuantity(const RetrievalQuantity &x)
Copy constructor.
Definition: jacobian.h:60
my_basic_string< char >
vmrunitscf
void vmrunitscf(Numeric &x, const String &unit, const Numeric &vmr, const Numeric &p, const Numeric &t)
vmrunitscf
Definition: jacobian.cc:561
RetrievalQuantity::MainTag
const String & MainTag() const
Main tag.
Definition: jacobian.h:87
VectorView
The VectorView class.
Definition: matpackI.h:373
perturbation_field_2d
void perturbation_field_2d(MatrixView field, const ArrayOfGridPos &p_gp, const ArrayOfGridPos &lat_gp, const Index &p_pert_n, const Index &lat_pert_n, const Range &p_range, const Range &lat_range, const Numeric &size, const Index &method)
Calculate the 2D perturbation for a relative perturbation.
Definition: jacobian.cc:415
RetrievalQuantity::Mode
const String & Mode() const
Calculation mode.
Definition: jacobian.h:93
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
RetrievalQuantity::RetrievalQuantity
RetrievalQuantity()
Default constructor.
Definition: jacobian.h:49
make_array.h
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization.
RetrievalQuantity::Analytical
void Analytical(const Index &m)
Definition: jacobian.h:97
bifstream.h
This file contains the class declaration of bifstream.
RetrievalQuantity::Grids
void Grids(const ArrayOfVector &g)
Definition: jacobian.h:103
Range
The range class.
Definition: matpackI.h:148
ppath.h
Propagation path structure and functions.
RetrievalQuantity::manalytical
Index manalytical
Definition: jacobian.h:110
logic.h
Header file for logic.cc.
calc_nd_field
void calc_nd_field(Tensor3View &nd, const VectorView &p, const Tensor3View &t)
Calculate the number density field.
Definition: jacobian.cc:55
RetrievalQuantity::MainTag
void MainTag(const String &mt)
Definition: jacobian.h:88
get_perturbation_gridpos
void get_perturbation_gridpos(ArrayOfGridPos &gp, const Vector &atm_grid, const Vector &jac_grid, const bool &is_pressure)
Calculate array of GridPos for perturbation interpolation.
Definition: jacobian.cc:229
get_perturbation_range
void get_perturbation_range(Range &range, const Index &index, const Index &length)
Get range for perturbation.
Definition: jacobian.cc:340
RetrievalQuantity::msubtag
String msubtag
Definition: jacobian.h:108
MakeArray
Explicit construction of Arrays.
Definition: make_array.h:52
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
RetrievalQuantity
Contains the data for one retrieval quantity.
Definition: jacobian.h:45
RetrievalQuantity::mmaintag
String mmaintag
Definition: jacobian.h:107
RetrievalQuantity::mgrids
ArrayOfVector mgrids
Definition: jacobian.h:112
Vector
The Vector class.
Definition: matpackI.h:555
RetrievalQuantity::Mode
void Mode(const String &m)
Definition: jacobian.h:94
RetrievalQuantity::Subtag
const String & Subtag() const
Subtag.
Definition: jacobian.h:90
methods.h
Declaration of the class MdRecord.
mystring.h
This file contains the definition of String, the ARTS string class.
operator<<
ostream & operator<<(ostream &os, const RetrievalQuantity &ot)
Output operator for RetrievalQuantity.
Definition: jacobian.cc:31
RetrievalQuantity::Perturbation
const Numeric & Perturbation() const
Size of perturbation used for perturbation calculations.
Definition: jacobian.h:99