14#include <pyre/journal.h>
17#include <isce3/core/forward.h>
18#include <isce3/io/forward.h>
20#include <isce3/core/Constants.h>
21#include <isce3/core/Interpolator.h>
22#include <isce3/error/ErrorCode.h>
27 using cartesian_t = isce3::core::Vec3;
39 _interpMethod{
isce3::core::BILINEAR_METHOD} {}
43 isce3::core::dataInterpMethod method,
52 _interpMethod{method} {}
63 double min_x,
double max_x,
double min_y,
double max_y,
64 const int dem_raster_band = 1);
71 const int dem_raster_band = 1);
96 double xStart()
const {
return _xstart; }
98 void xStart(
double xstart) { _xstart = xstart; }
101 double yStart()
const {
return _ystart; }
103 void yStart(
double ystart) { _ystart = ystart; }
106 double deltaX()
const {
return _deltax; }
108 void deltaX(
double deltax) { _deltax = deltax; }
111 double deltaY()
const {
return _deltay; }
113 void deltaY(
double deltay) { _deltay = deltay; }
116 double midX()
const {
return _xstart + 0.5*
width()*_deltax; }
118 double midY()
const {
return _ystart + 0.5*
length()*_deltay; }
142 validateStatsAccess(
"meanHeight");
148 validateStatsAccess(
"maxHeight");
154 validateStatsAccess(
"minHeight");
159 float *
data() {
return _dem.data(); }
162 const float*
data()
const {
return _dem.data(); }
165 inline size_t width()
const {
return (_haveRaster ? _dem.width() : _width); }
170 inline size_t length()
const {
return (_haveRaster ? _dem.length() : _length); }
184 return _interpMethod;
203 std::shared_ptr<isce3::core::ProjectionBase> _proj;
205 isce3::core::dataInterpMethod _interpMethod;
206 std::shared_ptr<isce3::core::Interpolator<float>> _interp;
210 double _xstart, _ystart, _deltax, _deltay;
214 void validateStatsAccess(
const std::string& method)
const;
Data structure for a 2D row-major matrix.
Definition Matrix.h:23
Abstract base class for individual projections.
Definition Projections.h:21
Definition DEMInterpolator.h:25
isce3::core::dataInterpMethod interpMethod() const
Get interpolator method enum.
Definition DEMInterpolator.h:183
double refHeight() const
Get reference height of interpolator.
Definition DEMInterpolator.h:126
int epsgCode() const
Get EPSG code for input DEM.
Definition DEMInterpolator.h:175
void yStart(double ystart)
Set starting Y coordinate.
Definition DEMInterpolator.h:103
const float * data() const
Get pointer to underlying DEM data.
Definition DEMInterpolator.h:162
double deltaY() const
Get Y spacing.
Definition DEMInterpolator.h:111
void deltaX(double deltax)
Set X spacing.
Definition DEMInterpolator.h:108
float * data()
Get pointer to underlying DEM data.
Definition DEMInterpolator.h:159
bool haveRaster() const
Flag indicating whether a DEM raster has been loaded.
Definition DEMInterpolator.h:123
double yStart() const
Get starting Y coordinate.
Definition DEMInterpolator.h:101
float minHeight() const
Get min height value.
Definition DEMInterpolator.h:153
void deltaY(double deltay)
Set Y spacing.
Definition DEMInterpolator.h:113
void computeMinMaxMeanHeight(float &minValue, float &maxValue, float &meanValue)
Compute min, max, and mean DEM height.
Definition DEMInterpolator.cpp:515
double xStart() const
Get starting X coordinate.
Definition DEMInterpolator.h:96
float meanHeight() const
Get mean height value.
Definition DEMInterpolator.h:141
DEMInterpolator(float height=0.0, int epsg=4326)
Constructor with custom reference height and bilinear interpolation.
Definition DEMInterpolator.h:31
void interpMethod(isce3::core::dataInterpMethod interpMethod)
Set interpolator method enum.
Definition DEMInterpolator.h:187
void refHeight(double h)
Set reference height of interpolator.
Definition DEMInterpolator.h:128
double deltaX() const
Get X spacing.
Definition DEMInterpolator.h:106
isce3::core::ProjectionBase * proj() const
Get Pointer to a ProjectionBase.
Definition DEMInterpolator.h:180
isce3::error::ErrorCode loadDEM(isce3::io::Raster &demRaster, double min_x, double max_x, double min_y, double max_y, const int dem_raster_band=1)
Read in subset of data from a DEM with a supported projection.
Definition DEMInterpolator.cpp:29
cartesian_t midLonLat() const
Get mid longitude and latitude.
Definition DEMInterpolator.cpp:580
float maxHeight() const
Get max height value.
Definition DEMInterpolator.h:147
double midY() const
Get mid Y coordinate.
Definition DEMInterpolator.h:118
double midX() const
Get mid X coordinate.
Definition DEMInterpolator.h:116
bool haveStats() const
Flag indicating if stats are already known.
Definition DEMInterpolator.h:138
size_t width() const
Get width of DEM data used for interpolation.
Definition DEMInterpolator.h:165
double interpolateLonLat(double lon, double lat) const
Interpolate at a given longitude and latitude.
Definition DEMInterpolator.cpp:593
size_t length() const
Get length of DEM data used for interpolation.
Definition DEMInterpolator.h:170
void length(int length)
Set length of DEM data used for interpolation.
Definition DEMInterpolator.h:172
double interpolateXY(double x, double y) const
Interpolate at native XY coordinates of DEM.
Definition DEMInterpolator.cpp:618
void xStart(double xstart)
Set starting X coordinate.
Definition DEMInterpolator.h:98
DEMInterpolator(float height, isce3::core::dataInterpMethod method, int epsg=4326)
Constructor with custom reference height and custom interpolator method.
Definition DEMInterpolator.h:42
void width(int width)
Set width of DEM data used for interpolation.
Definition DEMInterpolator.h:167
Data structure meant to handle Raster I/O operations.
Definition Raster.h:32
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5