interpolation.cc File Reference

Interpolation routines. More...

#include <iostream>
#include <cmath>
#include "array.h"
#include "check_input.h"
#include "interpolation.h"
#include "logic.h"

Include dependency graph for interpolation.cc:

Go to the source code of this file.

Defines

#define LOOPIT(x)   for ( const Numeric* x=&t##x.fd[1]; x>=&t##x.fd[0]; --x )
 Macro for interpolation weight loops.

Functions

ostream & operator<< (ostream &os, const GridPos &gp)
 Output operator for GridPos.
void gridpos (ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
 Set up a grid position Array.
void gridpos (GridPos &gp, ConstVectorView old_grid, const Numeric &new_grid, const Numeric &extpolfac)
 gridpos
void gridpos_copy (GridPos &gp_new, const GridPos &gp_old)
 gridpos_copy
Numeric fractional_gp (const GridPos &gp)
 fractional_gp
void gridpos_check_fd (GridPos &gp)
 gridpos_check_fd
void gridpos_force_end_fd (GridPos &gp)
 gridpos_force_end_fd
bool is_gridpos_at_index_i (const GridPos &gp, const Index &i)
 is_gridpos_at_index_i
Index gridpos2gridrange (const GridPos &gp, const bool &upwards)
 gridpos2gridrange
void interpweights (VectorView itw, const GridPos &tc)
 Red 1D interpolation weights.
void interpweights (VectorView itw, const GridPos &tr, const GridPos &tc)
 Red 2D interpolation weights.
void interpweights (VectorView itw, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 3D interpolation weights.
void interpweights (VectorView itw, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 4D interpolation weights.
void interpweights (VectorView itw, const GridPos &ts, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 5D interpolation weights.
void interpweights (VectorView itw, const GridPos &tv, const GridPos &ts, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 6D interpolation weights.
Numeric interp (ConstVectorView itw, ConstVectorView a, const GridPos &tc)
 Red 1D Interpolate.
Numeric interp (ConstVectorView itw, ConstMatrixView a, const GridPos &tr, const GridPos &tc)
 Red 2D Interpolate.
Numeric interp (ConstVectorView itw, ConstTensor3View a, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 3D Interpolate.
Numeric interp (ConstVectorView itw, ConstTensor4View a, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 4D Interpolate.
Numeric interp (ConstVectorView itw, ConstTensor5View a, const GridPos &ts, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 5D Interpolate.
Numeric interp (ConstVectorView itw, ConstTensor6View a, const GridPos &tv, const GridPos &ts, const GridPos &tb, const GridPos &tp, const GridPos &tr, const GridPos &tc)
 Red 6D Interpolate.
void interpweights (MatrixView itw, const ArrayOfGridPos &cgp)
 Compute 1D interpolation weights.
void interpweights (MatrixView itw, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 2D interpolation weights for a sequence of positions.
void interpweights (MatrixView itw, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 3D interpolation weights for a sequence of positions.
void interpweights (MatrixView itw, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 4D interpolation weights for a sequence of positions.
void interpweights (MatrixView itw, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 5D interpolation weights for a sequence of positions.
void interpweights (MatrixView itw, const ArrayOfGridPos &vgp, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 6D interpolation weights for a sequence of positions.
void interp (VectorView ia, ConstMatrixView itw, ConstVectorView a, const ArrayOfGridPos &cgp)
 Interpolate 1D field.
void interp (VectorView ia, ConstMatrixView itw, ConstMatrixView a, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 2D field to a sequence of positions.
void interp (VectorView ia, ConstMatrixView itw, ConstTensor3View a, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 3D field to a sequence of positions.
void interp (VectorView ia, ConstMatrixView itw, ConstTensor4View a, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 4D field to a sequence of positions.
void interp (VectorView ia, ConstMatrixView itw, ConstTensor5View a, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 5D field to a sequence of positions.
void interp (VectorView ia, ConstMatrixView itw, ConstTensor6View a, const ArrayOfGridPos &vgp, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 6D field to a sequence of positions.
void interpweights (Tensor3View itw, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 2D interpolation weights for an entire field.
void interpweights (Tensor4View itw, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 3D interpolation weights for an entire field.
void interpweights (Tensor5View itw, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 4D interpolation weights for an entire field.
void interpweights (Tensor6View itw, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 5D interpolation weights for an entire field.
void interpweights (Tensor7View itw, const ArrayOfGridPos &vgp, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Compute 6D interpolation weights for an entire field.
void interp (MatrixView ia, ConstTensor3View itw, ConstMatrixView a, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 2D field to another 2D field.
void interp (Tensor3View ia, ConstTensor4View itw, ConstTensor3View a, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 3D field to another 3D field.
void interp (Tensor4View ia, ConstTensor5View itw, ConstTensor4View a, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 4D field to another 4D field.
void interp (Tensor5View ia, ConstTensor6View itw, ConstTensor5View a, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 5D field to another 5D field.
void interp (Tensor6View ia, ConstTensor7View itw, ConstTensor6View a, const ArrayOfGridPos &vgp, const ArrayOfGridPos &sgp, const ArrayOfGridPos &bgp, const ArrayOfGridPos &pgp, const ArrayOfGridPos &rgp, const ArrayOfGridPos &cgp)
 Interpolate 6D field to another 6D field.
Numeric interp_poly (ConstVectorView x, ConstVectorView y, const Numeric &x_i, const GridPos &gp)
 Polynomial interpolation.
void polint (Numeric &y_int, Numeric &dy_int, ConstVectorView xa, ConstVectorView ya, const Index &n, const Numeric &x)
 Polynomial interpolation.

Variables

const Numeric sum_check_epsilon = 1e-6
 The maximum difference from 1 that we allow for a sum check.
const Numeric FD_TOL = 1e-3
 Allowed tolerance for fractional distance values.


Detailed Description

Interpolation routines.

Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002
There are no general single-step interpolation functions in ARTS. Rather, there are a set of useful utility functions that can be used to achieve interpolation. Roughly, you can separate these into functions determining grid-position Arrays, functions determining interpolation weight Tensors, and functions applying the interpolation.

Doing an interpolation requires a chain of function calls:

  1. gridpos (one for each interpolation dimension)
  2. interpweights
  3. interp

Definition in file interpolation.cc.


Define Documentation

#define LOOPIT (  )     for ( const Numeric* x=&t##x.fd[1]; x>=&t##x.fd[0]; --x )

Macro for interpolation weight loops.

We use the macro LOOPIT to make the notation for the nested for loops in the interpweights functions more concise, and to avoid typing errors.

Should resolve to something like:

for ( const Numeric* p=&tp.fd[1]; p>=&tp.fd[0]; --p )

Definition at line 91 of file interpolation.cc.

Referenced by interpweights().


Function Documentation

Numeric fractional_gp ( const GridPos gp  ) 

fractional_gp

Returns the complete fractional grid position.

The fractional grid position is the sum of grid index and fraction distance, and is not an integer value.

Returns:
Fractional grid position.
Parameters:
gp Input: Grid position structure.
Author:
Patrick Eriksson
Date:
2004-09-28

Definition at line 483 of file interpolation.cc.

References GridPos::fd, and GridPos::idx.

Referenced by is_gp_inside_cloudbox(), iy_interp_cloudbox_field(), mcPathTraceGeneral(), mcPathTraceIPA(), and ppath_calc().

void gridpos ( GridPos gp,
ConstVectorView  old_grid,
const Numeric new_grid,
const Numeric extpolfac 
)

gridpos

Creates a grid position structure.

This is a gateway to the function for arrays of grid positions, to be used for e.g. "red interpolation".

Return values:
gp The GridPos structure.
Parameters:
old_grid The original grid.
new_grid The position where we want to have the interpolated value.
extpolfac Extrapolation factor. Default value is 0.5, which means that extrapolation of half of the last grid distance is allowed. You don't have to specify this.
Author:
Patrick Eriksson
Date:
2002-12-31
Author:
Stefan Buehler
Date:
2008-03-03

Definition at line 438 of file interpolation.cc.

References gridpos(), and gridpos_copy().

void gridpos ( ArrayOfGridPos gp,
ConstVectorView  old_grid,
ConstVectorView  new_grid,
const Numeric extpolfac 
)

Set up a grid position Array.

This is the function to find the position in the original grid and set the fd for the linear interpolation case.

The old grid has to be strictly sorted. It can be in ascending or descending order. But there must not be any duplicate values. Furthermore, the old grid must contain at least two points.

The new grid doesn't have to be sorted, but the function will be faster if it is sorted or mostly sorted. It is ok if the new grid contains only 1 point.

The beauty is, that this is all it needs to do also interpolation in higher dimensions: You just have to call gridpos for all the dimensions that you want to interpolate.

Note also, that for this step you do not need the field itself at all!

The new grid has basically to be inside the range covered by old grid, but some margins are given for practical reasons. For higher flexibility, a selectable extrapolation is allowed. The allowed extrapolation is given in fractions of the distance between the outermost two points. For example, if *extpolfac* is set to 0.5 an extrapolation of half the distance between end points is allowed. In this case, if point 0 is at 0 and point 1 is at 1, the new grid can be extended to -0.5.

0.5 is the default value for extpolfac. Normally, you should just use the function with 3 arguments, which means that the default value will be used.

Return values:
gp Grid position Array.
Parameters:
old_grid The original grid.
new_grid The new grid where we want to have the interpolated values.
extpolfac Extrapolation factor. Has a default value of 0.5. You should normally not specify this parameter!
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 153 of file interpolation.cc.

References GridPos::fd, GridPos::idx, is_decreasing(), is_increasing(), is_size(), and ConstVectorView::nelem().

Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), abs_vecTransform(), antenna1d_matrix(), AtmFieldsCalc(), AtmFieldsRefinePgrid(), cloud_ppath_update3D(), cloudbox_ppath_start_stepping(), doit_i_fieldSetClearsky(), doit_scat_fieldCalcLimb(), ext_matTransform(), get_perturbation_gridpos(), get_refr_index_1d(), get_refr_index_2d(), get_refr_index_3d(), gridpos(), gridpos_poly(), interp_cloud_coeff1D(), interp_gfield3(), interp_scat_angle_temperature(), SLIData2::interpolate(), interpolate_raytracing_points(), interpolate_scat_angle(), interpTArray(), iy_interp_cloudbox_field(), jacobian_from_path_to_rgrids(), MCIPA(), mcPathTrace(), mcPathTraceGeneral(), mcPathTraceIPA(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), opt_propExtract(), p2gridpos(), pha_mat_singleExtract(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pha_matTransform(), pmomCalc(), pnd_fieldCalc(), ppath_calc(), ppath_start_3d(), ppath_start_stepping(), refr_indexFieldAndGradients(), rte_pos_and_losFromTangentPressure(), Sample_ppathlengthLOS(), scat_data_monoCalc(), sensor_posAddRgeoid(), sensor_summation_vector(), test01(), test04(), test05(), test06(), test07(), z_at_lat_2d(), z_at_latlon(), za_gridOpt(), and ZaSatOccultation().

Index gridpos2gridrange ( const GridPos gp,
const bool &  upwards 
)

gridpos2gridrange

Determines which grid range that is of interest for a given grid position.

The purpose of the function is to determine which two grid values that sorround the given point. The index of the lower grid value is returned.

For a point exactly on a grid value it is not clear if it is the range below or above that is of interest. The input argument upward is used to resolve such cases, where upward == 1 means that it is the range above that is of interest.

Parameters:
gp Grid position structure.
upwards Direction of interest, see above.
Returns:
The index of the lower end of the grid range.
Author:
Patrick Eriksson
Date:
2002-05-20

Definition at line 615 of file interpolation.cc.

References GridPos::fd, GridPos::idx, and is_bool().

Referenced by plevel_slope_2d(), plevel_slope_3d(), ppath_start_1d(), ppath_start_2d(), ppath_start_3d(), and ppath_start_stepping().

void gridpos_check_fd ( GridPos gp  ) 

gridpos_check_fd

Checks that the fractional distances have a value in the range [0,1].

This function can be used when you are sure that the fractional distances have been calculated correctly, but the limited numerical precision can give values below 0 or above 1.

Return values:
gp Grid position structure.
Author:
Patrick Eriksson
Date:
2002-05-21

Definition at line 503 of file interpolation.cc.

References GridPos::fd, and FD_TOL.

Referenced by cloudbox_ppath_start_stepping(), ppath_fill_1d(), ppath_fill_2d(), ppath_fill_3d(), and ppath_start_stepping().

void gridpos_copy ( GridPos gp_new,
const GridPos gp_old 
)

gridpos_copy

Copies the content of a GridPos structure.

Return values:
gp_new The GridPos structure to be filled.
Parameters:
gp_old The GridPos structure to be copied.
Author:
Patrick Eriksson
Date:
2002-09-17

Definition at line 461 of file interpolation.cc.

References GridPos::fd, and GridPos::idx.

Referenced by get_radiative_background(), gridpos(), interp_atmfield_by_gp(), interp_atmsurface_by_gp(), ppath_append(), ppath_copy(), rte_posShift(), z_at_lat_2d(), and z_at_latlon().

void gridpos_force_end_fd ( GridPos gp  ) 

gridpos_force_end_fd

Forces that the fractional distances are set to 0 or 1.

This function can be called when it is known that a position is exactly on a grid point. The fractional distance of the grid position is then 0 or 1, but rounding errors can give a slightly deviating value.

The difference between this function and gridpos_check_fd is that this function is only applicable for end points, while the other function can be called for every point.

The input fractional distances are not allowed to deviate freom 0 and 1 with more than FD_TOL.

Return values:
gp Grid position structure.
Author:
Patrick Eriksson
Date:
2002-05-22

Definition at line 544 of file interpolation.cc.

References GridPos::fd.

Referenced by interpolate_raytracing_points(), ppath_end_1d(), ppath_end_2d(), ppath_end_3d(), and ppath_start_3d().

void interp ( Tensor6View  ia,
ConstTensor7View  itw,
ConstTensor6View  a,
const ArrayOfGridPos vgp,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 6D field to another 6D field.

This performs a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

This function can be easily distinguished from the other interpolation function (that creates a sequence of interpolated values), because of the dimension of ia and itw.

The size of ia and itw in all dimensions must be consistent with the grid position Arrays.

Return values:
ia Interpolated field.
Parameters:
itw Interpolation weights.
a The field to interpolate.
vgp The grid position Array for the vitrine dimension.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2727 of file interpolation.cc.

void interp ( Tensor5View  ia,
ConstTensor6View  itw,
ConstTensor5View  a,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 5D field to another 5D field.

This performs a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

This function can be easily distinguished from the other interpolation function (that creates a sequence of interpolated values), because of the dimension of ia and itw.

The size of ia and itw in all dimensions must be consistent with the grid position Arrays.

Return values:
ia Interpolated field.
Parameters:
itw Interpolation weights.
a The field to interpolate.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2629 of file interpolation.cc.

void interp ( Tensor4View  ia,
ConstTensor5View  itw,
ConstTensor4View  a,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 4D field to another 4D field.

This performs a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

This function can be easily distinguished from the other interpolation function (that creates a sequence of interpolated values), because of the dimension of ia and itw.

The size of ia and itw in all dimensions must be consistent with the grid position Arrays.

Return values:
ia Interpolated field.
Parameters:
itw Interpolation weights.
a The field to interpolate.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2540 of file interpolation.cc.

void interp ( Tensor3View  ia,
ConstTensor4View  itw,
ConstTensor3View  a,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 3D field to another 3D field.

This performs a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

This function can be easily distinguished from the other interpolation function (that creates a sequence of interpolated values), because of the dimension of ia and itw.

The size of ia and itw in all dimensions must be consistent with the grid position Arrays.

Return values:
ia Interpolated field.
Parameters:
itw Interpolation weights.
a The field to interpolate.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2460 of file interpolation.cc.

void interp ( MatrixView  ia,
ConstTensor3View  itw,
ConstMatrixView  a,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 2D field to another 2D field.

This performs a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

This function can be easily distinguished from the other interpolation function (that creates a sequence of interpolated values), because of the dimension of ia and itw.

The size of ia and itw in all dimensions must be consistent with the grid position Arrays.

Return values:
ia Interpolated field.
Parameters:
itw Interpolation weights.
a The field to interpolate.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2390 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstTensor6View  a,
const ArrayOfGridPos vgp,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 6D field to a sequence of positions.

This performs a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The output vector ia also must have the same length. And the dimension of itw must be consistent with this.

This function can be easily distinguished from the other interpolation function (that creates an entire field of interpolated values), because of the dimension of ia and itw.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
vgp The grid position Array for the vitrine dimension.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1953 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstTensor5View  a,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 5D field to a sequence of positions.

This performs a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The output vector ia also must have the same length. And the dimension of itw must be consistent with this.

This function can be easily distinguished from the other interpolation function (that creates an entire field of interpolated values), because of the dimension of ia and itw.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1870 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstTensor4View  a,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 4D field to a sequence of positions.

This performs a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The output vector ia also must have the same length. And the dimension of itw must be consistent with this.

This function can be easily distinguished from the other interpolation function (that creates an entire field of interpolated values), because of the dimension of ia and itw.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1793 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstTensor3View  a,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 3D field to a sequence of positions.

This performs a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The output vector ia also must have the same length. And the dimension of itw must be consistent with this.

This function can be easily distinguished from the other interpolation function (that creates an entire field of interpolated values), because of the dimension of ia and itw.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1722 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstMatrixView  a,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Interpolate 2D field to a sequence of positions.

This performs a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The output vector ia also must have the same length. And the dimension of itw must be consistent with this.

This function can be easily distinguished from the other interpolation function (that creates an entire field of interpolated values), because of the dimension of ia and itw.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1657 of file interpolation.cc.

void interp ( VectorView  ia,
ConstMatrixView  itw,
ConstVectorView  a,
const ArrayOfGridPos cgp 
)

Interpolate 1D field.

For this 1D case there is no distinction between "blue" and "green" type interpolation.

The output vector ia must have the same length as the grid position vector cgp. And the dimension of itw must be consistent with this.

Return values:
ia Vector containing the interpolated field values.
Parameters:
itw Interpolation weights.
a The field to interpolate.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1598 of file interpolation.cc.

Numeric interp ( ConstVectorView  itw,
ConstTensor6View  a,
const GridPos tv,
const GridPos ts,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 6D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
tv The grid position for the vitrine dimension.
ts The grid position for the shelf dimension.
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 1170 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Numeric interp ( ConstVectorView  itw,
ConstTensor5View  a,
const GridPos ts,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 5D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
ts The grid position for the shelf dimension.
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 1111 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Numeric interp ( ConstVectorView  itw,
ConstTensor4View  a,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 4D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 1056 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Numeric interp ( ConstVectorView  itw,
ConstTensor3View  a,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 3D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 1005 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Numeric interp ( ConstVectorView  itw,
ConstMatrixView  a,
const GridPos tr,
const GridPos tc 
)

Red 2D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 958 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Numeric interp ( ConstVectorView  itw,
ConstVectorView  a,
const GridPos tc 
)

Red 1D Interpolate.

"Red" interpolation returns just a scalar.

The dimension of itw must be consistent with the dimension of the interpolation (2^n).

Parameters:
itw Interpolation weights.
a The field to interpolate.
tc The grid position for the column dimension.
Returns:
Interpolated value.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 915 of file interpolation.cc.

References GridPos::idx, is_same_within_epsilon(), is_size(), ConstVectorView::sum(), and sum_check_epsilon.

Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), abs_vecTransform(), antenna1d_matrix(), AtmFieldsCalc(), AtmFieldsRefinePgrid(), cloud_ppath_update3D(), cloudbox_ppath_start_stepping(), doit_i_fieldSetClearsky(), doit_scat_fieldCalcLimb(), ext_matTransform(), get_refr_index_1d(), get_refr_index_2d(), get_refr_index_3d(), interp_atmfield_by_itw(), interp_atmsurface_by_itw(), interp_cloud_coeff1D(), interp_gfield3(), interp_scat_angle_temperature(), SLIData2::interpolate(), interpolate_raytracing_points(), interpolate_scat_angle(), interpolate_scat_angleDOIT(), interpTArray(), itw2p(), iy_interp_cloudbox_field(), mcPathTrace(), mcPathTraceGeneral(), mcPathTraceIPA(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), opt_propExtract(), perturbation_field_1d(), perturbation_field_2d(), perturbation_field_3d(), pha_mat_singleExtract(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pha_matTransform(), plevel_slope_3d(), pmomCalc(), pnd_fieldCalc(), ppath_start_stepping(), refr_indexFieldAndGradients(), rte_pos_and_losFromTangentPressure(), scat_data_monoCalc(), sensor_posAddRgeoid(), sensor_summation_vector(), test01(), test04(), test05(), test06(), test07(), test08(), z_at_lat_2d(), z_at_latlon(), za_gridOpt(), and ZaSatOccultation().

Numeric interp_poly ( ConstVectorView  x,
ConstVectorView  y,
const Numeric x_i,
const GridPos gp 
)

Polynomial interpolation.

This function performs a polynomial interpolation. Given two vectors x, y the value of y corresponding to x_i is returned. The function uses the common gridpositions (which are also used for linear interpolation).

Parameters:
x original grid
y values corresponding to x-values
x_i a value x, for which the corresponding y value is requested
gp grid position of x_i in relation to x
Returns:
interpolated value
Author:
Claudia Emde
Date:
2004-03-17

Definition at line 2824 of file interpolation.cc.

References arts_exit(), GridPos::fd, GridPos::idx, ConstVectorView::nelem(), and polint().

Referenced by doit_scat_fieldCalcLimb(), interp_cloud_coeff1D(), iy_interp_cloudbox_field(), test07(), and za_gridOpt().

void interpweights ( Tensor7View  itw,
const ArrayOfGridPos vgp,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 6D interpolation weights for an entire field.

Compute the weights for a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

The dimensions of itw must be consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Tensor with one more dimension than the number of grid position Arrays.

Return values:
itw Interpolation weights
Parameters:
vgp The grid position Array for the vitrine dimension.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2310 of file interpolation.cc.

void interpweights ( Tensor6View  itw,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 5D interpolation weights for an entire field.

Compute the weights for a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

The dimensions of itw must be consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Tensor with one more dimension than the number of grid position Arrays.

Return values:
itw Interpolation weights
Parameters:
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2233 of file interpolation.cc.

void interpweights ( Tensor5View  itw,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 4D interpolation weights for an entire field.

Compute the weights for a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

The dimensions of itw must be consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Tensor with one more dimension than the number of grid position Arrays.

Return values:
itw Interpolation weights
Parameters:
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2164 of file interpolation.cc.

void interpweights ( Tensor4View  itw,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 3D interpolation weights for an entire field.

Compute the weights for a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

The dimensions of itw must be consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Tensor with one more dimension than the number of grid position Arrays.

Return values:
itw Interpolation weights
Parameters:
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2103 of file interpolation.cc.

void interpweights ( Tensor3View  itw,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 2D interpolation weights for an entire field.

Compute the weights for a "green" type interpolation of the field, that means that the grid position Arrays are interpreted as defining the grids for the interpolated field.

The dimensions of itw must be consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Tensor with one more dimension than the number of grid position Arrays.

Return values:
itw Interpolation weights
Parameters:
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 2041 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos vgp,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 6D interpolation weights for a sequence of positions.

Compute the weights for a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The dimensions of itw must be also consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Matrix, whereas in the other case it is a Tensor with one more dimension than there are input grid position Arrays.

Return values:
itw Interpolation weights.
Parameters:
vgp The grid position Array for the vitrine dimension.
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1539 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos sgp,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 5D interpolation weights for a sequence of positions.

Compute the weights for a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The dimensions of itw must be also consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Matrix, whereas in the other case it is a Tensor with one more dimension than there are input grid position Arrays.

Return values:
itw Interpolation weights.
Parameters:
sgp The grid position Array for the shelf dimension.
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1475 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos bgp,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 4D interpolation weights for a sequence of positions.

Compute the weights for a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The dimensions of itw must be also consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Matrix, whereas in the other case it is a Tensor with one more dimension than there are input grid position Arrays.

Return values:
itw Interpolation weights.
Parameters:
bgp The grid position Array for the book dimension.
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1416 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos pgp,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 3D interpolation weights for a sequence of positions.

Compute the weights for a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The dimensions of itw must be also consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Matrix, whereas in the other case it is a Tensor with one more dimension than there are input grid position Arrays.

Return values:
itw Interpolation weights.
Parameters:
pgp The grid position Array for the page dimension.
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1362 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos rgp,
const ArrayOfGridPos cgp 
)

Compute 2D interpolation weights for a sequence of positions.

Compute the weights for a "blue" type interpolation of the field, that means that the grid position Arrays are interpreted as defining a sequence of positions. ALL GRID POSITION ARRAYS MUST HAVE THE SAME LENGTH!

The dimensions of itw must be also consistent with this.

Note that we still do not need the actual field for this step.

This function can be easily distinguished from the other interpweights function (for "green" interpolation), because the output is a Matrix, whereas in the other case it is a Tensor with one more dimension than there are input grid position Arrays.

Return values:
itw Interpolation weights.
Parameters:
rgp The grid position Array for the row dimension.
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1305 of file interpolation.cc.

void interpweights ( MatrixView  itw,
const ArrayOfGridPos cgp 
)

Compute 1D interpolation weights.

For this 1D case there is no distinction between "blue" and "green" type interpolation.

The dimensions of itw must be consistent with cgp.

Note that we still do not need the actual field for this step.

Return values:
itw Interpolation weights.
Parameters:
cgp The grid position Array for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri May 3 08:55:51 2002

Definition at line 1232 of file interpolation.cc.

void interpweights ( VectorView  itw,
const GridPos tv,
const GridPos ts,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 6D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
tv The grid position for the vitrine dimension.
ts The grid position for the shelf dimension.
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 875 of file interpolation.cc.

References is_size(), and LOOPIT.

void interpweights ( VectorView  itw,
const GridPos ts,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 5D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
ts The grid position for the shelf dimension.
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 834 of file interpolation.cc.

References is_size(), and LOOPIT.

void interpweights ( VectorView  itw,
const GridPos tb,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 4D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
tb The grid position for the book dimension.
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 796 of file interpolation.cc.

References is_size(), and LOOPIT.

void interpweights ( VectorView  itw,
const GridPos tp,
const GridPos tr,
const GridPos tc 
)

Red 3D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
tp The grid position for the page dimension.
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 761 of file interpolation.cc.

References is_size(), and LOOPIT.

void interpweights ( VectorView  itw,
const GridPos tr,
const GridPos tc 
)

Red 2D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
tr The grid position for the row dimension.
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 729 of file interpolation.cc.

References is_size(), and LOOPIT.

void interpweights ( VectorView  itw,
const GridPos tc 
)

Red 1D interpolation weights.

"Red" interpolation returns just a scalar, so the weights are stored in a Vector.

The length of itw must be consistent with the dimension of the field to be interpolated (2^n).

Return values:
itw Interpolation weights.
Parameters:
tc The grid position for the column dimension.
Author:
Stefan Buehler <sbuehler@ltu.se>
Date:
Fri Jun 28 10:53:32 2002

Definition at line 671 of file interpolation.cc.

References is_size(), and LOOPIT.

Referenced by abs_lookupSetup(), abs_lookupSetupBatch(), abs_vecTransform(), antenna1d_matrix(), AtmFieldsCalc(), AtmFieldsRefinePgrid(), clear_rt_vars_at_gp(), cloud_atm_vars_by_gp(), cloud_ppath_update3D(), cloudbox_ppath_start_stepping(), doit_i_fieldSetClearsky(), doit_scat_fieldCalcLimb(), ext_matTransform(), GasAbsLookup::Extract(), get_refr_index_1d(), get_refr_index_2d(), get_refr_index_3d(), interp_atmfield_gp2itw(), interp_atmsurface_gp2itw(), interp_cloud_coeff1D(), interp_gfield3(), interp_scat_angle_temperature(), SLIData2::interpolate(), interpolate_raytracing_points(), interpolate_scat_angle(), interpTArray(), iy_calc(), iy_interp_cloudbox_field(), mcPathTrace(), mcPathTraceGeneral(), mcPathTraceIPA(), opt_depth_calc(), opt_prop_sptFromData(), opt_prop_sptFromMonoData(), opt_propExtract(), perturbation_field_1d(), perturbation_field_2d(), perturbation_field_3d(), pha_mat_singleExtract(), pha_mat_sptFromData(), pha_mat_sptFromDataDOITOpt(), pha_mat_sptFromMonoData(), pha_matTransform(), plevel_slope_3d(), pmomCalc(), pnd_fieldCalc(), ppath_start_stepping(), refr_indexFieldAndGradients(), rte_pos_and_losFromTangentPressure(), scat_data_monoCalc(), sensor_posAddRgeoid(), sensor_summation_vector(), test01(), test04(), test05(), test06(), test07(), test08(), z_at_lat_2d(), z_at_latlon(), za_gridOpt(), and ZaSatOccultation().

bool is_gridpos_at_index_i ( const GridPos gp,
const Index i 
)

is_gridpos_at_index_i

Determines if a grid position is at a given grid index.

A fractional deviation < FD_TOL to i will be treated as a match.

Returns:
True if at index i, else false.
Parameters:
gp Grid position structure.
i The grid index of interest.
Author:
Patrick Eriksson
Date:
2002-05-22

Definition at line 577 of file interpolation.cc.

References GridPos::fd, and GridPos::idx.

Referenced by iy_interp_cloudbox_field(), ppath_calc(), ppath_start_2d(), and ppath_start_3d().

ostream& operator<< ( ostream &  os,
const GridPos gp 
)

Output operator for GridPos.

This is just intended for testing and debugging.

Parameters:
os Output stream.
gp Grid position.
Returns:
The output stream.

Definition at line 105 of file interpolation.cc.

References GridPos::fd, and GridPos::idx.

void polint ( Numeric y_int,
Numeric dy_int,
ConstVectorView  xa,
ConstVectorView  ya,
const Index n,
const Numeric x 
)

Polynomial interpolation.

This function performs a polinomial interpolation. Given arrays xa(n) and ya(n), and a given value x, this function returns a value y and an error estimate dy. This function is (almost) copied from: Numerical Recipies in C, pages 108-110.

Parameters:
y_int interpolated value
dy_int error estimate
xa original grid (n elements)
ya corresponding values (n elements)
n order of polynom
x requested grid point
Returns:
interpolated value
Author:
Claudia Emde
Date:
2004-03-12

Definition at line 3010 of file interpolation.cc.

References abs, and ns.

Referenced by interp_poly().


Variable Documentation

const Numeric FD_TOL = 1e-3

Allowed tolerance for fractional distance values.

Fractional distances are not allowed to be negative or exceed 1 above the set tolerance. Values deviating less than the tolerance from 0 and 1 will be treated as end points, if such a check is performed.

We cannot use a sharp comparison there, due to numerical noise. The value of 1e-3 is an ad-hoc value.

Definition at line 76 of file interpolation.cc.

Referenced by gridpos_check_fd().

const Numeric sum_check_epsilon = 1e-6

The maximum difference from 1 that we allow for a sum check.

The sum check makes sure that the sum of all weights is approximately 1.

We cannot use a sharp comparison there, due to numerical noise. The value of 1e-6 is an ad-hoc value.

This shold be ok, the main point of the test is to make sure that what we have really *are* interpolation weights, and not something else.

Definition at line 63 of file interpolation.cc.

Referenced by interp().


Generated on Mon Mar 23 14:06:36 2009 for ARTS by  doxygen 1.5.6