41 typedef struct GRID_POINT_3D {
47 double&
operator ()(
const size_t& ix,
const size_t& iy,
const size_t& iz);
48 double operator ()(
const size_t& ix,
const size_t& iy,
const size_t& iz)
const;
68 const size_t& i_nx,
const size_t& i_ny,
const size_t& i_nz,
69 const size_t& i_ncols,
const size_t& i_nrows,
const size_t& i_ndepths);
71 Grid3DObject(
const size_t& ncols,
const size_t& nrows,
const size_t& ndepths,
72 const double&
cellsize,
const Coords& i_llcorner);
74 Grid3DObject(
const size_t& ncols,
const size_t& nrows,
const size_t& ndepths,
75 const double&
cellsize,
const Coords& i_llcorner,
const double& init);
89 void set(
const size_t& ncols,
const size_t& nrows,
const size_t& depths,
90 const double&
cellsize,
const Coords& i_llcorner);
99 void set(
const double&
cellsize,
const Coords& i_llcorner,
const Array3D<double>& grid3D_in);
101 void set(
const size_t& ncols,
const size_t& nrows,
const size_t& ndepths,
102 const double&
cellsize,
const Coords& i_llcorner,
const double& init);
106 void size(
size_t& o_ncols,
size_t& o_nrows,
size_t& o_ndepths)
const;
108 size_t getNx()
const;
109 size_t getNy()
const;
110 size_t getNz()
const;
134 bool gridify(Coords& point)
const;
146 bool gridify(std::vector<Coords>& vec_points,
const bool& keep_invalid=
false)
const;
162 void extractLayer(
const size_t& i_z, Grid2DObject& layer);
190 std::vector<double>
z;
size_t iy
grid index along Y
Definition: Grid3DObject.h:43
size_t ix
grid index along X
Definition: Grid3DObject.h:42
size_t iz
grid index along Z
Definition: Grid3DObject.h:44
Definition: Grid3DObject.h:41
A class to handle geographic coordinate systems. This class offers an easy way to transparently conve...
Definition: Coords.h:83
A class to represent 3D Grids. Typical application: wind field.
Definition: Grid3DObject.h:39
friend std::istream & operator>>(std::istream &is, Grid3DObject &grid)
Definition: Grid3DObject.cc:460
bool operator==(const Grid3DObject &in) const
Operator that tests for equality.
Definition: Grid3DObject.cc:136
const Grid3DObject operator-(const double &rhs) const
Definition: Grid3DObject.cc:63
bool z_is_absolute
Definition: Grid3DObject.h:193
double cellsize
Definition: Grid3DObject.h:192
void set(const size_t &ncols, const size_t &nrows, const size_t &depths, const double &cellsize, const Coords &i_llcorner)
Set all variables in one go.
Definition: Grid3DObject.cc:319
void setValues(const double &cellsize, const Coords &i_llcorner)
Are z coordinates absolute or relative to a DEM?
Definition: Grid3DObject.cc:390
size_t getNz() const
Definition: Grid3DObject.cc:366
void clear()
deletes the data, but keeps geolocalization
Definition: Grid3DObject.cc:382
bool grid_to_WGS84(Coords &point) const
Converts grid coordinates (i,j) into WGS84 coordinates.
Definition: Grid3DObject.cc:216
size_t getNy() const
Definition: Grid3DObject.cc:362
Array3D< double > grid3D
Definition: Grid3DObject.h:189
double & operator()(const size_t &ix, const size_t &iy, const size_t &iz)
Definition: Grid3DObject.cc:421
Coords llcorner
Vector of depths
Definition: Grid3DObject.h:191
Grid3DObject & operator=(const double &value)
Assignement operator.
Definition: Grid3DObject.cc:27
double getMin() const
Definition: Grid3DObject.cc:370
Grid3DObject & operator-=(const double &rhs)
Definition: Grid3DObject.cc:58
Grid3DObject()
Definition: Grid3DObject.cc:144
bool WGS84_to_grid(Coords point) const
Converts WGS84 coordinates into grid coordinates (i,j)
Definition: Grid3DObject.cc:263
double getMax() const
Definition: Grid3DObject.cc:374
size_t size() const
Definition: Grid3DObject.cc:354
const Grid3DObject operator*(const double &rhs) const
Definition: Grid3DObject.cc:89
Grid3DObject & operator*=(const double &rhs)
Definition: Grid3DObject.cc:84
size_t getNx() const
Definition: Grid3DObject.cc:358
Grid3DObject & operator+=(const double &rhs)
Definition: Grid3DObject.cc:32
bool operator!=(const Grid3DObject &in) const
Operator that tests for inequality.
Definition: Grid3DObject.cc:140
friend std::ostream & operator<<(std::ostream &os, const Grid3DObject &grid)
Definition: Grid3DObject.cc:447
void extractLayer(const size_t &i_z, Grid2DObject &layer)
Extract a 2D grid for a given height.
Definition: Grid3DObject.cc:409
std::vector< double > z
Definition: Grid3DObject.h:190
bool empty() const
Check if a grid does not contain any data (but it can contain geolocalization)
Definition: Grid3DObject.cc:386
bool gridify(Coords &point) const
Compute the positional parameters that are not already known This means that the Coords::point object...
Definition: Grid3DObject.cc:198
const Grid3DObject operator/(const double &rhs) const
Definition: Grid3DObject.cc:115
Grid3DObject & operator/=(const double &rhs)
Definition: Grid3DObject.cc:110
bool isSameGeolocalization(const Grid3DObject &target) const
check if the current Grid3DObject has the same geolocalization attributes as another Grid3DObject....
Definition: Grid3DObject.cc:396
double getMean() const
Definition: Grid3DObject.cc:378
const std::string toString() const
Definition: Grid3DObject.cc:437
const Grid3DObject operator+(const double &rhs) const
Definition: Grid3DObject.cc:37