isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Topo.h
1 //-*- C++ -*-
2 //-*- coding: utf-8 -*-
3 //
4 // Author: Bryan Riel, Joshua Cohen
5 // Copyright 2017-2018
6 
7 #pragma once
8 
9 #include "forward.h"
10 
11 #include <isce3/core/forward.h>
12 #include <isce3/core/Ellipsoid.h>
13 #include <isce3/core/LUT2d.h>
14 #include <isce3/core/Orbit.h>
15 
16 // isce3::io
17 #include <isce3/io/forward.h>
18 
19 // isce3::product
20 #include <isce3/product/forward.h>
21 #include <isce3/product/RadarGridParameters.h>
22 
23 // isce3::geometry
24 #include "geometry.h"
25 
34 public:
35 
44  char frequency = 'A',
45  bool nativeDoppler = false);
46 
56  Topo(const isce3::product::RadarGridParameters & radarGrid,
57  const isce3::core::Orbit & orbit,
59  const isce3::core::LUT2d<double> & doppler = {});
60 
72  Topo(const isce3::core::Ellipsoid & ellipsoid,
73  const isce3::core::Orbit & orbit,
75  const isce3::core::Metadata & meta);
76 
82  void threshold(double t) { _threshold = t; }
83 
92  void numiter(int n) { _numiter = n; }
93 
105  void extraiter(int n) { _extraiter = n; }
106 
113 
122  void epsgOut(int epsgcode);
123 
129  void computeMask(bool mask) { _computeMask = mask; }
130 
136  void minimumHeight(double minh) { _minH = minh; }
137 
143  void maximumHeight(double maxh) { _maxH = maxh; }
144 
150  void decimaldegMargin(double deg) { _margin = deg; }
151 
152  // Get topo processing options
153 
155  isce3::core::LookSide lookSide() const { return _lookSide; }
156 
158  double threshold() const { return _threshold; }
159 
161  int numiter() const { return _numiter; }
162 
164  int extraiter() const { return _extraiter; }
165 
167  int epsgOut() const { return _epsgOut; }
168 
170  isce3::core::dataInterpMethod demMethod() const { return _demMethod; }
171 
173  bool computeMask() const { return _computeMask; }
174 
176  double minimumHeight() const { return _minH; }
177 
179  double maximumHeight() const { return _maxH; }
180 
182  double decimaldegMargin() const { return _margin; }
183 
185  const isce3::product::RadarGridParameters & radarGridParameters() const { return _radarGrid; }
186 
187  // Get DEM bounds using first/last azimuth line and slant range bin
188  void computeDEMBounds(isce3::io::Raster &, DEMInterpolator &, size_t, size_t);
189 
208  void topo(isce3::io::Raster& demRaster, const std::string& outdir);
209 
216  void topo(isce3::io::Raster & demRaster, TopoLayers & layers);
217 
232  void topo(isce3::io::Raster& demRaster, isce3::io::Raster& xRaster,
233  isce3::io::Raster& yRaster, isce3::io::Raster& heightRaster,
234  isce3::io::Raster& incRaster, isce3::io::Raster& hdgRaster,
235  isce3::io::Raster& localIncRaster,
236  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster,
237  isce3::io::Raster& maskRaster);
238 
252  void topo(isce3::io::Raster& demRaster, isce3::io::Raster& xRaster,
253  isce3::io::Raster& yRaster, isce3::io::Raster& heightRaster,
254  isce3::io::Raster& incRaster, isce3::io::Raster& hdgRaster,
255  isce3::io::Raster& localIncRaster,
256  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster);
257 
275  void topo(isce3::geometry::DEMInterpolator& demInterp,
276  const std::string& outdir);
277 
284  void topo(isce3::geometry::DEMInterpolator& demInterp, TopoLayers& layers);
285 
306  void topo(isce3::geometry::DEMInterpolator& demInterp,
307  isce3::io::Raster& xRaster, isce3::io::Raster& yRaster,
308  isce3::io::Raster& heightRaster, isce3::io::Raster& incRaster,
309  isce3::io::Raster& hdgRaster, isce3::io::Raster& localIncRaster,
310  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster,
311  isce3::io::Raster& maskRaster);
312 
332  void topo(isce3::geometry::DEMInterpolator& demInterp,
333  isce3::io::Raster& xRaster, isce3::io::Raster& yRaster,
334  isce3::io::Raster& heightRaster, isce3::io::Raster& incRaster,
335  isce3::io::Raster& hdgRaster, isce3::io::Raster& localIncRaster,
336  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster);
337 
347  std::vector<isce3::core::Vec3>&);
348 
349  // Getters for isce objects
350 
352  inline const isce3::core::Orbit& orbit() const { return _orbit; }
354  inline const isce3::core::Ellipsoid& ellipsoid() const { return _ellipsoid; }
356  inline const isce3::core::LUT2d<double>& doppler() const { return _doppler; }
357 
358 private:
370  void _initAzimuthLine(size_t line, double&,
372  isce3::core::Basis& TCNbasis);
373 
389  void _setOutputTopoLayers(isce3::core::Vec3 &,
390  TopoLayers &,
391  size_t,
393  isce3::core::Vec3& pos,
394  isce3::core::Vec3& vel,
396  DEMInterpolator &);
397 
399  template<typename T> void _topo(T& dem, const std::string& outdir);
400 
402  template<typename T>
403  void _topo(T& dem, isce3::io::Raster& xRaster, isce3::io::Raster& yRaster,
404  isce3::io::Raster& heightRaster, isce3::io::Raster& incRaster,
405  isce3::io::Raster& hdgRaster, isce3::io::Raster& localIncRaster,
406  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster,
407  isce3::io::Raster& maskRaster);
408 
410  template<typename T>
411  void _topo(T& dem, isce3::io::Raster& xRaster, isce3::io::Raster& yRaster,
412  isce3::io::Raster& heightRaster, isce3::io::Raster& incRaster,
413  isce3::io::Raster& hdgRaster, isce3::io::Raster& localIncRaster,
414  isce3::io::Raster& localPsiRaster, isce3::io::Raster& simRaster);
415 
416  // isce3::core objects
417  isce3::core::Orbit _orbit;
418  isce3::core::Ellipsoid _ellipsoid;
420 
421  // RadarGridParameters
423 
424  // Optimization options
425  double _threshold = 1.0e-8; //Threshold for convergence of slant range
426  int _numiter = 25; //Number of primary iterations
427  int _extraiter = 10; //Number of secondary iterations
428  double _minH = isce3::core::GLOBAL_MIN_HEIGHT; //Lowest altitude in scene (global minimum default)
429  double _maxH = isce3::core::GLOBAL_MAX_HEIGHT; //Highest altitude in scene (global maximum default)
430  double _margin = 0.15; //Margin for bounding box in decimal degrees
431  size_t _linesPerBlock = 1000; //Block size for processing
432  bool _computeMask = true; //Flag for generating shadow-layover mask
433 
434  isce3::core::LookSide _lookSide;
435 
437 
438  // Output options and objects
439  int _epsgOut;
441 };
442 
443 // Get inline implementations for Topo
444 #define ISCE_GEOMETRY_TOPO_ICC
445 #include "Topo.icc"
446 #undef ISCE_GEOMETRY_TOPO_ICC
void decimaldegMargin(double deg)
Set margin in decimal degrees.
Definition: Topo.h:150
const isce3::core::LUT2d< double > & doppler() const
Get the doppler module used for processing.
Definition: Topo.h:356
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
Data structure to store Ellipsoid information.
Definition: Ellipsoid.h:20
Helper datastructure to handle slant range information for a pixel.
Definition: Pixel.h:13
double maximumHeight() const
Get maximum height.
Definition: Topo.h:179
Definition: DEMInterpolator.h:22
void minimumHeight(double minh)
Set minimum height.
Definition: Topo.h:136
LookSide
Side that radar looks at, Left or Right.
Definition: LookSide.h:13
Definition: RadarGridParameters.h:15
const isce3::product::RadarGridParameters & radarGridParameters() const
Get read-only reference to RadarGridParameters.
Definition: Topo.h:185
void numiter(int n)
Set number of primary iterations.
Definition: Topo.h:92
const isce3::core::Orbit & orbit() const
Get the orbits used for processing.
Definition: Topo.h:352
int epsgOut() const
Get the output coordinate system used for processing.
Definition: Topo.h:167
const double GLOBAL_MIN_HEIGHT
Global minimum height.
Definition: Constants.h:50
void setLayoverShadow(TopoLayers &, DEMInterpolator &, std::vector< isce3::core::Vec3 > &)
Compute layover/shadow masks.
Definition: Topo.cpp:757
Data structure for storing basic radar geometry image metadata.
Definition: Metadata.h:17
int extraiter() const
Get number of secondary iterations used for processing.
Definition: Topo.h:164
const double GLOBAL_MAX_HEIGHT
Global maximum height.
Definition: Constants.h:53
Abstract base class for individual projections.
Definition: Projections.h:22
isce3::core::LookSide lookSide() const
Get lookSide used for processing.
Definition: Topo.h:155
const isce3::core::Ellipsoid & ellipsoid() const
Get the ellipsoid used for processing.
Definition: Topo.h:354
void topo(isce3::io::Raster &demRaster, const std::string &outdir)
Main entry point for the module; internal creation of topo rasters.
Definition: Topo.cpp:400
bool computeMask() const
Get mask computation flag.
Definition: Topo.h:173
Topo(const isce3::product::Product &, char frequency= 'A', bool nativeDoppler=false)
Constructor using a product.
Definition: Topo.cpp:40
void computeMask(bool mask)
Set mask computation flag.
Definition: Topo.h:129
double minimumHeight() const
Get minimum height.
Definition: Topo.h:176
Definition: Product.h:29
void threshold(double t)
Set convergence threshold.
Definition: Topo.h:82
Definition: TopoLayers.h:15
void extraiter(int n)
Set number of secondary iterations.
Definition: Topo.h:105
Simple class to store three-dimensional basis vectors.
Definition: Basis.h:15
Collection of simple commonly used geometry functions.
void maximumHeight(double maxh)
Set maximum height.
Definition: Topo.h:143
isce3::core::dataInterpMethod demMethod() const
Get the DEM interpolation method used for processing.
Definition: Topo.h:170
Sequence of platform ephemeris samples (state vectors) with uniform temporal spacing, supporting efficient lookup and interpolation.
Definition: Orbit.h:43
double decimaldegMargin() const
Get margin in decimal degrees.
Definition: Topo.h:182
Data structure meant to handle Raster I/O operations.
Definition: Raster.h:34
int numiter() const
Get number of primary iterations used for processing.
Definition: Topo.h:161
double threshold() const
Get distance convergence threshold used for processing.
Definition: Topo.h:158
Transformer from radar geometry coordinates to map coordinates with DEM / reference altitude...
Definition: Topo.h:33

Generated for ISCE3.0 by doxygen 1.8.5.