isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
RTC.h
1 #pragma once
2 
3 #include "forward.h"
4 
5 #include <limits>
6 
7 #include <isce3/core/forward.h>
8 #include <isce3/io/forward.h>
9 #include <isce3/product/forward.h>
10 
11 #include <isce3/core/Constants.h>
12 #include <pyre/journal.h>
13 
14 namespace isce3 { namespace geometry {
15 
20  BETA_NAUGHT = 0,
21  SIGMA_NAUGHT_ELLIPSOID = 1,
22 };
23 
26  RTC_AUTO = 0,
27  RTC_SINGLE_BLOCK = 1,
28  RTC_BLOCKS_GEOGRID = 2,
29 };
30 
32 enum rtcAreaMode { AREA = 0, AREA_FACTOR = 1 };
33 
36 enum rtcAlgorithm { RTC_DAVID_SMALL = 0, RTC_AREA_PROJECTION = 1 };
37 
66 void applyRTC(
67  const isce3::product::RadarGridParameters& radarGrid,
68  const isce3::core::Orbit& orbit, const isce3::core::LUT2d<double>& dop,
69  isce3::io::Raster& input_raster, isce3::io::Raster& dem_raster,
70  isce3::io::Raster& output_raster,
71  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
72  int exponent = 0, rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
73  rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
74  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
75  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
76  double abs_cal_factor = 1, float radar_grid_nlooks = 1,
77  isce3::io::Raster* out_nlooks = nullptr,
78  isce3::io::Raster* input_rtc = nullptr,
79  isce3::io::Raster* output_rtc = nullptr,
80  rtcMemoryMode rtc_memory_mode = rtcMemoryMode::RTC_AUTO);
81 
102 void facetRTC(
103  isce3::product::Product& product, isce3::io::Raster& dem_raster,
104  isce3::io::Raster& output_raster, char frequency = 'A',
105  bool native_doppler = false,
106  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
107  rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
108  rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
109  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
110  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
111  size_t nlooks_az = 1, size_t nlooks_rg = 1,
112  isce3::io::Raster* out_nlooks = nullptr,
113  rtcMemoryMode rtc_memory_mode = rtcMemoryMode::RTC_AUTO);
114 
139 void facetRTC(
140  const isce3::product::RadarGridParameters& radarGrid,
141  const isce3::core::Orbit& orbit, const isce3::core::LUT2d<double>& dop,
142  isce3::io::Raster& dem, isce3::io::Raster& output_raster,
143  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
144  rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
145  rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
146  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
147  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
148  float radar_grid_nlooks = 1,
149  isce3::io::Raster* out_nlooks = nullptr,
150  rtcMemoryMode rtc_memory_mode = rtcMemoryMode::RTC_AUTO,
151  isce3::core::dataInterpMethod interp_method =
152  isce3::core::dataInterpMethod::BIQUINTIC_METHOD,
153  double threshold = 1e-4, int num_iter = 100, double delta_range = 1e-4);
154 
193 void facetRTC(
194  isce3::io::Raster& dem_raster, isce3::io::Raster& output_raster,
195  const isce3::product::RadarGridParameters& radarGrid,
196  const isce3::core::Orbit& orbit, const isce3::core::LUT2d<double>& dop,
197  const double y0, const double dy, const double x0, const double dx,
198  const int geogrid_length, const int geogrid_width,
199  const int epsg,
200  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
201  rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
202  rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
203  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
204  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
205  float radar_grid_nlooks = 1,
206  isce3::io::Raster* out_geo_vertices = nullptr,
207  isce3::io::Raster* out_geo_grid = nullptr,
208  isce3::io::Raster* out_nlooks = nullptr,
209  rtcMemoryMode rtc_memory_mode = rtcMemoryMode::RTC_AUTO,
210  isce3::core::dataInterpMethod interp_method =
211  isce3::core::dataInterpMethod::BIQUINTIC_METHOD,
212  double threshold = 1e-4, int num_iter = 100, double delta_range = 1e-4);
213 
235 void facetRTCDavidSmall(
236  isce3::io::Raster& dem_raster, isce3::io::Raster& output_raster,
237  const isce3::product::RadarGridParameters& radarGrid,
238  const isce3::core::Orbit& orbit, const isce3::core::LUT2d<double>& dop,
239  const double y0, const double dy, const double x0, const double dx,
240  const int geogrid_length, const int geogrid_width,
241  const int epsg,
242  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
243  rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
244  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN());
245 
287 void facetRTCAreaProj(
288  isce3::io::Raster& dem, isce3::io::Raster& output_raster,
289  const isce3::product::RadarGridParameters& radarGrid,
290  const isce3::core::Orbit& orbit, const isce3::core::LUT2d<double>& dop,
291  const double y0, const double dy, const double x0, const double dx,
292  const int geogrid_length, const int geogrid_width,
293  const int epsg,
294  rtcInputRadiometry inputRadiometry = rtcInputRadiometry::BETA_NAUGHT,
295  rtcAreaMode rtc_area_mode = rtcAreaMode::AREA_FACTOR,
296  double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
297  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
298  float radar_grid_nlooks = 1,
299  isce3::io::Raster* out_geo_vertices = nullptr,
300  isce3::io::Raster* out_geo_grid = nullptr,
301  isce3::io::Raster* out_nlooks = nullptr,
302  rtcMemoryMode rtc_memory_mode = rtcMemoryMode::RTC_AUTO,
303  isce3::core::dataInterpMethod interp_method =
304  isce3::core::dataInterpMethod::BIQUINTIC_METHOD,
305  double threshold = 1e-4, int num_iter = 100, double delta_range = 1e-4);
306 
307 void areaProjIntegrateSegment(double y1, double y2, double x1, double x2,
308  int length, int width,
310  double& w_total, int plane_orientation);
311 
312 int areaProjGetNBlocks(int array_length,
313  pyre::journal::info_t* channel = nullptr,
314  int upsampling = 0,
315  int* block_length_with_upsampling = nullptr,
316  int* block_length = nullptr,
317  int min_block_length = std::pow(2, 8), // 256
318  int max_block_length = std::pow(2, 10)); // 1024
319 
320 double
321 computeUpsamplingFactor(const DEMInterpolator& dem_interp,
322  const isce3::product::RadarGridParameters& radar_grid,
323  const isce3::core::Ellipsoid& ellps);
324 
325 double computeFacet(isce3::core::Vec3 xyz_center, isce3::core::Vec3 xyz_left,
326  isce3::core::Vec3 xyz_right, isce3::core::Vec3 lookXYZ,
327  double p1, double& p3, double divisor,
328  bool clockwise_direction);
329 
330 std::string get_input_radiometry_str(rtcInputRadiometry input_radiometry);
331 std::string get_rtc_area_mode_str(rtcAreaMode rtc_area_mode);
332 std::string get_rtc_algorithm_str(rtcAlgorithm rtc_algorithm);
333 
334 void print_parameters(
335  pyre::journal::info_t& channel,
336  const isce3::product::RadarGridParameters& radar_grid, const double y0,
337  const double dy, const double x0, const double dx,
338  const int geogrid_length, const int geogrid_width,
339  rtcInputRadiometry input_radiometry, rtcAreaMode rtc_area_mode,
340  double geogrid_upsampling,
341  float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN());
342 } // namespace geometry
343 } // namespace isce3
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
Data structure to store Ellipsoid information.
Definition: Ellipsoid.h:20
void facetRTC(isce3::product::Product &product, isce3::io::Raster &dem_raster, isce3::io::Raster &output_raster, char frequency, bool native_doppler, rtcInputRadiometry input_radiometry, rtcAreaMode rtc_area_mode, rtcAlgorithm rtc_algorithm, double geogrid_upsampling, float rtc_min_value_db, size_t nlooks_az, size_t nlooks_rg, isce3::io::Raster *out_nlooks, rtcMemoryMode rtc_memory_mode)
Generate radiometric terrain correction (RTC) area or area factor.
Definition: RTC.cpp:339
std::string get_rtc_area_mode_str(rtcAreaMode rtc_area_mode)
Convert enum output_mode to string.
Definition: RTC.cpp:1401
Definition: RadarGridParameters.h:15
void applyRTC(const isce3::product::RadarGridParameters &radar_grid, const isce3::core::Orbit &orbit, const isce3::core::LUT2d< double > &input_dop, isce3::io::Raster &input_raster, isce3::io::Raster &dem_raster, isce3::io::Raster &output_raster, rtcInputRadiometry input_radiometry, int exponent, rtcAreaMode rtc_area_mode, rtcAlgorithm rtc_algorithm, double geogrid_upsampling, float rtc_min_value_db, double abs_cal_factor, float radar_grid_nlooks, isce3::io::Raster *out_nlooks, isce3::io::Raster *input_rtc, isce3::io::Raster *output_rtc, rtcMemoryMode rtc_memory_mode)
Apply radiometric terrain correction (RTC) over an input raster.
Definition: RTC.cpp:165
rtcMemoryMode
Enumeration type to indicate memory management.
Definition: RTC.h:25
rtcAlgorithm
Enumeration type to select RTC algorithm (RTC_DAVID_SMALL or RTC_AREA_PROJECTION) ...
Definition: RTC.h:36
rtcAreaMode
Enumeration type to indicate RTC area mode (AREA or AREA_FACTOR)
Definition: RTC.h:32
void facetRTCAreaProj(isce3::io::Raster &dem_raster, isce3::io::Raster &output_raster, const isce3::product::RadarGridParameters &radar_grid, const isce3::core::Orbit &orbit, const isce3::core::LUT2d< double > &input_dop, const double y0, const double dy, const double x0, const double dx, const int geogrid_length, const int geogrid_width, const int epsg, rtcInputRadiometry input_radiometry, rtcAreaMode rtc_area_mode, double geogrid_upsampling, float rtc_min_value_db, float radar_grid_nlooks, isce3::io::Raster *out_geo_vertices, isce3::io::Raster *out_geo_grid, isce3::io::Raster *out_nlooks, rtcMemoryMode rtc_memory_mode, isce3::core::dataInterpMethod interp_method, double threshold, int num_iter, double delta_range)
Generate radiometric terrain correction (RTC) area or area factor using the area projection algorithm...
Definition: RTC.cpp:1249
std::string get_rtc_algorithm_str(rtcAlgorithm rtc_algorithm)
Convert enum output_mode to string.
Definition: RTC.cpp:1415
Definition: Product.h:29
std::string get_input_radiometry_str(rtcInputRadiometry input_radiometry)
Convert enum input_radiometry to string.
Definition: RTC.cpp:1383
Sequence of platform ephemeris samples (state vectors) with uniform temporal spacing, supporting efficient lookup and interpolation.
Definition: Orbit.h:43
rtcInputRadiometry
Enumeration type to indicate input terrain radiometry (for RTC)
Definition: RTC.h:19
Data structure meant to handle Raster I/O operations.
Definition: Raster.h:34
void facetRTCDavidSmall(isce3::io::Raster &dem_raster, isce3::io::Raster &output_raster, const isce3::product::RadarGridParameters &radar_grid, const isce3::core::Orbit &orbit, const isce3::core::LUT2d< double > &input_dop, const double y0, const double dy, const double x0, const double dx, const int geogrid_length, const int geogrid_width, const int epsg, rtcInputRadiometry input_radiometry, rtcAreaMode rtc_area_mode, double upsample_factor)
Generate radiometric terrain correction (RTC) area or area factor using the David Small algorithm...
Definition: RTC.cpp:582

Generated for ISCE3.0 by doxygen 1.8.5.