VAPoR
0.1
|
#include <SphericalGrid.h>
Public Member Functions | |
SphericalGrid (const size_t bs[3], const size_t min[3], const size_t max[3], const double extents[6], const size_t permutation[3], const bool periodic[3], float **blks) | |
SphericalGrid (const size_t bs[3], const size_t min[3], const size_t max[3], const double extents[6], const size_t permutation[3], const bool periodic[3], float **blks, float missing_value) | |
float | GetValue (double x, double y, double z) const |
virtual void | GetUserExtents (double extents[6]) const |
virtual void | GetBoundingBox (const size_t min[3], const size_t max[3], double extents[6]) const |
virtual void | GetEnclosingRegion (const double minu[3], const double maxu[3], size_t min[3], size_t max[3]) const |
int | GetUserCoordinates (size_t i, size_t j, size_t k, double *x, double *y, double *z) const |
void | GetIJKIndex (double x, double y, double z, size_t *i, size_t *j, size_t *k) const |
void | GetIJKIndexFloor (double x, double y, double z, size_t *i, size_t *j, size_t *k) const |
int | Reshape (const size_t min[3], const size_t max[3], const bool periodic[3]) |
bool | InsideGrid (double x, double y, double z) const |
Public Member Functions inherited from VAPoR::RegularGrid | |
RegularGrid (const size_t bs[3], const size_t min[3], const size_t max[3], const double extents[6], const bool periodic[3], float **blks) | |
RegularGrid (const size_t bs[3], const size_t min[3], const size_t max[3], const double extents[6], const bool periodic[3], float **blks, float missing_value) | |
virtual | ~RegularGrid () |
float & | AccessIJK (size_t i, size_t j, size_t k) const |
virtual void | GetBoundingBox (const std::vector< size_t > &min, const std::vector< size_t > &max, std::vector< double > &minu, std::vector< double > &maxu) const |
virtual void | GetIJKMinMax (size_t min[3], size_t max[3]) const |
virtual void | GetIJKOrigin (size_t min[3]) const |
void | GetDimensions (size_t dims[3]) const |
float | GetMissingValue () const |
void | SetMissingValue (float missing_value) |
bool | HasMissingData () const |
virtual int | GetInterpolationOrder () const |
virtual void | SetInterpolationOrder (int order) |
void | getBilinearWeights (double x, double y, double z, double &iwgt, double &jwgt) const |
double | bilinearElevation (size_t i0, size_t i1, size_t j0, size_t j1, size_t k0, double iwgt, double jwgt) const |
double | bilinearInterpolation (size_t i0, size_t i1, size_t j0, size_t j1, size_t k0, double iwgt, double jwgt) const |
double | quadraticInterpolation (double x, double y, double z) const |
double | verticalLinearInterpolation (double x, double y, double z) const |
virtual void | GetRange (float range[2]) const |
virtual void | HasPeriodic (bool *idim, bool *jdim, bool *kdim) const |
virtual void | SetPeriodic (const bool periodic[3]) |
void | GetBlockSize (size_t bs[3]) const |
virtual void | GetMinCellExtents (double *x, double *y, double *z) const |
virtual int | GetRank () |
virtual double | _interpolateVaryingCoord (size_t, size_t, size_t, double, double, double) const |
float ** | GetBlks () const |
size_t | GetNumBlks () const |
float | Next () |
void | ResetItr () |
Iterator | begin () |
Iterator | end () |
ConstIterator | begin () const |
ConstIterator | end () const |
Static Public Member Functions | |
static void | CartToSph (double x, double y, double z, double *phi, double *theta, double *r) |
static void | SphToCart (double phi, double theta, double r, double *x, double *y, double *z) |
Additional Inherited Members | |
Protected Member Functions inherited from VAPoR::RegularGrid | |
float & | _AccessIJK (float **blks, size_t i, size_t j, size_t k) const |
void | _ClampCoord (double &x, double &y, double &z) const |
void | _SetExtents (const double extents[6]) |
Protected Attributes inherited from VAPoR::RegularGrid | |
size_t | _min [3] |
size_t | _max [3] |
Definition at line 28 of file SphericalGrid.h.
VAPoR::SphericalGrid::SphericalGrid | ( | const size_t | bs[3], |
const size_t | min[3], | ||
const size_t | max[3], | ||
const double | extents[6], | ||
const size_t | permutation[3], | ||
const bool | periodic[3], | ||
float ** | blks | ||
) |
Construct a spherical grid sampling a 3D or 2D scalar function
[in] | bs | A three-element vector specifying the dimensions of each block storing the sampled scalar function. |
[in] | min | A three-element vector specifying the ijk index of the first point in the grid. The first grid point need not coincide with block boundaries. I.e. the indecies need not be (0,0,0) |
[in] | max | A three-element vector specifying the ijk index of the last point in the grid |
[in] | extents | A six-element vector specifying the user coordinates of the first (first three elements) and last (last three elements) of the grid points indicated by min and max , respectively. The units are degrees, not radians. |
[in] | permutation | A three-element array indicating the ordering of the Longitude, Latitude, and radial dimensions. The array must contain some permutation of the set (0,1,2). The permuation (0,1,2) indicates that longitude is the fastest varying dimesion, then latitude then radius. The permutation (2,1,0) indicates that radius is fastest, then latitude, and so on. |
[in] | periodic | A three-element boolean vector indicating which i,j,k indecies, respectively, are periodic. |
[in] | blks | An array of blocks containing the sampled function. The dimensions of each block is given by bs . The number of blocks is given by the product of the terms: |
over i = 0..2.
[in] | coords | An array of blocks with dimension and number the same as blks specifying the varying dimension grid point coordinates. |
[in] | varying_dim | An enumerant indicating which axis is the varying dimension: 0 for I, 1 for J, 2 for K |
VAPoR::SphericalGrid::SphericalGrid | ( | const size_t | bs[3], |
const size_t | min[3], | ||
const size_t | max[3], | ||
const double | extents[6], | ||
const size_t | permutation[3], | ||
const bool | periodic[3], | ||
float ** | blks, | ||
float | missing_value | ||
) |
Construct a spherical grid sampling a 3D or 2D scalar function that contains missing values.
This constructor adds a parameter, missing_value
, that specifies the value of missing values in the sampled function. When reconstructing the function at arbitrary coordinates special consideration is given to grid points with missing values that are used in the reconstruction.
|
inlinestatic |
|
virtual |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Get voxel coordinates of grid containing a region
Calculates the starting and ending IJK voxel coordinates of the smallest grid completely containing the rectangular region defined by the user coordinates minu
and maxu
If rectangluar region defined by minu
and maxu
can not be contained the minimum and maximum IJK coordinates are returned in min
and max
, respectively
[in] | minu | User coordinates of minimum coorner |
[in] | maxu | User coordinates of maximum coorner |
[out] | min | Integer coordinates of minimum coorner |
[out] | max | Integer coordinates of maximum coorner |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Return the closest grid point to the specified user coordinates
This method returns the ijk index of the grid point closest to the specified user coordinates based on Euclidean distance. If any of the input coordinates correspond to periodic dimensions the the coordinate(s) are first re-mapped to lie inside the grid extents as returned by GetUserExtents()
[in] | x | coordinate along fastest varying dimension |
[in] | y | coordinate along second fastest varying dimension |
[in] | z | coordinate along third fastest varying dimension |
[out] | i | index of grid point along fastest varying dimension |
[out] | j | index of grid point along second fastest varying dimension |
[out] | k | index of grid point along third fastest varying dimension |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Return the corner grid point of the cell containing the specified user coordinates
This method returns the smallest ijk index of the grid point of associated with the cell containing the specified user coordinates. If any of the input coordinates correspond to periodic dimensions the the coordinate(s) are first re-mapped to lie inside the grid extents as returned by GetUserExtents()
If the specified coordinates lie outside of the grid (are not contained by any cell) the lowest valued ijk index of the grid points defining the boundary cell closest to the point are returned.
[in] | x | coordinate along fastest varying dimension |
[in] | y | coordinate along second fastest varying dimension |
[in] | z | coordinate along third fastest varying dimension |
[out] | i | index of grid point along fastest varying dimension |
[out] | j | index of grid point along second fastest varying dimension |
[out] | k | index of grid point along third fastest varying dimension |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Return the user coordinates of a grid point
This method returns the user coordinates of the grid point specified by index(i,j,k)
[in] | i | index of grid point along fastest varying dimension |
[in] | j | index of grid point along second fastest varying dimension |
[in] | k | index of grid point along third fastest varying dimension |
[out] | x | coordinate of grid point along fastest varying dimension |
[out] | y | coordinate of grid point along second fastest varying dimension |
[out] | z | coordinate of grid point along third fastest varying dimension |
status | A negative int is returned if index(i,j,k) is out out of bounds |
Reimplemented from VAPoR::RegularGrid.
|
inlinevirtual |
Return the extents of the user coordinate system
This method returns min and max extents of the user coordinate system defined on the grid. The minimum extent is the coordinate of the grid point with index(0,0,0). The maximum extent is the coordinate of the grid point with index(nx-1, ny-1, nz-1), where nx, ny, and nz are the I, J, K dimensions, respectively.
[out] | extents | A six-element array, the first three values will contain the minimum coordinate, and the last three values the maximum coordinate |
Return extents in Cartesian coordinates
Reimplemented from VAPoR::RegularGrid.
Definition at line 110 of file SphericalGrid.h.
|
virtual |
Get the reconstructed value of the sampled scalar function
This method reconstructs the scalar field at an arbitrary point in space. If the point's coordinates are outside of the grid's coordinate extents as returned by GetUserExtents(), and the grid is not periodic along the out-of-bounds axis, the value returned will be the missing_value.
If the value of any of the grid point samples used in the reconstruction is the missing_value then the result returned is the missing_value.
The reconstruction method used is determined by interpolation order returned by GetInterpolationOrder()
[in] | x | coordinate along fastest varying dimension |
[in] | y | coordinate along second fastest varying dimension |
[in] | z | coordinate along third fastest varying dimension |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Return true if the specified point lies inside the grid
This method can be used to determine if a point expressed in user coordinates reside inside or outside the grid
[in] | x | coordinate along fastest varying dimension |
[in] | y | coordinate along second fastest varying dimension |
[in] | z | coordinate along third fastest varying dimension |
bool | True if point is inside the grid |
Reimplemented from VAPoR::RegularGrid.
|
virtual |
Change the voxel exents specified by the constructor
This method permits the grid to be reshaped under the constraints that: 1) the number of blocks does not change, and 2) the grid can only get smaller, not larger. I.e. min
can only increase and max
can only decrease.
[in] | min | A three-element vector specifying the ijk index of the first point in the grid. The first grid point need not coincide with block boundaries. I.e. the indecies need not be (0,0,0): the first grid point is not required to be the first element of the array |
[in] | max | A three-element vector specifying the ijk index of the last point in the grid. |
[in] | periodic | A three-element boolean vector indicating which i,j,k indecies, respectively, are periodic |
Reimplemented from VAPoR::RegularGrid.
|
inlinestatic |