@@ -172,26 +172,35 @@ __global__ void interpolate(T* geo_data_block, const double* __restrict__ rdr_x,
172
172
geo_data_block[tid] = interp_val;
173
173
}
174
174
175
- __host__ Geocode::Geocode (const isce3::product::GeoGridParameters& geogrid,
176
- const isce3::container::RadarGeometry& rdr_geom,
177
- const Raster& dem_raster, const double dem_margin,
178
- const size_t lines_per_block,
179
- const isce3::core::dataInterpMethod data_interp_method,
180
- const isce3::core::dataInterpMethod dem_interp_method,
181
- const double threshold, const int maxiter, const double dr,
182
- const float invalid_value)
183
- : _geogrid(geogrid), _rdr_geom(rdr_geom),
184
- _ellipsoid(isce3::core::makeProjection(_geogrid.epsg())->ellipsoid()),
185
- _lines_per_block(lines_per_block), _geo_block_length(_lines_per_block),
186
- _n_blocks((geogrid.length() + _lines_per_block - 1) / _lines_per_block),
187
- _az_first_line(_rdr_geom.radarGrid().length() - 1), _az_last_line(0 ),
188
- _range_first_pixel(_rdr_geom.radarGrid().width() - 1),
189
- _range_last_pixel(0 ), _dem_raster(dem_raster), _dem_margin(dem_margin),
190
- _interp_float_handle(data_interp_method),
191
- _interp_cfloat_handle(data_interp_method),
192
- _interp_double_handle(data_interp_method),
193
- _interp_cdouble_handle(data_interp_method), _proj_handle(geogrid.epsg()),
194
- _dem_interp_method(dem_interp_method)
175
+ __host__
176
+ Geocode::Geocode (const isce3::product::GeoGridParameters & geogrid,
177
+ const isce3::container::RadarGeometry & rdr_geom,
178
+ const Raster & dem_raster,
179
+ const double dem_margin,
180
+ const size_t lines_per_block,
181
+ const isce3::core::dataInterpMethod data_interp_method,
182
+ const isce3::core::dataInterpMethod dem_interp_method,
183
+ const double threshold, const int maxiter,
184
+ const double dr, const float invalid_value) :
185
+ _geogrid (geogrid),
186
+ _rdr_geom (rdr_geom),
187
+ _ellipsoid (isce3::core::makeProjection(_geogrid.epsg())->ellipsoid ()),
188
+ _lines_per_block(lines_per_block),
189
+ _geo_block_length(_lines_per_block),
190
+ _n_blocks((geogrid.length() + _lines_per_block -1) / _lines_per_block),
191
+ _az_first_line(_rdr_geom.radarGrid().length() - 1),
192
+ _az_last_line(0 ),
193
+ _range_first_pixel(_rdr_geom.radarGrid().width() - 1),
194
+ _range_last_pixel(0 ),
195
+ _dem_raster(dem_raster),
196
+ _dem_margin(dem_margin),
197
+ _interp_float_handle(data_interp_method),
198
+ _interp_cfloat_handle(data_interp_method),
199
+ _interp_double_handle(data_interp_method),
200
+ _interp_cdouble_handle(data_interp_method),
201
+ _interp_unsigned_char_handle(data_interp_method),
202
+ _proj_handle(geogrid.epsg()),
203
+ _dem_interp_method(dem_interp_method)
195
204
{
196
205
// init light weight radar grid
197
206
_radar_grid.sensing_start = _rdr_geom.radarGrid ().sensingStart ();
@@ -219,9 +228,11 @@ __host__ Geocode::Geocode(const isce3::product::GeoGridParameters& geogrid,
219
228
if (std::isnan (invalid_value)) {
220
229
_invalid_float = std::numeric_limits<float >::quiet_NaN ();
221
230
_invalid_double = std::numeric_limits<double >::quiet_NaN ();
231
+ _invalid_unsigned_char = 255 ;
222
232
} else {
223
233
_invalid_float = invalid_value;
224
- _invalid_double = (double ) invalid_value;
234
+ _invalid_double = static_cast <double >(invalid_value);
235
+ _invalid_unsigned_char = static_cast <unsigned char >(invalid_value);
225
236
}
226
237
}
227
238
@@ -334,8 +345,11 @@ void Geocode::geocodeRasterBlock(Raster& output_raster, Raster& input_raster)
334
345
invalid_value = _invalid_double;
335
346
} else if constexpr (std::is_same_v<T, thrust::complex <double >>) {
336
347
interp = _interp_cdouble_handle.getInterp ();
337
- invalid_value =
338
- thrust::complex <double >(_invalid_double, _invalid_double);
348
+ invalid_value = thrust::complex <double >(_invalid_double,
349
+ _invalid_double);
350
+ } else if constexpr (std::is_same_v<T, unsigned char >) {
351
+ interp = _interp_unsigned_char_handle.getInterp ();
352
+ invalid_value = _invalid_unsigned_char;
339
353
}
340
354
341
355
// 0 width indicates current block is out of bounds
@@ -396,4 +410,5 @@ EXPLICIT_INSTATIATION(float);
396
410
EXPLICIT_INSTATIATION (thrust::complex <float >);
397
411
EXPLICIT_INSTATIATION (double );
398
412
EXPLICIT_INSTATIATION (thrust::complex <double >);
413
+ EXPLICIT_INSTATIATION (unsigned char );
399
414
} // namespace isce3::cuda::geocode
0 commit comments