ARTS 2.5.4 (git: 31ce4f0e)
interpolation.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 interpolation_h
27#define interpolation_h
28
29#include "arts.h"
30#include "matpackVII.h"
31#include "mystring.h"
32
34
73struct GridPos {
75 std::array<Numeric, 2> fd;
78 friend ostream& operator<<(ostream& os, const GridPos& gp);
79};
80
82
91
92// Function headers (documentation is in .cc file):
93
94void gridpos(ArrayOfGridPos& gp,
95 ConstVectorView old_grid,
96 ConstVectorView new_grid,
97 const Numeric& extpolfac = 0.5);
98
99void gridpos(GridPos& gp,
100 ConstVectorView old_grid,
101 const Numeric& new_grid,
102 const Numeric& extpolfac = 0.5);
103
105
106void gridpos_copy(GridPos& gp_new, const GridPos& gp_old);
107
108Numeric fractional_gp(const GridPos& gp);
109
110void gridpos_check_fd(GridPos& gp);
111
112void gridpos_force_end_fd(GridPos& gp, const Index& n);
113
114void gridpos_upperend_check(GridPos& gp, const Index& ie);
115
116void gridpos_upperend_check(ArrayOfGridPos& gp, const Index& ie);
117
119
120bool is_gridpos_at_index_i(const GridPos& gp,
121 const Index& i,
122 const bool& strict = true);
123
124Index gridpos2gridrange(const GridPos& gp, const bool& upwards);
125
127// Red Interpolation
129
130void interpweights(VectorView itw, const GridPos& tc);
131
132void interpweights(VectorView itw, const GridPos& tr, const GridPos& tc);
133
135 const GridPos& tp,
136 const GridPos& tr,
137 const GridPos& tc);
138
140 const GridPos& tb,
141 const GridPos& tp,
142 const GridPos& tr,
143 const GridPos& tc);
144
146 const GridPos& ts,
147 const GridPos& tb,
148 const GridPos& tp,
149 const GridPos& tr,
150 const GridPos& tc);
151
153 const GridPos& tv,
154 const GridPos& ts,
155 const GridPos& tb,
156 const GridPos& tp,
157 const GridPos& tr,
158 const GridPos& tc);
159
161
164 const GridPos& tr,
165 const GridPos& tc);
166
169 const GridPos& tp,
170 const GridPos& tr,
171 const GridPos& tc);
172
175 const GridPos& tb,
176 const GridPos& tp,
177 const GridPos& tr,
178 const GridPos& tc);
179
182 const GridPos& ts,
183 const GridPos& tb,
184 const GridPos& tp,
185 const GridPos& tr,
186 const GridPos& tc);
187
190 const GridPos& tv,
191 const GridPos& ts,
192 const GridPos& tb,
193 const GridPos& tp,
194 const GridPos& tr,
195 const GridPos& tc);
196
198// Blue interpolation
200
201void interpweights(MatrixView itw, const ArrayOfGridPos& cgp);
202
204 const ArrayOfGridPos& rgp,
205 const ArrayOfGridPos& cgp);
206
208 const ArrayOfGridPos& pgp,
209 const ArrayOfGridPos& rgp,
210 const ArrayOfGridPos& cgp);
211
213 const ArrayOfGridPos& bgp,
214 const ArrayOfGridPos& pgp,
215 const ArrayOfGridPos& rgp,
216 const ArrayOfGridPos& cgp);
217
219 const ArrayOfGridPos& sgp,
220 const ArrayOfGridPos& bgp,
221 const ArrayOfGridPos& pgp,
222 const ArrayOfGridPos& rgp,
223 const ArrayOfGridPos& cgp);
224
226 const ArrayOfGridPos& vgp,
227 const ArrayOfGridPos& sgp,
228 const ArrayOfGridPos& bgp,
229 const ArrayOfGridPos& pgp,
230 const ArrayOfGridPos& rgp,
231 const ArrayOfGridPos& cgp);
232
233void interp(VectorView ia,
234 ConstMatrixView itw,
236 const ArrayOfGridPos& cgp);
237
238void interp(VectorView ia,
239 ConstMatrixView itw,
241 const ArrayOfGridPos& rgp,
242 const ArrayOfGridPos& cgp);
243
244void interp(VectorView ia,
245 ConstMatrixView itw,
247 const ArrayOfGridPos& pgp,
248 const ArrayOfGridPos& rgp,
249 const ArrayOfGridPos& cgp);
250
251void interp(VectorView ia,
252 ConstMatrixView itw,
254 const ArrayOfGridPos& bgp,
255 const ArrayOfGridPos& pgp,
256 const ArrayOfGridPos& rgp,
257 const ArrayOfGridPos& cgp);
258
259void interp(VectorView ia,
260 ConstMatrixView itw,
262 const ArrayOfGridPos& sgp,
263 const ArrayOfGridPos& bgp,
264 const ArrayOfGridPos& pgp,
265 const ArrayOfGridPos& rgp,
266 const ArrayOfGridPos& cgp);
267
268void interp(VectorView ia,
269 ConstMatrixView itw,
271 const ArrayOfGridPos& vgp,
272 const ArrayOfGridPos& sgp,
273 const ArrayOfGridPos& bgp,
274 const ArrayOfGridPos& pgp,
275 const ArrayOfGridPos& rgp,
276 const ArrayOfGridPos& cgp);
277
279// Green interpolation
281
283 const ArrayOfGridPos& rgp,
284 const ArrayOfGridPos& cgp);
285
287 const ArrayOfGridPos& pgp,
288 const ArrayOfGridPos& rgp,
289 const ArrayOfGridPos& cgp);
290
292 const ArrayOfGridPos& bgp,
293 const ArrayOfGridPos& pgp,
294 const ArrayOfGridPos& rgp,
295 const ArrayOfGridPos& cgp);
296
298 const ArrayOfGridPos& sgp,
299 const ArrayOfGridPos& bgp,
300 const ArrayOfGridPos& pgp,
301 const ArrayOfGridPos& rgp,
302 const ArrayOfGridPos& cgp);
303
305 const ArrayOfGridPos& vgp,
306 const ArrayOfGridPos& sgp,
307 const ArrayOfGridPos& bgp,
308 const ArrayOfGridPos& pgp,
309 const ArrayOfGridPos& rgp,
310 const ArrayOfGridPos& cgp);
311
312void interp(MatrixView ia,
315 const ArrayOfGridPos& rgp,
316 const ArrayOfGridPos& cgp);
317
318void interp(Tensor3View ia,
321 const ArrayOfGridPos& pgp,
322 const ArrayOfGridPos& rgp,
323 const ArrayOfGridPos& cgp);
324
325void interp(Tensor4View ia,
328 const ArrayOfGridPos& bgp,
329 const ArrayOfGridPos& pgp,
330 const ArrayOfGridPos& rgp,
331 const ArrayOfGridPos& cgp);
332
333void interp(Tensor5View ia,
336 const ArrayOfGridPos& sgp,
337 const ArrayOfGridPos& bgp,
338 const ArrayOfGridPos& pgp,
339 const ArrayOfGridPos& rgp,
340 const ArrayOfGridPos& cgp);
341
342void interp(Tensor6View ia,
345 const ArrayOfGridPos& vgp,
346 const ArrayOfGridPos& sgp,
347 const ArrayOfGridPos& bgp,
348 const ArrayOfGridPos& pgp,
349 const ArrayOfGridPos& rgp,
350 const ArrayOfGridPos& cgp);
351
354 const Numeric& x_i,
355 const GridPos& gp);
356
357#endif // interpolation_h
The global header file for ARTS.
A constant view of a Matrix.
Definition: matpackI.h:1043
A constant view of a Tensor3.
Definition: matpackIII.h:130
A constant view of a Tensor4.
Definition: matpackIV.h:131
A constant view of a Tensor5.
Definition: matpackV.h:141
A constant view of a Tensor6.
Definition: matpackVI.h:147
A constant view of a Tensor7.
Definition: matpackVII.h:145
A constant view of a Vector.
Definition: matpackI.h:512
The MatrixView class.
Definition: matpackI.h:1164
The Tensor3View class.
Definition: matpackIII.h:246
The Tensor4View class.
Definition: matpackIV.h:292
The Tensor5View class.
Definition: matpackV.h:343
The Tensor6View class.
Definition: matpackVI.h:632
The Tensor7View class.
Definition: matpackVII.h:1303
The VectorView class.
Definition: matpackI.h:663
Index gridpos2gridrange(const GridPos &gp, const bool &upwards)
gridpos2gridrange
bool is_gridpos_at_index_i(const GridPos &gp, const Index &i, const bool &strict=true)
is_gridpos_at_index_i
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac=0.5)
Set up a grid position Array.
void gridpos_force_end_fd(GridPos &gp, const Index &n)
gridpos_force_end_fd
void gridpos_check_fd(GridPos &gp)
gridpos_check_fd
void gridpos_upperend_check(GridPos &gp, const Index &ie)
gridpos_upperend_check
Array< GridPos > ArrayOfGridPos
An Array of grid positions.
Definition: interpolation.h:86
Array< Array< Array< Array< GridPos > > > > ArrayOfArrayOfArrayOfArrayOfGridPos
Definition: interpolation.h:90
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
Numeric interp_poly(ConstVectorView x, ConstVectorView y, const Numeric &x_i, const GridPos &gp)
Polynomial interpolation.
Array< Array< GridPos > > ArrayOfArrayOfGridPos
Definition: interpolation.h:87
void gp4length1grid(ArrayOfGridPos &gp)
Grid position matching a grid of length 1.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Array< Array< Array< GridPos > > > ArrayOfArrayOfArrayOfGridPos
Definition: interpolation.h:88
void gridpos_copy(GridPos &gp_new, const GridPos &gp_old)
gridpos_copy
void gridpos_1to1(ArrayOfGridPos &gp, ConstVectorView grid)
gridpos_1to1
Numeric fractional_gp(const GridPos &gp)
fractional_gp
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
This file contains the definition of String, the ARTS string class.
Structure to store a grid position.
Definition: interpolation.h:73
std::array< Numeric, 2 > fd
Definition: interpolation.h:75
friend ostream & operator<<(ostream &os, const GridPos &gp)
Output operator for GridPos.
Index idx
Definition: interpolation.h:74
#define a