ARTS  2.0.49
interpolation.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 interpolation_h
27 #define interpolation_h
28 
29 #include "arts.h"
30 #include "matpackVII.h"
31 #include "mystring.h"
32 
33 
35 
74 struct GridPos {
76  Numeric fd[2];
78 };
79 
81 
89 
90 // Function headers (documentation is in .cc file):
91 
92 ostream& operator<<(ostream& os, const GridPos& gp);
93 
94 void gridpos( ArrayOfGridPos& gp,
95  ConstVectorView old_grid,
96  ConstVectorView new_grid,
97  const Numeric& extpolfac=0.5 );
98 
99 void gridpos( GridPos& gp,
100  ConstVectorView old_grid,
101  const Numeric& new_grid,
102  const Numeric& extpolfac=0.5 );
103 
104 void gridpos_copy( GridPos& gp_new, const GridPos& gp_old );
105 
106 Numeric fractional_gp( const GridPos& gp );
107 
108 void gridpos_check_fd( GridPos& gp );
109 
111  GridPos& gp,
112  const Index& n );
113 
115  GridPos& gp,
116  const Index& ie );
117 
119  ArrayOfGridPos& gp,
120  const Index& ie );
121 
123  const GridPos& gp,
124  const Index& i );
125 
127  const GridPos& gp,
128  const bool& upwards );
129 
130 
131 
132 
134 // Red Interpolation
136 
137 void interpweights( VectorView itw,
138  const GridPos& tc );
139 
140 void interpweights( VectorView itw,
141  const GridPos& tr,
142  const GridPos& tc );
143 
144 void interpweights( VectorView itw,
145  const GridPos& tp,
146  const GridPos& tr,
147  const GridPos& tc );
148 
149 void interpweights( VectorView itw,
150  const GridPos& tb,
151  const GridPos& tp,
152  const GridPos& tr,
153  const GridPos& tc );
154 
155 void interpweights( VectorView itw,
156  const GridPos& ts,
157  const GridPos& tb,
158  const GridPos& tp,
159  const GridPos& tr,
160  const GridPos& tc );
161 
162 void interpweights( VectorView itw,
163  const GridPos& tv,
164  const GridPos& ts,
165  const GridPos& tb,
166  const GridPos& tp,
167  const GridPos& tr,
168  const GridPos& tc );
169 
171  ConstVectorView a,
172  const GridPos& tc );
173 
175  ConstMatrixView a,
176  const GridPos& tr,
177  const GridPos& tc );
178 
180  ConstTensor3View a,
181  const GridPos& tp,
182  const GridPos& tr,
183  const GridPos& tc );
184 
186  ConstTensor4View a,
187  const GridPos& tb,
188  const GridPos& tp,
189  const GridPos& tr,
190  const GridPos& tc );
191 
193  ConstTensor5View a,
194  const GridPos& ts,
195  const GridPos& tb,
196  const GridPos& tp,
197  const GridPos& tr,
198  const GridPos& tc );
199 
201  ConstTensor6View a,
202  const GridPos& tv,
203  const GridPos& ts,
204  const GridPos& tb,
205  const GridPos& tp,
206  const GridPos& tr,
207  const GridPos& tc );
208 
209 
210 
211 
212 
214 // Blue interpolation
216 
217 void interpweights( MatrixView itw,
218  const ArrayOfGridPos& cgp );
219 
220 void interpweights( MatrixView itw,
221  const ArrayOfGridPos& rgp,
222  const ArrayOfGridPos& cgp );
223 
224 void interpweights( MatrixView itw,
225  const ArrayOfGridPos& pgp,
226  const ArrayOfGridPos& rgp,
227  const ArrayOfGridPos& cgp );
228 
229 void interpweights( MatrixView itw,
230  const ArrayOfGridPos& bgp,
231  const ArrayOfGridPos& pgp,
232  const ArrayOfGridPos& rgp,
233  const ArrayOfGridPos& cgp );
234 
235 void interpweights( MatrixView itw,
236  const ArrayOfGridPos& sgp,
237  const ArrayOfGridPos& bgp,
238  const ArrayOfGridPos& pgp,
239  const ArrayOfGridPos& rgp,
240  const ArrayOfGridPos& cgp );
241 
242 void interpweights( MatrixView itw,
243  const ArrayOfGridPos& vgp,
244  const ArrayOfGridPos& sgp,
245  const ArrayOfGridPos& bgp,
246  const ArrayOfGridPos& pgp,
247  const ArrayOfGridPos& rgp,
248  const ArrayOfGridPos& cgp );
249 
250 void interp( VectorView ia,
251  ConstMatrixView itw,
252  ConstVectorView a,
253  const ArrayOfGridPos& cgp);
254 
255 void interp( VectorView ia,
256  ConstMatrixView itw,
257  ConstMatrixView a,
258  const ArrayOfGridPos& rgp,
259  const ArrayOfGridPos& cgp);
260 
261 void interp( VectorView ia,
262  ConstMatrixView itw,
263  ConstTensor3View a,
264  const ArrayOfGridPos& pgp,
265  const ArrayOfGridPos& rgp,
266  const ArrayOfGridPos& cgp);
267 
268 void interp( VectorView ia,
269  ConstMatrixView itw,
270  ConstTensor4View a,
271  const ArrayOfGridPos& bgp,
272  const ArrayOfGridPos& pgp,
273  const ArrayOfGridPos& rgp,
274  const ArrayOfGridPos& cgp);
275 
276 void interp( VectorView ia,
277  ConstMatrixView itw,
278  ConstTensor5View a,
279  const ArrayOfGridPos& sgp,
280  const ArrayOfGridPos& bgp,
281  const ArrayOfGridPos& pgp,
282  const ArrayOfGridPos& rgp,
283  const ArrayOfGridPos& cgp);
284 
285 void interp( VectorView ia,
286  ConstMatrixView itw,
287  ConstTensor6View a,
288  const ArrayOfGridPos& vgp,
289  const ArrayOfGridPos& sgp,
290  const ArrayOfGridPos& bgp,
291  const ArrayOfGridPos& pgp,
292  const ArrayOfGridPos& rgp,
293  const ArrayOfGridPos& cgp);
294 
295 
296 
297 
298 
300 // Green interpolation
302 
303 void interpweights( Tensor3View itw,
304  const ArrayOfGridPos& rgp,
305  const ArrayOfGridPos& cgp );
306 
307 void interpweights( Tensor4View itw,
308  const ArrayOfGridPos& pgp,
309  const ArrayOfGridPos& rgp,
310  const ArrayOfGridPos& cgp );
311 
312 void interpweights( Tensor5View itw,
313  const ArrayOfGridPos& bgp,
314  const ArrayOfGridPos& pgp,
315  const ArrayOfGridPos& rgp,
316  const ArrayOfGridPos& cgp );
317 
318 void interpweights( Tensor6View itw,
319  const ArrayOfGridPos& sgp,
320  const ArrayOfGridPos& bgp,
321  const ArrayOfGridPos& pgp,
322  const ArrayOfGridPos& rgp,
323  const ArrayOfGridPos& cgp );
324 
325 void interpweights( Tensor7View itw,
326  const ArrayOfGridPos& vgp,
327  const ArrayOfGridPos& sgp,
328  const ArrayOfGridPos& bgp,
329  const ArrayOfGridPos& pgp,
330  const ArrayOfGridPos& rgp,
331  const ArrayOfGridPos& cgp );
332 
333 void interp( MatrixView ia,
334  ConstTensor3View itw,
335  ConstMatrixView a,
336  const ArrayOfGridPos& rgp,
337  const ArrayOfGridPos& cgp);
338 
339 void interp( Tensor3View ia,
340  ConstTensor4View itw,
341  ConstTensor3View a,
342  const ArrayOfGridPos& pgp,
343  const ArrayOfGridPos& rgp,
344  const ArrayOfGridPos& cgp);
345 
346 void interp( Tensor4View ia,
347  ConstTensor5View itw,
348  ConstTensor4View a,
349  const ArrayOfGridPos& bgp,
350  const ArrayOfGridPos& pgp,
351  const ArrayOfGridPos& rgp,
352  const ArrayOfGridPos& cgp);
353 
354 void interp( Tensor5View ia,
355  ConstTensor6View itw,
356  ConstTensor5View a,
357  const ArrayOfGridPos& sgp,
358  const ArrayOfGridPos& bgp,
359  const ArrayOfGridPos& pgp,
360  const ArrayOfGridPos& rgp,
361  const ArrayOfGridPos& cgp);
362 
363 void interp( Tensor6View ia,
364  ConstTensor7View itw,
365  ConstTensor6View a,
366  const ArrayOfGridPos& vgp,
367  const ArrayOfGridPos& sgp,
368  const ArrayOfGridPos& bgp,
369  const ArrayOfGridPos& pgp,
370  const ArrayOfGridPos& rgp,
371  const ArrayOfGridPos& cgp);
372 
374  ConstVectorView y,
375  const Numeric& x_i,
376  const GridPos& gp);
377 
378 void polint(Numeric& y_int,
379  Numeric& dy_int,
380  ConstVectorView xa,
381  ConstVectorView ya,
382  const Index& i,
383  const Numeric& x);
384 
385 #endif // interpolation_h
Tensor7View
The Tensor7View class.
Definition: matpackVII.h:779
MatrixView
The MatrixView class.
Definition: matpackI.h:668
gridpos_force_end_fd
void gridpos_force_end_fd(GridPos &gp, const Index &n)
gridpos_force_end_fd
Definition: interpolation.cc:567
gridpos_check_fd
void gridpos_check_fd(GridPos &gp)
gridpos_check_fd
Definition: interpolation.cc:524
ConstTensor7View
A constant view of a Tensor7.
Definition: matpackVII.h:169
is_gridpos_at_index_i
bool is_gridpos_at_index_i(const GridPos &gp, const Index &i)
is_gridpos_at_index_i
Definition: interpolation.cc:665
ArrayOfArrayOfGridPos
Array< Array< GridPos > > ArrayOfArrayOfGridPos
Definition: interpolation.h:86
ArrayOfGridPos
Array< GridPos > ArrayOfGridPos
An Array of grid positions.
Definition: interpolation.h:85
gridpos2gridrange
Index gridpos2gridrange(const GridPos &gp, const bool &upwards)
gridpos2gridrange
Definition: interpolation.cc:701
gridpos_copy
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
Definition: interpolation.cc:482
GridPos::fd
Numeric fd[2]
Definition: interpolation.h:76
gridpos_upperend_check
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Definition: interpolation.cc:608
interp
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Definition: interpolation.cc:1000
interp_poly
Numeric interp_poly(ConstVectorView x, ConstVectorView y, const Numeric &x_i, const GridPos &gp)
Polynomial interpolation.
Definition: interpolation.cc:2909
ConstTensor4View
A constant view of a Tensor4.
Definition: matpackIV.h:149
Tensor3View
The Tensor3View class.
Definition: matpackIII.h:234
Array< GridPos >
interpweights
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Definition: interpolation.cc:756
VectorView
The VectorView class.
Definition: matpackI.h:373
ConstTensor6View
A constant view of a Tensor6.
Definition: matpackVI.h:167
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Tensor5View
The Tensor5View class.
Definition: matpackV.h:278
ArrayOfArrayOfArrayOfGridPos
Array< Array< Array< GridPos > > > ArrayOfArrayOfArrayOfGridPos
Definition: interpolation.h:87
ArrayOfArrayOfArrayOfArrayOfGridPos
Array< Array< Array< Array< GridPos > > > > ArrayOfArrayOfArrayOfArrayOfGridPos
Definition: interpolation.h:88
gridpos
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac=0.5)
Set up a grid position Array.
Definition: interpolation.cc:167
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:591
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
operator<<
ostream & operator<<(ostream &os, const GridPos &gp)
Output operator for GridPos.
Definition: interpolation.cc:105
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:147
Tensor4View
The Tensor4View class.
Definition: matpackIV.h:245
GridPos::idx
Index idx
Definition: interpolation.h:75
fractional_gp
Numeric fractional_gp(const GridPos &gp)
fractional_gp
Definition: interpolation.cc:504
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:300
ConstTensor5View
A constant view of a Tensor5.
Definition: matpackV.h:160
mystring.h
This file contains the definition of String, the ARTS string class.
matpackVII.h
Tensor6View
The Tensor6View class.
Definition: matpackVI.h:450
arts.h
The global header file for ARTS.
polint
void polint(Numeric &y_int, Numeric &dy_int, ConstVectorView xa, ConstVectorView ya, const Index &i, const Numeric &x)
Polynomial interpolation.
Definition: interpolation.cc:3095