14 TopoLayers(
const std::string & outdir,
const size_t length,
15 const size_t width,
const size_t linesPerBlock,
16 const bool computeMask);
18 TopoLayers(
const size_t linesPerBlock,
33 if (_haveOwnRasters) {
39 delete _localIncRaster;
40 delete _localPsiRaster;
42 delete _groundToSatEastRaster;
43 delete _groundToSatNorthRaster;
51 void setBlockSize(
size_t length,
size_t width);
54 inline size_t length()
const {
return _length; }
55 inline size_t width()
const {
return _width; }
58 std::valarray<double> & x() {
return _x; }
59 std::valarray<double> & y() {
return _y; }
60 std::valarray<double> & z() {
return _z; }
61 std::valarray<float> & inc() {
return _inc; }
62 std::valarray<float> & hdg() {
return _hdg; }
63 std::valarray<float> & localInc() {
return _localInc; }
64 std::valarray<float> & localPsi() {
return _localPsi; }
65 std::valarray<float> & sim() {
return _sim; }
66 std::valarray<short> & mask() {
return _mask; }
67 std::valarray<double> & crossTrack() {
return _crossTrack; }
68 std::valarray<float> & groundToSatEast() {
return _groundToSatEast; }
69 std::valarray<float> & groundToSatNorth() {
return _groundToSatNorth; }
71 inline bool hasXRaster()
const {
return _xRaster !=
nullptr; }
72 inline bool hasYRaster()
const {
return _yRaster !=
nullptr; }
73 inline bool hasZRaster()
const {
return _zRaster !=
nullptr; }
74 inline bool hasIncRaster()
const {
return _incRaster !=
nullptr; }
75 inline bool hasHdgRaster()
const {
return _hdgRaster !=
nullptr; }
76 inline bool hasLocalIncRaster()
const {
return _localIncRaster !=
nullptr; }
77 inline bool hasLocalPsiRaster()
const {
return _localPsiRaster !=
nullptr; }
78 inline bool hasSimRaster()
const {
return _simRaster !=
nullptr; }
79 inline bool hasMaskRaster()
const {
return _maskRaster !=
nullptr; }
80 inline bool hasGroundToSatEastRaster()
const {
81 return _groundToSatEastRaster !=
nullptr; }
82 inline bool hasGroundToSatNorthRaster()
const {
83 return _groundToSatNorthRaster !=
nullptr; }
89 inline void x(
size_t row,
size_t col,
double value) {
93 _x[row*_width+col] = value;
96 inline void y(
size_t row,
size_t col,
double value) {
100 _y[row*_width + col] = value;
103 inline void z(
size_t row,
size_t col,
double value) {
104 if (_z.size() == 0) {
107 _z[row*_width + col] = value;
110 inline void inc(
size_t row,
size_t col,
float value) {
111 if (_inc.size() == 0) {
114 _inc[row*_width + col] = value;
117 inline void hdg(
size_t row,
size_t col,
float value) {
118 if (_hdg.size() == 0) {
121 _hdg[row*_width + col] = value;
124 inline void localInc(
size_t row,
size_t col,
float value) {
125 if (_localInc.size() == 0) {
128 _localInc[row*_width + col] = value;
131 inline void localPsi(
size_t row,
size_t col,
float value) {
132 if (_localPsi.size() == 0) {
135 _localPsi[row*_width + col] = value;
138 inline void sim(
size_t row,
size_t col,
float value) {
139 if (_sim.size() == 0) {
142 _sim[row*_width + col] = value;
145 inline void mask(
size_t row,
size_t col,
short value) {
146 if (_mask.size() == 0) {
149 _mask[row*_width + col] = value;
152 inline void crossTrack(
size_t row,
size_t col,
double value) {
153 if (_crossTrack.size() == 0) {
156 _crossTrack[row*_width + col] = value;
159 inline void groundToSatEast(
size_t row,
size_t col,
float value) {
160 if (hasGroundToSatEastRaster()) {
161 _groundToSatEast[row*_width + col] = value;
165 inline void groundToSatNorth(
size_t row,
size_t col,
float value) {
166 if (hasGroundToSatNorthRaster()) {
167 _groundToSatNorth[row*_width + col] = value;
172 double x(
size_t row,
size_t col)
const {
173 if (_x.size() == 0 || row > _length - 1 || col > _width - 1) {
174 return std::numeric_limits<double>::quiet_NaN();
176 return _x[row*_width+col];
179 double y(
size_t row,
size_t col)
const {
180 if (_y.size() == 0 || row > _length - 1 || col > _width - 1) {
181 return std::numeric_limits<double>::quiet_NaN();
183 return _y[row*_width + col];
186 double z(
size_t row,
size_t col)
const {
187 if (_z.size() == 0 || row > _length - 1 || col > _width - 1) {
188 return std::numeric_limits<double>::quiet_NaN();
190 return _z[row*_width + col];
193 float inc(
size_t row,
size_t col)
const {
194 if (_inc.size() == 0 || row > _length - 1 || col > _width - 1) {
195 return std::numeric_limits<float>::quiet_NaN();
197 return _inc[row*_width + col];
200 float hdg(
size_t row,
size_t col)
const {
201 if (_hdg.size() == 0 || row > _length - 1 || col > _width - 1) {
202 return std::numeric_limits<float>::quiet_NaN();
204 return _hdg[row*_width + col];
207 float localInc(
size_t row,
size_t col)
const {
208 if (_localInc.size() == 0 || row > _length - 1 || col > _width - 1) {
209 return std::numeric_limits<float>::quiet_NaN();
211 return _localInc[row*_width + col];
214 float localPsi(
size_t row,
size_t col)
const {
215 if (_localPsi.size() == 0 || row > _length - 1 || col > _width - 1) {
216 return std::numeric_limits<float>::quiet_NaN();
218 return _localPsi[row*_width + col];
221 float sim(
size_t row,
size_t col)
const {
222 if (_sim.size() == 0 || row > _length - 1 || col > _width - 1) {
223 return std::numeric_limits<float>::quiet_NaN();
225 return _sim[row*_width + col];
228 short mask(
size_t row,
size_t col)
const {
229 if (_mask.size() == 0 || row > _length - 1 || col > _width - 1) {
232 return _mask[row*_width + col];
235 double crossTrack(
size_t row,
size_t col)
const {
236 if (_crossTrack.size() == 0 || row > _length - 1 || col > _width - 1) {
237 return std::numeric_limits<double>::quiet_NaN();
239 return _crossTrack[row*_width + col];
242 float groundToSatEast(
size_t row,
size_t col)
const {
243 if (!hasGroundToSatEastRaster() || row > _length - 1 || col > _width -1) {
244 return std::numeric_limits<float>::quiet_NaN();
246 return _groundToSatEast[row*_width + col];
249 float groundToSatNorth(
size_t row,
size_t col)
const {
250 if (!hasGroundToSatNorthRaster() || row > _length - 1 || col > _width -1) {
251 return std::numeric_limits<float>::quiet_NaN();
253 return _groundToSatNorth[row*_width + col];
257 void writeData(
size_t xidx,
size_t yidx);
261 std::valarray<double> _x;
262 std::valarray<double> _y;
263 std::valarray<double> _z;
264 std::valarray<float> _inc;
265 std::valarray<float> _hdg;
266 std::valarray<float> _localInc;
267 std::valarray<float> _localPsi;
268 std::valarray<float> _sim;
269 std::valarray<short> _mask;
270 std::valarray<double> _crossTrack;
271 std::valarray<float> _groundToSatEast;
272 std::valarray<float> _groundToSatNorth;
288 size_t _length, _width;
291 std::string _topodir;
297 bool _haveOwnRasters;