ARTS 2.5.0 (git: 9ee3ac6c)
special_interp.h
Go to the documentation of this file.
1/* Copyright (C) 2002-2012 Patrick Eriksson <Patrick.Eriksson@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
26#ifndef special_interp_h
27#define special_interp_h
28
29#include "gridded_fields.h"
30#include "interpolation.h"
31#include "jacobian.h"
32
33/*===========================================================================
34 === Interpolation functions for atmospheric grids, fields and surfaces
35 ===========================================================================*/
36
58 const Index& atmosphere_dim,
59 const ArrayOfGridPos& gp_p,
60 const ArrayOfGridPos& gp_lat,
61 const ArrayOfGridPos& gp_lon);
62
89 const Index& atmosphere_dim,
90 ConstTensor3View x_field,
91 const ArrayOfGridPos& gp_p,
92 const ArrayOfGridPos& gp_lat,
93 const ArrayOfGridPos& gp_lon,
94 ConstMatrixView itw);
95
121 const Index& atmosphere_dim,
122 ConstTensor3View x_field,
123 const ArrayOfGridPos& gp_p,
124 const ArrayOfGridPos& gp_lat,
125 const ArrayOfGridPos& gp_lon);
126
152Numeric interp_atmfield_by_gp(const Index& atmosphere_dim,
153 ConstTensor3View x_field,
154 const GridPos& gp_p = {0, {0, 1}},
155 const GridPos& gp_lat = {0, {0, 1}},
156 const GridPos& gp_lon = {0, {0, 1}});
157
186 GridPos& gp_p_out,
187 GridPos& gp_lat_out,
188 GridPos& gp_lon_out,
189 const GridPos& gp_p_in,
190 const GridPos& gp_lat_in,
191 const GridPos& gp_lon_in,
192 const Index& atmosphere_dim,
193 const ArrayOfIndex& cloudbox_limits);
194
215 const Index& atmosphere_dim,
216 const ArrayOfGridPos& gp_lat,
217 const ArrayOfGridPos& gp_lon);
218
244 const Index& atmosphere_dim,
245 ConstMatrixView x_surface,
246 const ArrayOfGridPos& gp_lat,
247 const ArrayOfGridPos& gp_lon,
248 ConstMatrixView itw);
249
274 const Index& atmosphere_dim,
275 ConstMatrixView x_field,
276 const ArrayOfGridPos& gp_lat,
277 const ArrayOfGridPos& gp_lon);
278
303Numeric interp_atmsurface_by_gp(const Index& atmosphere_dim,
304 ConstMatrixView x_field,
305 const GridPos& gp_lat,
306 const GridPos& gp_lon);
307
323void regrid_atmfield_by_gp(Tensor3& field_new,
324 const Index& atmosphere_dim,
325 ConstTensor3View field_old,
326 const ArrayOfGridPos& gp_p,
327 const ArrayOfGridPos& gp_lat,
328 const ArrayOfGridPos& gp_lon);
329
344void regrid_atmsurf_by_gp(Matrix& field_new,
345 const Index& atmosphere_dim,
346 ConstMatrixView field_old,
347 const ArrayOfGridPos& gp_lat,
348 const ArrayOfGridPos& gp_lon);
349
371 ArrayOfGridPos& gp_lat,
372 ArrayOfGridPos& gp_lon,
373 const RetrievalQuantity& rq,
374 const Index& atmosphere_dim,
375 const Vector& p_grid,
376 const Vector& lat_grid,
377 const Vector& lon_grid);
378
398 ArrayOfGridPos& gp_lon,
399 const RetrievalQuantity& rq,
400 const Index& atmosphere_dim,
401 const Vector& lat_grid,
402 const Vector& lon_grid);
403
404
433 ArrayOfGridPos& gp_lat,
434 ArrayOfGridPos& gp_lon,
435 Index& n_p,
436 Index& n_lat,
437 Index& n_lon,
438 const ArrayOfVector& ret_grids,
439 const Index& atmosphere_dim,
440 const Vector& p_grid,
441 const Vector& lat_grid,
442 const Vector& lon_grid);
443
469 ArrayOfGridPos& gp_lon,
470 Index& n_lat,
471 Index& n_lon,
472 const ArrayOfVector& ret_grids,
473 const Index& atmosphere_dim,
474 const Vector& lat_grid,
475 const Vector& lon_grid);
476
477
493void regrid_atmfield_by_gp_oem(Tensor3& field_new,
494 const Index& atmosphere_dim,
495 ConstTensor3View field_old,
496 const ArrayOfGridPos& gp_p,
497 const ArrayOfGridPos& gp_lat,
498 const ArrayOfGridPos& gp_lon);
499
514void regrid_atmsurf_by_gp_oem(Matrix& field_new,
515 const Index& atmosphere_dim,
516 ConstMatrixView field_old,
517 const ArrayOfGridPos& gp_lat,
518 const ArrayOfGridPos& gp_lon);
519
540void itw2p(VectorView p_values,
541 ConstVectorView p_grid,
542 const ArrayOfGridPos& gp,
543 ConstMatrixView itw);
544
570 ConstVectorView old_pgrid,
571 ConstVectorView new_pgrid,
572 const Numeric& extpolfac = 0.5);
573
599void rte_pos2gridpos(GridPos& gp_p,
600 GridPos& gp_lat,
601 GridPos& gp_lon,
602 const Index& atmosphere_dim,
603 ConstVectorView p_grid,
604 ConstVectorView lat_grid,
605 ConstVectorView lon_grid,
606 ConstTensor3View z_field,
607 ConstVectorView rte_pos);
608
627void rte_pos2gridpos(GridPos& gp_lat,
628 GridPos& gp_lon,
629 const Index& atmosphere_dim,
630 ConstVectorView lat_grid,
631 ConstVectorView lon_grid,
632 ConstVectorView rte_pos);
633
651 ConstVectorView p_grid,
652 ConstVectorView lat_grid,
653 ConstMatrixView z_field,
654 const GridPos& gp_lat);
655
675 ConstVectorView p_grid,
676 ConstVectorView lat_grid,
677 ConstVectorView lon_grid,
678 ConstTensor3View z_field,
679 const GridPos& gp_lat,
680 const GridPos& gp_lon);
681
696void complex_n_interp(MatrixView n_real,
697 MatrixView n_imag,
698 const GriddedField3& complex_n,
699 const String& varname,
700 ConstVectorView f_grid,
701 ConstVectorView t_grid);
702
703#endif // special_interp_h
A constant view of a Matrix.
Definition: matpackI.h:1014
A constant view of a Tensor3.
Definition: matpackIII.h:132
A constant view of a Vector.
Definition: matpackI.h:489
The MatrixView class.
Definition: matpackI.h:1125
The Matrix class.
Definition: matpackI.h:1225
Deals with internal derivatives, Jacobian definition, and OEM calculations.
Definition: jacobian.h:345
The Tensor3 class.
Definition: matpackIII.h:339
The VectorView class.
Definition: matpackI.h:626
The Vector class.
Definition: matpackI.h:876
Implementation of gridded fields.
Header file for interpolation.cc.
Routines for setting up the jacobian.
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
void complex_n_interp(MatrixView n_real, MatrixView n_imag, const GriddedField3 &complex_n, const String &varname, ConstVectorView f_grid, ConstVectorView t_grid)
General function for interpolating data of complex n type.
void regrid_atmfield_by_gp(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regrids an atmospheric field, for precalculated grid positions.
void interp_atmsurface_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of a surface-type variable.
void regrid_atmfield_by_gp_oem(Tensor3 &field_new, const Index &atmosphere_dim, ConstTensor3View field_old, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of atmospheric field OEM-type.
void get_gp_atmsurf_to_rq(ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric surfaces to retrieval grids.
void regrid_atmsurf_by_gp(Matrix &field_new, const Index &atmosphere_dim, ConstMatrixView field_old, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regrids an atmospheric surface, for precalculated grid positions.
void interp_atmfield_gp2itw(Matrix &itw, const Index &atmosphere_dim, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Converts atmospheric grid positions to weights for interpolation of an atmospheric field.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac=0.5)
Calculates grid positions for pressure values.
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
void z_at_latlon(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, const GridPos &gp_lat, const GridPos &gp_lon)
Returns the geomtrical altitudes of p_grid for one latitude and one longitude.
void interp_atmsurface_by_gp(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_field, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Interpolates a surface-type variable given the grid positions.
void interp_cloudfield_gp2itw(VectorView itw, GridPos &gp_p_out, GridPos &gp_lat_out, GridPos &gp_lon_out, const GridPos &gp_p_in, const GridPos &gp_lat_in, const GridPos &gp_lon_in, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits)
Converts atmospheric a grid position to weights for interpolation of a field defined ONLY inside the ...
void get_gp_rq_to_atmgrids(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, Index &n_p, Index &n_lat, Index &n_lon, const ArrayOfVector &ret_grids, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
void regrid_atmsurf_by_gp_oem(Matrix &field_new, const Index &atmosphere_dim, ConstMatrixView field_old, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Regridding of surface field OEM-type.
void get_gp_atmgrids_to_rq(ArrayOfGridPos &gp_p, ArrayOfGridPos &gp_lat, ArrayOfGridPos &gp_lon, const RetrievalQuantity &rq, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Determines grid positions for regridding of atmospheric fields to retrieval grids.
void interp_atmfield_by_gp(VectorView x, const Index &atmosphere_dim, ConstTensor3View x_field, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon)
Interpolates an atmospheric field given the grid positions.
void rte_pos2gridpos(GridPos &gp_p, GridPos &gp_lat, GridPos &gp_lon, const Index &atmosphere_dim, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView rte_pos)
Converts a geographical position (rte_pos) to grid positions for p, lat and lon.
void interp_atmfield_by_itw(VectorView x, const Index &atmosphere_dim, ConstTensor3View x_field, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
Interpolates an atmospheric field with pre-calculated weights by interp_atmfield_gp2itw.
void z_at_lat_2d(VectorView z, ConstVectorView p_grid, ConstVectorView lat_grid, ConstMatrixView z_field, const GridPos &gp_lat)
Returns the geomtrical altitudes of p_grid for one latitude.
void interp_atmsurface_by_itw(VectorView x, const Index &atmosphere_dim, ConstMatrixView x_surface, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, ConstMatrixView itw)
Interpolates a surface-type variable with pre-calculated weights by interp_atmsurface_gp2itw.
Structure to store a grid position.
Definition: interpolation.h:73