14 #include <initializer_list> 17 #include "atlas/grid/Grid.h" 18 #include "atlas/grid/detail/grid/Healpix.h" 19 #include "atlas/grid/detail/grid/Structured.h" 28 class ReducedGaussianGrid;
29 class RegularGaussianGrid;
30 class RegularLonLatGrid;
31 class ShiftedLonLatGrid;
74 operator bool()
const {
return valid(); }
76 bool valid()
const {
return grid_; }
78 inline idx_t ny()
const {
return grid_->ny(); }
80 inline idx_t nx(
idx_t j )
const {
return grid_->nx( j ); }
82 inline const std::vector<idx_t>& nx()
const {
return grid_->nx(); }
84 inline idx_t nxmax()
const {
return grid_->nxmax(); }
86 inline const std::vector<double>& y()
const {
return grid_->y(); }
89 inline double x(
idx_t i,
idx_t j )
const {
return grid_->x( i, j ); }
92 inline double y(
idx_t j )
const {
return grid_->y( j ); }
95 inline double dx(
idx_t j )
const {
return grid_->dx( j ); }
98 inline double xmin(
idx_t j )
const {
return grid_->xmin( j ); }
102 void xy(
idx_t i,
idx_t j,
double xy[] )
const { grid_->xy( i, j, xy ); }
105 void lonlat(
idx_t i,
idx_t j,
double lonlat[] )
const { grid_->lonlat( i, j, lonlat ); }
111 inline bool reduced()
const {
return grid_->reduced(); }
113 inline bool regular()
const {
return not reduced(); }
115 bool periodic()
const {
return grid_->periodic(); }
117 const XSpace& xspace()
const {
return grid_->xspace(); }
119 const YSpace& yspace()
const {
return grid_->yspace(); }
123 void index2ij(
gidx_t gidx,
idx_t& i,
idx_t& j )
const { grid_->index2ij( gidx, i, j ); }
135 using StructuredGrid::StructuredGrid;
137 operator bool()
const {
return valid(); }
139 bool valid()
const {
return StructuredGrid::valid() && reduced(); }
148 using StructuredGrid::StructuredGrid;
150 using StructuredGrid::xy;
152 operator bool()
const {
return valid(); }
154 bool valid()
const {
return StructuredGrid::valid() && regular(); }
156 idx_t nx()
const {
return nxmax(); }
158 inline double x(
idx_t i )
const {
return x( i, 0 ); }
165 template <
class Gr
id>
170 idx_t N()
const {
return Grid::ny() / 2; }
173 bool gaussian()
const {
return Grid::domain().global() && Grid::yspace().type() ==
"gaussian"; }
184 using grid_t::grid_t;
186 operator bool()
const {
return valid(); }
188 bool valid()
const {
return StructuredGrid::valid() && gaussian(); }
199 using grid_t::grid_t;
206 operator bool()
const {
return valid(); }
208 bool valid()
const {
return ReducedGrid::valid() && gaussian(); }
219 using grid_t::grid_t;
222 operator bool()
const {
return valid(); }
224 bool valid()
const {
return RegularGrid::valid() && gaussian(); }
233 using RegularGrid::RegularGrid;
236 operator bool()
const {
return valid(); }
238 bool valid()
const {
return RegularGrid::valid() && global_lonlat(); }
240 inline double lon(
idx_t i )
const {
return x( i ); }
242 inline double lat(
idx_t j )
const {
return y( j ); }
246 bool standard()
const {
return standard_lon() && standard_lat(); }
247 bool shifted()
const {
return shifted_lon() && shifted_lat(); }
248 bool shiftedLon()
const {
return shifted_lon() && standard_lat(); }
249 bool shiftedLat()
const {
return standard_lon() && shifted_lat(); }
252 bool global_lonlat()
const {
return domain().global() && not projection() && yspace().type() ==
"linear"; }
254 bool standard_lon()
const {
return x( 0 ) == 0.; }
256 bool standard_lat()
const {
return y( 0 ) == 90. && ny() % 2 == 1; }
258 bool shifted_lon()
const {
return x( 0 ) == 0.5 * 360. / nx(); }
260 bool shifted_lat()
const {
return y( 0 ) == 90. - 0.5 * 180. / ny() && ny() % 2 == 0; }
275 bool valid() {
return grid_; }
double xmin(idx_t j) const
x coordinate of beginning of a given grid row {j}
Definition: StructuredGrid.h:98
Specialization of RegularGaussianGrid, where rows follow a Gaussian distribution. ...
Definition: StructuredGrid.h:215
Specialization of RegularGrid, assuming a global domain.
Definition: StructuredGrid.h:231
Structured Grid.
Definition: Structured.h:39
Specialization of StructuredGrid, where rows follow a Gaussian distribution.
Definition: StructuredGrid.h:180
Definition: StructuredGrid.h:166
Specialization of StructuredGrid, where not all rows have the same number of grid points...
Definition: StructuredGrid.h:133
Specialization of ReducedGrid, where rows follow a Gaussian distribution.
Definition: StructuredGrid.h:195
double y(idx_t j) const
y coordinate for given grid row {j}
Definition: StructuredGrid.h:92
Point in longitude-latitude coordinate system.
Definition: Point.h:103
Definition: Projection.h:49
Specialization of StructuredGrid, where all rows have the same number of grid points.
Definition: StructuredGrid.h:146
Most general grid container.
Definition: Grid.h:64
long gidx_t
Integer type for global indices.
Definition: config.h:34
double x(idx_t i, idx_t j) const
x coordinate for given grid point {i,j}
Definition: StructuredGrid.h:89
double dx(idx_t j) const
increment in x for a given grid row {j}
Definition: StructuredGrid.h:95
Definition: Structured.h:154
Specialization of Grid, where the grid can be represented by rows with uniform distribution.
Definition: StructuredGrid.h:58
Point in arbitrary XY-coordinate system.
Definition: Point.h:40
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
long idx_t
Integer type for indices in connectivity tables.
Definition: config.h:42
Specialization of StructuredGrid, assuming a global domain.
Definition: StructuredGrid.h:267
Configuration class used to construct various atlas components.
Definition: Config.h:27