ARTS 2.5.4 (git: 31ce4f0e)
GridPos Struct Reference

Structure to store a grid position. More...

#include <interpolation.h>

## Public Attributes

Index idx

std::array< Numeric, 2 > fd

## Friends

ostream & operator<< (ostream &os, const GridPos &gp)
Output operator for GridPos. More...

## Detailed Description

Structure to store a grid position.

A grid position specifies, where an interpolation point is, relative to the original grid. It consists of three parts, an Index giving the original grid index below the interpolation point, a Numeric giving the fractional distance to the next original grid point, and a Numeric giving 1 minus this number. Of course, the last element is redundant. However, it is efficient to store this, since it is used many times over. We store the two Numerics in a plain C array of dimension 2. (No need to use fancy Array or Vector for this, since the dimension is fixed.)

For example, idx=3 and fd=.5 means that this interpolation point is half-way between index 3 and 4 of the original grid.

Note, that below in the first paragraph means "with a lower index". If the original grid is sorted in descending order, the value at the grid point below the interpolation point will be numerically higher than the interpolation point.

In other words, grid positions and fractional distances are defined relative to the order of the original grid. Examples:

old grid = 2 3 new grid = 2.25 idx = 0 fd = 0.25

old grid = 3 2 new grid = 2.25 idx = 0 fd = 0.75

Note that fd is different in the second case, because the old grid is sorted in descending order. Note also that idx is the same in both cases.

Grid positions for a whole new grid are stored in an Array<GridPos> (called ArrayOfGridPos).

Definition at line 73 of file interpolation.h.

## ◆ operator<<

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

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 96 of file interpolation.cc.

## ◆ fd

 std::array GridPos::fd

Fractional distance to next point (0<=fd<=1), fd = 1-fd.

Definition at line 75 of file interpolation.h.

## ◆ idx

 Index GridPos::idx

Original grid index below interpolation point.

Definition at line 74 of file interpolation.h.

The documentation for this struct was generated from the following file: