10 #include <pyre/journal.h>
13 #include <isce3/core/Orbit.h>
14 #include <isce3/core/Ellipsoid.h>
15 #include <isce3/core/LUT2d.h>
16 #include <isce3/core/Constants.h>
19 #include <isce3/io/Raster.h>
22 #include <isce3/product/Product.h>
23 #include <isce3/product/RadarGridParameters.h>
26 #include <isce3/geometry/RTC.h>
37 AREA_PROJECTION_GAMMA_NAUGHT = 2
45 BLOCKS_GEOGRID_AND_RADARGRID = 3
48 template<
class T>
class Geocode {
96 isce3::geometry::geocodeOutputMode::INTERP,
97 double geogrid_upsampling = 1,
99 isce3::geometry::rtcInputRadiometry::BETA_NAUGHT,
101 float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
102 double rtc_geogrid_upsampling =
103 std::numeric_limits<double>::quiet_NaN(),
104 rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
105 double abs_cal_factor = 1,
106 float clip_min = std::numeric_limits<float>::quiet_NaN(),
107 float clip_max = std::numeric_limits<float>::quiet_NaN(),
108 float min_nlooks = std::numeric_limits<float>::quiet_NaN(),
109 float radar_grid_nlooks = 1,
118 isce3::core::dataInterpMethod::BIQUINTIC_METHOD);
127 template<
class T_out>
169 template<
class T_out>
175 isce3::geometry::geocodeOutputMode::AREA_PROJECTION,
176 double geogrid_upsampling = 1,
178 isce3::geometry::rtcInputRadiometry::BETA_NAUGHT,
179 float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
180 double rtc_geogrid_upsampling =
181 std::numeric_limits<double>::quiet_NaN(),
182 rtcAlgorithm rtc_algorithm = rtcAlgorithm::RTC_AREA_PROJECTION,
183 double abs_cal_factor = 1,
184 float clip_min = std::numeric_limits<float>::quiet_NaN(),
185 float clip_max = std::numeric_limits<float>::quiet_NaN(),
186 float min_nlooks = std::numeric_limits<float>::quiet_NaN(),
187 float radar_grid_nlooks = 1,
196 isce3::core::dataInterpMethod::BIQUINTIC_METHOD);
209 void geoGrid(
double geoGridStartX,
double geoGridStartY,
210 double geoGridSpacingX,
double geoGridSpacingY,
int width,
211 int length,
int epsgcode);
222 _interp_method = method;
231 void thresholdGeo2rdr(
double threshold) { _threshold = threshold; }
233 void numiterGeo2rdr(
int numiter) { _numiter = numiter; }
235 void linesPerBlock(
size_t linesPerBlock) { _linesPerBlock = linesPerBlock; }
237 void demBlockMargin(
double demBlockMargin) {
238 _demBlockMargin = demBlockMargin;
241 void radarBlockMargin(
int radarBlockMargin) {
242 _radarBlockMargin = radarBlockMargin;
246 double geoGridStartX()
const {
return _geoGridStartX; }
249 double geoGridStartY()
const {
return _geoGridStartY; }
252 double geoGridSpacingX()
const {
return _geoGridSpacingX; }
255 double geoGridSpacingY()
const {
return _geoGridSpacingY; }
258 int geoGridWidth()
const {
return _geoGridWidth; }
261 int geoGridLength()
const {
return _geoGridLength; }
264 void _GetRadarPositionVect(
265 double dem_y1,
const int k_start,
const int k_end,
266 double geogrid_upsampling,
double& a11,
double& r11,
double& a_min,
267 double& r_min,
double& a_max,
double& r_max,
268 std::vector<double>& a_last, std::vector<double>& r_last,
269 std::vector<Vec3>& dem_last,
272 bool flag_direction_line);
274 template<
class T_out>
277 bool is_radar_grid_single_block,
279 const int jmax,
int block_size,
int block_size_with_upsampling,
280 int block,
int& numdone,
int progress_block,
281 double geogrid_upsampling,
int nbands,
286 const double start,
const double pixazm,
const double dr,
287 double r0,
int xbound,
int ybound,
292 float rtc_min_value,
double abs_cal_factor,
float clip_min,
293 float clip_max,
float min_nlooks,
float radar_grid_nlooks,
294 pyre::journal::info_t& info);
298 int blockLength,
int blockWidth,
double demMargin);
300 std::string _get_nbytes_str(
long nbytes);
303 double x,
double y,
double& azimuthTime,
double& slantRange,
306 template<
class T_out>
310 std::valarray<double>& radarX, std::valarray<double>& radarY,
311 int rdrBlockWidth,
int rdrBlockLength,
int azimuthFirstLine,
321 size_t _linesPerBlock = 1000;
327 double _geoGridStartX = std::numeric_limits<double>::quiet_NaN();
330 double _geoGridStartY = std::numeric_limits<double>::quiet_NaN();
333 double _geoGridSpacingX = std::numeric_limits<double>::quiet_NaN();
336 double _geoGridSpacingY = std::numeric_limits<double>::quiet_NaN();
339 int _geoGridWidth = -32768;
342 int _geoGridLength = -32768;
348 double _demBlockMargin;
352 int _radarBlockMargin;
356 isce3::core::dataInterpMethod::BIQUINTIC_METHOD;
359 std::vector<float> getGeoAreaElementMean(
360 const std::vector<double>& x_vect,
const std::vector<double>& y_vect,
366 isce3::geometry::rtcInputRadiometry::BETA_NAUGHT,
369 isce3::geometry::geocodeOutputMode::AREA_PROJECTION,
370 double geogrid_upsampling = std::numeric_limits<double>::quiet_NaN(),
371 float rtc_min_value_db = std::numeric_limits<float>::quiet_NaN(),
372 double abs_cal_factor = 1,
float radar_grid_nlooks = 1,
373 float* out_nlooks =
nullptr,
375 isce3::core::dataInterpMethod::BIQUINTIC_METHOD,
376 double threshold = 1e-4,
int num_iter = 100,
double delta_range = 1e-4);
379 std::vector<float> _getGeoAreaElementMean(
380 const std::vector<double>& r_vect,
const std::vector<double>& a_vect,
385 isce3::geometry::geocodeOutputMode::AREA_PROJECTION,
386 float rtc_min_value = 0,
float* out_nlooks =
nullptr,
387 double abs_cal_factor = 1,
float radar_grid_nlooks = 1);
393 #define ISCE_GEOMETRY_GEOCODE_ICC
394 #include "Geocode.icc"
395 #undef ISCE_GEOMETRY_GEOCODE_ICC
geocodeMemoryMode
Enumeration type to indicate memory management.
Definition: Geocode.h:41
dataInterpMethod
Enumeration type to indicate interpolation method.
Definition: Constants.h:23
Data structure to store Ellipsoid information.
Definition: Ellipsoid.h:20
void geocodeInterp(const isce3::product::RadarGridParameters &radar_grid, isce3::io::Raster &input_raster, isce3::io::Raster &output_raster, isce3::io::Raster &demRaster)
Geocode using the interpolation algorithm.
Definition: Geocode.cpp:199
Definition: RadarGridParameters.h:15
void updateGeoGrid(const isce3::product::RadarGridParameters &radar_grid, isce3::io::Raster &dem_raster)
Update the output geogrid with radar grid and DEM attributes.
Definition: Geocode.cpp:71
Data structure for a 2D row-major matrix.
Definition: forward.h:31
rtcAlgorithm
Enumeration type to select RTC algorithm (RTC_DAVID_SMALL or RTC_AREA_PROJECTION) ...
Definition: RTC.h:36
void geocode(const isce3::product::RadarGridParameters &radar_grid, isce3::io::Raster &input_raster, isce3::io::Raster &output_raster, isce3::io::Raster &dem_raster, isce3::geometry::geocodeOutputMode output_mode=isce3::geometry::geocodeOutputMode::INTERP, double geogrid_upsampling=1, isce3::geometry::rtcInputRadiometry input_radiometry=isce3::geometry::rtcInputRadiometry::BETA_NAUGHT, int exponent=0, float rtc_min_value_db=std::numeric_limits< float >::quiet_NaN(), double rtc_geogrid_upsampling=std::numeric_limits< double >::quiet_NaN(), rtcAlgorithm rtc_algorithm=rtcAlgorithm::RTC_AREA_PROJECTION, double abs_cal_factor=1, float clip_min=std::numeric_limits< float >::quiet_NaN(), float clip_max=std::numeric_limits< float >::quiet_NaN(), float min_nlooks=std::numeric_limits< float >::quiet_NaN(), float radar_grid_nlooks=1, isce3::io::Raster *out_geo_vertices=nullptr, isce3::io::Raster *out_dem_vertices=nullptr, isce3::io::Raster *out_geo_nlooks=nullptr, isce3::io::Raster *out_geo_rtc=nullptr, isce3::io::Raster *input_rtc=nullptr, isce3::io::Raster *output_rtc=nullptr, geocodeMemoryMode geocode_memory_mode=geocodeMemoryMode::AUTO, isce3::core::dataInterpMethod interp_method=isce3::core::dataInterpMethod::BIQUINTIC_METHOD)
Geocode data from slant-range to map coordinates.
Definition: Geocode.cpp:131
Abstract base class for individual projections.
Definition: Projections.h:22
void geoGrid(double geoGridStartX, double geoGridStartY, double geoGridSpacingX, double geoGridSpacingY, int width, int length, int epsgcode)
Set the output geogrid.
Definition: Geocode.cpp:104
geocodeOutputMode
Enumeration type to indicate the algorithm used for geocoding.
Definition: Geocode.h:34
void geocodeAreaProj(const isce3::product::RadarGridParameters &radar_grid, isce3::io::Raster &input_raster, isce3::io::Raster &output_raster, isce3::io::Raster &dem_raster, isce3::geometry::geocodeOutputMode output_mode=isce3::geometry::geocodeOutputMode::AREA_PROJECTION, double geogrid_upsampling=1, isce3::geometry::rtcInputRadiometry input_radiometry=isce3::geometry::rtcInputRadiometry::BETA_NAUGHT, float rtc_min_value_db=std::numeric_limits< float >::quiet_NaN(), double rtc_geogrid_upsampling=std::numeric_limits< double >::quiet_NaN(), rtcAlgorithm rtc_algorithm=rtcAlgorithm::RTC_AREA_PROJECTION, double abs_cal_factor=1, float clip_min=std::numeric_limits< float >::quiet_NaN(), float clip_max=std::numeric_limits< float >::quiet_NaN(), float min_nlooks=std::numeric_limits< float >::quiet_NaN(), float radar_grid_nlooks=1, isce3::io::Raster *out_geo_vertices=nullptr, isce3::io::Raster *out_dem_vertices=nullptr, isce3::io::Raster *out_geo_nlooks=nullptr, isce3::io::Raster *out_geo_rtc=nullptr, isce3::io::Raster *input_rtc=nullptr, isce3::io::Raster *output_rtc=nullptr, geocodeMemoryMode geocode_memory_mode=geocodeMemoryMode::AUTO, isce3::core::dataInterpMethod interp_method=isce3::core::dataInterpMethod::BIQUINTIC_METHOD)
Geocode using the area projection algorithm (adaptive multilooking)
Definition: Geocode.cpp:556
Collection of simple commonly used geometry functions.
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
Definition of parent Interpolator.
Definition: forward.h:33