Skip to content

Commit d7ba69c

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
2 parents 28950cd + d61d489 commit d7ba69c

File tree

67 files changed

+7553
-1417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+7553
-1417
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ ISCE - InSAR Scientific Computing Environment
22
=============================================
33

44
[![Build Status](
5-
https://nisar-adt-ci.jpl.nasa.gov/buildStatus/icon?job=isce-develop)](
6-
https://nisar-adt-ci.jpl.nasa.gov/job/isce-develop/)|
7-
[![Nightly Build Status](
8-
https://nisar-adt-ci.jpl.nasa.gov/buildStatus/icon?job=isce-develop-nightly-build)](
9-
https://nisar-adt-ci.jpl.nasa.gov/job/isce-develop-nightly-build/)
5+
https://github.com/isce-framework/isce3/actions/workflows/build-and-run.yml/badge.svg)](
6+
https://github.com/isce-framework/isce3/actions/workflows/build-and-run.yml)
107

118
The InSAR Scientific Computing Environment (ISCE) is an open source library for
129
processing spaceborne and airborne Interferometric Synthetic Aperture Radar

cxx/isce3/geocode/GeocodeCov.cpp

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
144144
const isce3::core::LUT2d<double>& az_time_correction,
145145
const isce3::core::LUT2d<double>& slant_range_correction,
146146
isce3::io::Raster* input_rtc, isce3::io::Raster* output_rtc,
147+
isce3::io::Raster* output_rtc_sigma,
147148
isce3::io::Raster* input_layover_shadow_mask_raster,
148149
isce3::product::SubSwaths* sub_swaths,
149150
std::optional<bool> apply_valid_samples_sub_swath_masking,
@@ -165,7 +166,7 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
165166
abs_cal_factor, clip_min, clip_max, out_geo_rdr, out_geo_dem,
166167
out_geo_rtc, out_geo_rtc_gamma0_to_sigma0,
167168
phase_screen_raster, az_time_correction,
168-
slant_range_correction, input_rtc, output_rtc,
169+
slant_range_correction, input_rtc, output_rtc, output_rtc_sigma,
169170
input_layover_shadow_mask_raster, sub_swaths,
170171
apply_valid_samples_sub_swath_masking, out_mask,
171172
geocode_memory_mode, min_block_size, max_block_size,
@@ -181,7 +182,7 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
181182
abs_cal_factor, clip_min, clip_max, out_geo_rdr, out_geo_dem,
182183
out_geo_rtc, out_geo_rtc_gamma0_to_sigma0, phase_screen_raster,
183184
az_time_correction,
184-
slant_range_correction, input_rtc, output_rtc,
185+
slant_range_correction, input_rtc, output_rtc, output_rtc_sigma,
185186
input_layover_shadow_mask_raster, sub_swaths,
186187
apply_valid_samples_sub_swath_masking, out_mask,
187188
geocode_memory_mode, min_block_size, max_block_size,
@@ -195,7 +196,7 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
195196
abs_cal_factor, clip_min, clip_max, out_geo_rdr, out_geo_dem,
196197
out_geo_rtc, out_geo_rtc_gamma0_to_sigma0,
197198
phase_screen_raster, az_time_correction,
198-
slant_range_correction, input_rtc, output_rtc,
199+
slant_range_correction, input_rtc, output_rtc, output_rtc_sigma,
199200
input_layover_shadow_mask_raster, sub_swaths,
200201
apply_valid_samples_sub_swath_masking, out_mask,
201202
geocode_memory_mode, min_block_size, max_block_size,
@@ -210,7 +211,7 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
210211
radar_grid_nlooks, out_off_diag_terms, out_geo_rdr, out_geo_dem,
211212
out_geo_nlooks, out_geo_rtc, out_geo_rtc_gamma0_to_sigma0,
212213
az_time_correction, slant_range_correction,
213-
input_rtc, output_rtc,
214+
input_rtc, output_rtc, output_rtc_sigma,
214215
input_layover_shadow_mask_raster, sub_swaths,
215216
apply_valid_samples_sub_swath_masking, out_mask,
216217
geocode_memory_mode, min_block_size, max_block_size,
@@ -227,7 +228,8 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
227228
out_geo_rdr, out_geo_dem, out_geo_nlooks, out_geo_rtc,
228229
out_geo_rtc_gamma0_to_sigma0, az_time_correction,
229230
slant_range_correction, input_rtc,
230-
output_rtc, input_layover_shadow_mask_raster, sub_swaths,
231+
output_rtc, output_rtc_sigma,
232+
input_layover_shadow_mask_raster, sub_swaths,
231233
apply_valid_samples_sub_swath_masking, out_mask,
232234
geocode_memory_mode, min_block_size, max_block_size,
233235
dem_interp_method);
@@ -242,7 +244,8 @@ void Geocode<T>::geocode(const isce3::product::RadarGridParameters& radar_grid,
242244
out_geo_rdr, out_geo_dem, out_geo_nlooks, out_geo_rtc,
243245
out_geo_rtc_gamma0_to_sigma0, az_time_correction,
244246
slant_range_correction, input_rtc,
245-
output_rtc, input_layover_shadow_mask_raster, sub_swaths,
247+
output_rtc, output_rtc_sigma,
248+
input_layover_shadow_mask_raster, sub_swaths,
246249
apply_valid_samples_sub_swath_masking, out_mask,
247250
geocode_memory_mode, min_block_size, max_block_size,
248251
dem_interp_method);
@@ -269,6 +272,7 @@ void Geocode<T>::geocodeInterp(
269272
const isce3::core::LUT2d<double>& slant_range_correction,
270273
isce3::io::Raster* input_rtc,
271274
isce3::io::Raster* output_rtc,
275+
isce3::io::Raster* output_rtc_sigma,
272276
isce3::io::Raster* input_layover_shadow_mask_raster,
273277
isce3::product::SubSwaths* sub_swaths,
274278
std::optional<bool> apply_valid_samples_sub_swath_masking,
@@ -480,15 +484,17 @@ void Geocode<T>::geocodeInterp(
480484
else
481485
rtc_memory_mode = isce3::core::MemoryModeBlocksY::MultipleBlocksY;
482486

483-
if (out_geo_rtc_gamma0_to_sigma0 != nullptr) {
487+
if (out_geo_rtc_gamma0_to_sigma0 != nullptr && output_rtc_sigma == nullptr) {
484488
std::string vsimem_ref = (
485-
"/vsimem/" + getTempString("geocode_cov_areaproj_rtc_sigma0"));
489+
"/vsimem/" + getTempString("geocode_cov_interp_rtc_sigma0"));
486490
rtc_raster_sigma0_unique_ptr =
487491
std::make_unique<isce3::io::Raster>(
488492
vsimem_ref, radar_grid.width(),
489493
radar_grid.length(), 1, GDT_Float32, "ENVI");
490494
rtc_sigma0_raster =
491495
rtc_raster_sigma0_unique_ptr.get();
496+
} else {
497+
rtc_sigma0_raster = output_rtc_sigma;
492498
}
493499

494500
isce3::io::Raster* out_geo_rdr = nullptr;
@@ -1881,6 +1887,7 @@ void Geocode<T>::geocodeAreaProj(
18811887
const isce3::core::LUT2d<double>& az_time_correction,
18821888
const isce3::core::LUT2d<double>& slant_range_correction,
18831889
isce3::io::Raster* input_rtc, isce3::io::Raster* output_rtc,
1890+
isce3::io::Raster* output_rtc_sigma,
18841891
isce3::io::Raster* input_layover_shadow_mask_raster,
18851892
isce3::product::SubSwaths* sub_swaths,
18861893
std::optional<bool> apply_valid_samples_sub_swath_masking,
@@ -1919,7 +1926,8 @@ void Geocode<T>::geocodeAreaProj(
19191926
out_geo_dem, out_geo_nlooks, out_geo_rtc,
19201927
out_geo_rtc_gamma0_to_sigma0,
19211928
az_time_correction, slant_range_correction, input_rtc,
1922-
output_rtc, input_layover_shadow_mask_raster, sub_swaths,
1929+
output_rtc, output_rtc_sigma,
1930+
input_layover_shadow_mask_raster, sub_swaths,
19231931
apply_valid_samples_sub_swath_masking, out_mask,
19241932
geocode_memory_mode, min_block_size, max_block_size,
19251933
dem_interp_method);
@@ -2018,6 +2026,7 @@ void Geocode<T>::geocodeAreaProj(
20182026
isce3::core::Matrix<float> rtc_area, rtc_area_sigma;
20192027

20202028
bool flag_rtc_raster_is_in_memory = false;
2029+
bool flag_rtc_sigma0_raster_is_in_memory = false;
20212030

20222031
if (flag_apply_rtc) {
20232032
std::string input_terrain_radiometry_str =
@@ -2066,7 +2075,8 @@ void Geocode<T>::geocodeAreaProj(
20662075
else
20672076
rtc_memory_mode = isce3::core::MemoryModeBlocksY::MultipleBlocksY;
20682077

2069-
if (out_geo_rtc_gamma0_to_sigma0 != nullptr) {
2078+
if (out_geo_rtc_gamma0_to_sigma0 != nullptr &&
2079+
output_rtc_sigma == nullptr) {
20702080
std::string vsimem_ref = (
20712081
"/vsimem/" + getTempString("geocode_cov_areaproj_rtc_sigma0"));
20722082
rtc_raster_sigma0_unique_ptr =
@@ -2075,6 +2085,9 @@ void Geocode<T>::geocodeAreaProj(
20752085
radar_grid_cropped.length(), 1, GDT_Float32, "ENVI");
20762086
rtc_sigma0_raster =
20772087
rtc_raster_sigma0_unique_ptr.get();
2088+
flag_rtc_sigma0_raster_is_in_memory = true;
2089+
} else {
2090+
rtc_sigma0_raster = output_rtc_sigma;
20782091
}
20792092

20802093
isce3::io::Raster* out_geo_rdr = nullptr;
@@ -2098,7 +2111,7 @@ void Geocode<T>::geocodeAreaProj(
20982111
/*
20992112
Load RTC in array as a "single block" if:
21002113
1. `is_radar_grid_single_block` is `true`; or
2101-
2. RTC raster an "in-memory" raster. In this case,
2114+
2. RTC raster is an "in-memory" raster. In this case,
21022115
the entire raster is already in memory. It's better to move it
21032116
to the array and clear the in-memory raster.
21042117
*/
@@ -2110,11 +2123,14 @@ void Geocode<T>::geocodeAreaProj(
21102123
rtc_raster_unique_ptr.reset();
21112124
}
21122125

2113-
/*
2114-
In the curent implementation, rtc_sigma0_raster is always in memory.
2115-
So, we move it to an array to prevent extra memory to be allocated.
2126+
/*
2127+
The same approach is used for `rtc_sigma0_raster`, i.e.,
2128+
load RTC sigma in array as a "single block" if:
2129+
1. `is_radar_grid_single_block` is `true`; or
2130+
2. RTC sigma0 raster `rtc_sigma0_raster` an "in-memory" raster.
21162131
*/
2117-
if (out_geo_rtc_gamma0_to_sigma0 != nullptr) {
2132+
if (out_geo_rtc_gamma0_to_sigma0 != nullptr &&
2133+
(is_radar_grid_single_block || flag_rtc_sigma0_raster_is_in_memory)) {
21182134
rtc_area_sigma.resize(radar_grid_cropped.length(),
21192135
radar_grid_cropped.width());
21202136
rtc_sigma0_raster->getBlock(
@@ -2277,7 +2293,8 @@ void Geocode<T>::geocodeAreaProj(
22772293
out_geo_nlooks, out_geo_rtc,
22782294
out_geo_rtc_gamma0_to_sigma0,
22792295
proj.get(), flag_apply_rtc,
2280-
flag_rtc_raster_is_in_memory, rtc_raster,
2296+
flag_rtc_raster_is_in_memory, flag_rtc_sigma0_raster_is_in_memory,
2297+
rtc_raster, rtc_sigma0_raster,
22812298
az_time_correction, slant_range_correction,
22822299
input_raster, offset_y, offset_x,
22832300
output_raster, rtc_area, rtc_area_sigma,
@@ -2304,7 +2321,8 @@ void Geocode<T>::geocodeAreaProj(
23042321
out_geo_nlooks, out_geo_rtc,
23052322
out_geo_rtc_gamma0_to_sigma0,
23062323
proj.get(), flag_apply_rtc,
2307-
flag_rtc_raster_is_in_memory, rtc_raster,
2324+
flag_rtc_raster_is_in_memory, flag_rtc_sigma0_raster_is_in_memory,
2325+
rtc_raster, rtc_sigma0_raster,
23082326
az_time_correction, slant_range_correction,
23092327
input_raster, offset_y, offset_x,
23102328
output_raster, rtc_area, rtc_area_sigma,
@@ -2493,7 +2511,8 @@ void Geocode<T>::_runBlock(
24932511
isce3::io::Raster* out_geo_nlooks, isce3::io::Raster* out_geo_rtc,
24942512
isce3::io::Raster* out_geo_rtc_gamma0_to_sigma0,
24952513
isce3::core::ProjectionBase* proj, bool flag_apply_rtc,
2496-
bool flag_rtc_raster_is_in_memory, isce3::io::Raster* rtc_raster,
2514+
bool flag_rtc_raster_is_in_memory, bool flag_rtc_sigma0_raster_is_in_memory,
2515+
isce3::io::Raster* rtc_raster, isce3::io::Raster* rtc_sigma0_raster,
24972516
const isce3::core::LUT2d<double>& az_time_correction,
24982517
const isce3::core::LUT2d<double>& slant_range_correction,
24992518
isce3::io::Raster& input_raster,
@@ -2785,7 +2804,7 @@ void Geocode<T>::_runBlock(
27852804
int xbound = radar_grid.width() - 1;
27862805
int ybound = radar_grid.length() - 1;
27872806

2788-
isce3::core::Matrix<float> rtc_area_block;
2807+
isce3::core::Matrix<float> rtc_area_block, rtc_area_sigma_block;
27892808
isce3::core::Matrix<uint8_t> input_layover_shadow_mask_block;
27902809
std::vector<std::unique_ptr<isce3::core::Matrix<T2>>> rdrDataBlock;
27912810
if (!is_radar_grid_single_block) {
@@ -2853,6 +2872,16 @@ void Geocode<T>::_runBlock(
28532872
rtc_raster->getBlock(rtc_area_block.data(), offset_x, offset_y,
28542873
radar_grid_block.width(), radar_grid_block.length(), 1);
28552874
}
2875+
2876+
if (flag_apply_rtc && !flag_rtc_sigma0_raster_is_in_memory &&
2877+
out_geo_rtc_gamma0_to_sigma0 != nullptr) {
2878+
rtc_area_sigma_block.resize(radar_grid_block.length(),
2879+
radar_grid_block.width());
2880+
rtc_sigma0_raster->getBlock(
2881+
rtc_area_sigma_block.data(), offset_x, offset_y,
2882+
radar_grid_block.width(), radar_grid_block.length(), 1);
2883+
}
2884+
28562885
if (input_layover_shadow_mask_raster != nullptr) {
28572886
input_layover_shadow_mask_block.resize(
28582887
radar_grid_block.length(), radar_grid_block.width());
@@ -3291,7 +3320,14 @@ void Geocode<T>::_runBlock(
32913320
area_total += rtc_value * w;
32923321

32933322
if (out_geo_rtc_gamma0_to_sigma0 != nullptr) {
3294-
area_sigma_total += rtc_area_sigma(y, x) * w;
3323+
float rtc_value_sigma;
3324+
if (is_radar_grid_single_block || flag_rtc_sigma0_raster_is_in_memory) {
3325+
rtc_value_sigma = rtc_area_sigma(y, x);
3326+
} else {
3327+
rtc_value_sigma =
3328+
rtc_area_sigma_block(y - offset_y, x - offset_x);
3329+
}
3330+
area_sigma_total += rtc_value_sigma * w;
32953331
}
32963332
w /= rtc_value;
32973333
} else {

cxx/isce3/geocode/GeocodeCov.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ class Geocode {
130130
* the `output_raster` (e.g., gamma0) to that of the `input_raster` (e.g.,
131131
* beta0). These values are only computed if `flag_apply_rtc` is `true`
132132
* and `input_rtc` is not provided.
133+
* @param[out] output_rtc_sigma Output RTC area factor to sigma-0
134+
* (in slant-range geometry).
133135
* @param[in] input_layover_shadow_mask_raster Input layover/shadow mask raster
134136
* (in radar geometry). Samples identified as SHADOW or LAYOVER_AND_SHADOW are
135137
* considered invalid.
@@ -182,6 +184,7 @@ class Geocode {
182184
const isce3::core::LUT2d<double>& slant_range_correction = {},
183185
isce3::io::Raster* input_rtc = nullptr,
184186
isce3::io::Raster* output_rtc = nullptr,
187+
isce3::io::Raster* output_rtc_sigma = nullptr,
185188
isce3::io::Raster* input_layover_shadow_mask_raster = nullptr,
186189
isce3::product::SubSwaths* sub_swaths = nullptr,
187190
std::optional<bool> apply_valid_samples_sub_swath_masking = std::nullopt,
@@ -272,6 +275,8 @@ class Geocode {
272275
* the `output_raster` (e.g., gamma0) to that of the `input_raster` (e.g.,
273276
* beta0). These values are only computed if `flag_apply_rtc` is `true`
274277
* and `input_rtc` is not provided.
278+
* @param[out] output_rtc_sigma Output RTC area factor to sigma-0
279+
* (in slant-range geometry).
275280
* @param[in] input_layover_shadow_mask_raster Input layover/shadow mask raster
276281
* (in radar geometry). Samples identified as SHADOW or LAYOVER_AND_SHADOW are
277282
* considered invalid.
@@ -315,6 +320,7 @@ class Geocode {
315320
const isce3::core::LUT2d<double>& slant_range_correction = {},
316321
isce3::io::Raster* input_rtc = nullptr,
317322
isce3::io::Raster* output_rtc = nullptr,
323+
isce3::io::Raster* output_rtc_sigma = nullptr,
318324
isce3::io::Raster* input_layover_shadow_mask_raster = nullptr,
319325
isce3::product::SubSwaths* sub_swaths = nullptr,
320326
std::optional<bool> apply_valid_samples_sub_swath_masking = {},
@@ -412,6 +418,8 @@ class Geocode {
412418
* the `output_raster` (e.g., gamma0) to that of the `input_raster` (e.g.,
413419
* beta0). These values are only computed if `flag_apply_rtc` is `true`
414420
* and `input_rtc` is not provided.
421+
* @param[out] output_rtc_sigma Output RTC area factor to sigma-0
422+
* (in slant-range geometry).
415423
* @param[in] input_layover_shadow_mask_raster Input layover/shadow mask raster
416424
* (in radar geometry). Samples identified as SHADOW or LAYOVER_AND_SHADOW are
417425
* considered invalid.
@@ -462,6 +470,7 @@ class Geocode {
462470
const isce3::core::LUT2d<double>& slant_range_correction = {},
463471
isce3::io::Raster* input_rtc = nullptr,
464472
isce3::io::Raster* output_rtc = nullptr,
473+
isce3::io::Raster* output_rtc_sigma = nullptr,
465474
isce3::io::Raster* input_layover_shadow_mask_raster = nullptr,
466475
isce3::product::SubSwaths* sub_swaths = nullptr,
467476
std::optional<bool> apply_valid_samples_sub_swath_masking = std::nullopt,
@@ -629,7 +638,8 @@ class Geocode {
629638
isce3::io::Raster* out_geo_nlooks, isce3::io::Raster* out_geo_rtc,
630639
isce3::io::Raster* out_geo_rtc_gamma0_to_sigma0,
631640
isce3::core::ProjectionBase* proj, bool flag_apply_rtc,
632-
bool flag_rtc_raster_is_in_memory, isce3::io::Raster* rtc_raster,
641+
bool flag_rtc_raster_is_in_memory, bool flag_rtc_sigma0_raster_is_in_memory,
642+
isce3::io::Raster* rtc_raster, isce3::io::Raster* rtc_sigma0_raster,
633643
const isce3::core::LUT2d<double>& az_time_correction,
634644
const isce3::core::LUT2d<double>& slant_range_correction,
635645
isce3::io::Raster& input_raster,

cxx/isce3/matchtemplate/pycuampcor/cuOffset.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void cudaKernel_maxloc2D(const float* const images, int2* maxloc, float* maxval
2121
const int imageSize = imageNX * imageNY;
2222

2323
for (int bid = 0; bid < nImages; bid++) {
24-
float my_maxval = std::numeric_limits<float>::min();
24+
float my_maxval = std::numeric_limits<float>::lowest();
2525
int2 my_maxloc;
2626
const float* image = &images[bid * imageSize];
2727
for (int i = 0; i < imageSize; i++) {

python/extensions/pybind_isce3/core/Constants.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ void add_constants(py::module & core)
1616

1717
core.attr("speed_of_light") = py::float_(isce3::core::speed_of_light);
1818
core.attr("earth_spin_rate") = py::float_(isce3::core::EarthSpinRate);
19+
core.attr("GLOBAL_MIN_HEIGHT") = py::float_(isce3::core::GLOBAL_MIN_HEIGHT);
20+
core.attr("GLOBAL_MAX_HEIGHT") = py::float_(isce3::core::GLOBAL_MAX_HEIGHT);
1921
core.attr("WGS84_ELLIPSOID") = isce3::core::Ellipsoid();
2022
core.attr("SINC_HALF") = isce3::core::SINC_HALF;
2123
}

python/extensions/pybind_isce3/geocode/GeocodeCov.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ void addbinding(py::class_<Geocode<T>>& pyGeocode)
106106
py::arg("slant_range_correction") = isce3::core::LUT2d<double>(),
107107
py::arg("input_rtc") = nullptr,
108108
py::arg("output_rtc") = nullptr,
109+
py::arg("output_rtc_sigma") = nullptr,
109110
py::arg("input_layover_shadow_mask_raster") = nullptr,
110111
py::arg("sub_swaths") = nullptr,
111112
py::arg("apply_valid_samples_sub_swath_masking") = std::nullopt,
@@ -245,6 +246,8 @@ void addbinding(py::class_<Geocode<T>>& pyGeocode)
245246
that of the `input_raster` (e.g., beta0). These values
246247
are only computed if `flag_apply_rtc` is `true`
247248
and `input_rtc` is not provided.
249+
output_rtc_sigma: isce3.io.Raster, optional
250+
Output RTC area factor to sigma-0 (in slant-range)
248251
input_layover_shadow_mask_raster: isce3.io.Raster, optional
249252
Input layover/shadow mask raster (in radar geometry).
250253
Samples identified as SHADOW or LAYOVER_AND_SHADOW are

0 commit comments

Comments
 (0)