isce3 0.25.0
Loading...
Searching...
No Matches
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
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
94 // Make DEM pointer data public for now
95 float * _dem;
96
97 private:
98 // Flag indicating whether we have access to a DEM raster
99 bool _haveRaster;
100 // Constant value if no raster is provided
101 float _refHeight;
102 // Pointers to ProjectionBase
103 int _epsgcode;
105 // Pointer to an Interpolator
106 isce3::core::dataInterpMethod _interpMethod;
109 //isce3::core::Matrix<float> _dem;
110 // DEM dimensions
111 size_t _length, _width;
112 // Starting x/y for DEM subset and spacing
113 double _xstart, _ystart, _deltax, _deltay;
114 // Boolean for owning memory
115 bool _owner;
116
118 CUDA_HOST void initProjInterp();
119
121 CUDA_HOST void finalizeProjInterp();
122};
Definition gpuInterpolator.h:13
Definition gpuDEMInterpolator.h:15
CUDA_HOSTDEV double yStart() const
Get upper left Y.
Definition gpuDEMInterpolator.h:56
CUDA_DEV float interpolateLonLat(double lon, double lat) const
Interpolate at a given longitude and latitude.
Definition gpuDEMInterpolator.cu:152
CUDA_DEV Vec3 midLonLat() const
Middle lat/lon/refHeight.
Definition gpuDEMInterpolator.cu:137
CUDA_HOSTDEV double deltaY() const
Get Y spacing.
Definition gpuDEMInterpolator.h:62
CUDA_HOSTDEV double deltaX() const
Get X spacing.
Definition gpuDEMInterpolator.h:59
CUDA_HOSTDEV int epsgCode() const
EPSG code.
Definition gpuDEMInterpolator.h:77
CUDA_HOSTDEV size_t length() const
DEM length.
Definition gpuDEMInterpolator.h:71
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.
Definition gpuDEMInterpolator.cu:178
~gpuDEMInterpolator()
Destructor.
Definition gpuDEMInterpolator.cu:59
CUDA_HOSTDEV isce3::cuda::core::ProjectionBase ** proj() const
Pointer to ProjectionBase pointer.
Definition gpuDEMInterpolator.h:85
CUDA_HOSTDEV isce3::cuda::core::gpuInterpolator< float > ** interp() const
Pointer to gpuInterpolator pointer.
Definition gpuDEMInterpolator.h:90
CUDA_HOSTDEV size_t width() const
DEM width.
Definition gpuDEMInterpolator.h:74
CUDA_HOSTDEV float refHeight() const
Reference height.
Definition gpuDEMInterpolator.h:68
CUDA_HOSTDEV isce3::core::dataInterpMethod interpMethod() const
Interpolator method.
Definition gpuDEMInterpolator.h:80
CUDA_HOSTDEV double xStart() const
Get upper left X.
Definition gpuDEMInterpolator.h:53
CUDA_HOSTDEV bool haveRaster() const
Flag indicating whether we have a raster.
Definition gpuDEMInterpolator.h:65
CUDA_HOSTDEV gpuDEMInterpolator()
Default constructor .
Definition gpuDEMInterpolator.h:21
CUDA_DEV double midX() const
Middle X and Y coordinates.
Definition gpuDEMInterpolator.h:46
Definition DEMInterpolator.h:25
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5
Abstract base class for individual projections.
Definition gpuProjections.h:23

Generated for ISCE3.0 by doxygen 1.13.2.