isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuDEMInterpolator.h
1 //
2 // Author: Bryan Riel
3 // Copyright 2018
4 //
5 
6 #pragma once
7 
8 #include "forward.h"
9 #include <isce3/geometry/forward.h>
10 #include <isce3/cuda/core/forward.h>
11 
12 #include <isce3/cuda/core/gpuProjections.h>
13 
14 // DEMInterpolator declaration
16 
17  typedef isce3::core::Vec3 Vec3;
18 
19  public:
21  CUDA_HOSTDEV inline gpuDEMInterpolator() :
22  _haveRaster(false), _refHeight(0.0), _interpMethod(isce3::core::BILINEAR_METHOD),
23  _xstart(0.0), _ystart(0.0), _deltax(1.0), _deltay(1.0), _owner(false) {}
24 
26  CUDA_HOSTDEV inline gpuDEMInterpolator(float height) :
27  _haveRaster(false), _refHeight(height), _interpMethod(isce3::core::BILINEAR_METHOD),
28  _xstart(0.0), _ystart(0.0), _deltax(1.0), _deltay(1.0), _owner(false) {}
29 
32 
35 
37  CUDA_HOSTDEV gpuDEMInterpolator(gpuDEMInterpolator &);
38 
40  CUDA_DEV float interpolateLonLat(double lon, double lat) const;
41 
43  CUDA_DEV float interpolateXY(double x, double y) const;
44 
46  CUDA_DEV inline double midX() const { return _xstart + 0.5*_width*_deltax; }
47  CUDA_DEV inline double midY() const { return _ystart + 0.5*_length*_deltay; }
48 
50  CUDA_DEV Vec3 midLonLat() const;
51 
53  CUDA_HOSTDEV inline double xStart() const { return _xstart; }
54 
56  CUDA_HOSTDEV inline double yStart() const { return _ystart; }
57 
59  CUDA_HOSTDEV inline double deltaX() const { return _deltax; }
60 
62  CUDA_HOSTDEV inline double deltaY() const { return _deltay; }
63 
65  CUDA_HOSTDEV inline bool haveRaster() const { return _haveRaster; }
66 
68  CUDA_HOSTDEV inline float refHeight() const { return _refHeight; }
69 
71  CUDA_HOSTDEV inline size_t length() const { return _length; }
72 
74  CUDA_HOSTDEV inline size_t width() const { return _width; }
75 
77  CUDA_HOSTDEV inline int epsgCode() const { return _epsgcode; }
78 
80  CUDA_HOSTDEV inline isce3::core::dataInterpMethod interpMethod() const {
81  return _interpMethod;
82  }
83 
85  CUDA_HOSTDEV inline isce3::cuda::core::ProjectionBase ** proj() const {
86  return _proj;
87  }
88 
90  CUDA_HOSTDEV inline isce3::cuda::core::gpuInterpolator<float> ** interp() const {
91  return _interp;
92  }
93 
95  CUDA_HOST void initProjInterp();
96 
98  CUDA_HOST void finalizeProjInterp();
99 
100  // Make DEM pointer data public for now
101  float * _dem;
102 
103  private:
104  // Flag indicating whether we have access to a DEM raster
105  bool _haveRaster;
106  // Constant value if no raster is provided
107  float _refHeight;
108  // Pointers to ProjectionBase
109  int _epsgcode;
111  // Pointer to an Interpolator
112  isce3::core::dataInterpMethod _interpMethod;
115  //isce3::core::Matrix<float> _dem;
116  // DEM dimensions
117  size_t _length, _width;
118  // Starting x/y for DEM subset and spacing
119  double _xstart, _ystart, _deltax, _deltay;
120  // Boolean for owning memory
121  bool _owner;
122 };
CUDA_HOSTDEV int epsgCode() const
EPSG code.
Definition: gpuDEMInterpolator.h:77
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
CUDA_HOSTDEV double deltaX() const
Get X spacing.
Definition: gpuDEMInterpolator.h:59
Definition: DEMInterpolator.h:22
Abstract base class for individual projections.
Definition: gpuProjections.h:23
CUDA_HOST void finalizeProjInterp()
Finalize/delete projection and interpolation objects on device.
CUDA_HOSTDEV size_t width() const
DEM width.
Definition: gpuDEMInterpolator.h:74
CUDA_HOSTDEV gpuDEMInterpolator()
Default constructor .
Definition: gpuDEMInterpolator.h:21
CUDA_DEV Vec3 midLonLat() const
Middle lat/lon/refHeight.
CUDA_DEV float interpolateLonLat(double lon, double lat) const
Interpolate at a given longitude and latitude.
Definition: gpuDEMInterpolator.h:15
CUDA_HOSTDEV isce3::core::dataInterpMethod interpMethod() const
Interpolator method.
Definition: gpuDEMInterpolator.h:80
CUDA_HOSTDEV size_t length() const
DEM length.
Definition: gpuDEMInterpolator.h:71
CUDA_HOSTDEV bool haveRaster() const
Flag indicating whether we have a raster.
Definition: gpuDEMInterpolator.h:65
CUDA_HOSTDEV gpuDEMInterpolator(float height)
Constructor with a constant height .
Definition: gpuDEMInterpolator.h:26
CUDA_DEV float interpolateXY(double x, double y) const
Interpolate at native XY coordinates of DEM.
CUDA_HOSTDEV isce3::cuda::core::gpuInterpolator< float > ** interp() const
Pointer to gpuInterpolator pointer.
Definition: gpuDEMInterpolator.h:90
CUDA_HOSTDEV double yStart() const
Get upper left Y.
Definition: gpuDEMInterpolator.h:56
CUDA_HOSTDEV isce3::cuda::core::ProjectionBase ** proj() const
Pointer to ProjectionBase pointer.
Definition: gpuDEMInterpolator.h:85
CUDA_HOSTDEV double xStart() const
Get upper left X.
Definition: gpuDEMInterpolator.h:53
CUDA_HOST void initProjInterp()
Initialize projection and interpolation objects on device.
CUDA_HOSTDEV float refHeight() const
Reference height.
Definition: gpuDEMInterpolator.h:68
CUDA_HOSTDEV double deltaY() const
Get Y spacing.
Definition: gpuDEMInterpolator.h:62
CUDA_DEV double midX() const
Middle X and Y coordinates.
Definition: gpuDEMInterpolator.h:46

Generated for ISCE3.0 by doxygen 1.8.5.