Skip to content

Commit d128d42

Browse files
Squashed commit of the following:
commit 0e1f80c Author: xhuang-jpl <118782850+xhuang-jpl@users.noreply.github.com> Date: Wed Jun 24 16:38:22 2026 -0700 Fix the Ampcor issues from Lijun's branch and increase the limit of the search radius (#282) * sm r3.4 * change the SM commit id for R4.0.2 * remove the mask description for the wrapped ifgram * remove the tmp folder * fix minors * comment out the checkPixelInImageRange * pycuampcor: fix the pixels out of range issue * pycuampcor: fix an error in determining the corrwindow size * update the maximum search radius to be 256 --------- Co-authored-by: Xiaodong Huang <xhuang@nisar-adt-dev-3.jpl.nasa.gov> Co-authored-by: Lijun Zhu <ljzhu@gps.caltech.edu> commit 813d729 Author: Brian Hawkins <1729052+bhawkins@users.noreply.github.com> Date: Wed Jun 24 13:56:09 2026 -0500 Handle case where no samples in a rangline are valid (#327) * Handle case where all subswaths are invalid. * Log some details about missing data. * Fix typo * Use signed integer for negative values... commit 075795f Author: Gustavo H. X. Shiroma <52007211+gshiroma@users.noreply.github.com> Date: Thu Jun 18 15:59:58 2026 -0700 Fix STATIC filenames with fractional posting by rounding posting after converting to decimeters. (#314) * disable polarimetric symmetrization by default * revert changes to `symmetrize_cross_pol_channels` * Update GCOV and GSLC specification XMLs * Revert changes to the GCOV and GSLC specification XMLs * round posting after conversion to decimeters commit 3f7027d Author: SamNemo <11642807+nemo794@users.noreply.github.com> Date: Thu Jun 18 10:29:43 2026 -0700 Fix text encoding: Replace en dash (U+2013) with ASCII hyphen in descriptions (#292) Replaced Unicode en dash character (U+2013 "–") with standard ASCII hyphen (U+002d "-") in 19 locations across 4 Python files. The en dash was causing display issues in some programs, appearing as "â€"" instead of "–". Files modified: - python/packages/isce3/signal/rfi_freq_null.py (1 occurrence in citation) - python/packages/nisar/products/insar/GUNW_writer.py (5 occurrences in mask descriptions) - python/packages/nisar/products/insar/GOFF_writer.py (4 occurrences in mask descriptions) - python/packages/nisar/products/insar/InSAR_L1_writer.py (9 occurrences in mask descriptions) This fix ensures HDF5 attribute descriptions display correctly across all programs and avoids confusion with special Unicode characters in source code. Co-authored-by: Samantha C. Niemoeller <samantha.c.niemoeller@jpl.nasa.gov> commit db4f65b Author: Gustavo H. X. Shiroma <52007211+gshiroma@users.noreply.github.com> Date: Wed Jun 17 14:59:11 2026 -0700 Add margins to the STATIC product Doppler LUT grid boundaries to ensure full radargrid coverage. (#298) * disable polarimetric symmetrization by default * revert changes to `symmetrize_cross_pol_channels` * Update GCOV and GSLC specification XMLs * Revert changes to the GCOV and GSLC specification XMLs * Add margins to the Doppler LUT grid boundaries to ensure full radargrid coverage. * Add margins to the Doppler LUT grid boundaries to ensure full radargrid coverage. * Add margins to the Doppler LUT grid boundaries to ensure full radargrid coverage. commit 67f0878 Author: Gustavo H. X. Shiroma <52007211+gshiroma@users.noreply.github.com> Date: Mon Jun 8 11:43:17 2026 -0700 Improve DEM bounding box selection when product coordinates are in a different projection than the DEM (#275) * disable polarimetric symmetrization by default * revert changes to `symmetrize_cross_pol_channels` * Update GCOV and GSLC specification XMLs * Revert changes to the GCOV and GSLC specification XMLs * Update DEM bounding box selection * Improve variable names, docstrings, and handle incorrect starting/ending ordering * Improve variable names * Ensure latitude values remain within [-90, 90] * Ensure latitude values remain within [-90, 90] * Simplify code * Use parenthesis to make it clear evaluation order * improve comments * revert changes to constructor of variables `all_x` and `all_y` * change margin types from `float` to `double`
1 parent b806bc4 commit d128d42

23 files changed

Lines changed: 367 additions & 293 deletions

File tree

.github/workflows/build-and-run.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ jobs:
9292
run: |
9393
micromamba install -c nvidia cuda
9494
95-
- name: Install CUDA Toolkit
96-
if: matrix.deps.label == 'Documentation'
97-
run: |
98-
micromamba install -c nvidia cuda
99-
10095
# Fix missing conda command on macOS
10196
- name: macOS conda command fixup
10297
if: runner.os == 'macOS'

cxx/isce3/cuda/matchtemplate/pycuampcor/cuAmpcorParameter.cu

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ void cuAmpcorParameter::setupParameters()
8888
windowSizeWidth = windowSizeWidthRaw*rawDataOversamplingFactor; //
8989
windowSizeHeight = windowSizeHeightRaw*rawDataOversamplingFactor;
9090

91-
searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeDownRaw;
92-
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeAcrossRaw;
91+
searchWindowSizeWidthRaw = windowSizeWidthRaw + 2*halfSearchRangeAcrossRaw;
92+
searchWindowSizeHeightRaw = windowSizeHeightRaw + 2*halfSearchRangeDownRaw;
9393

9494
searchWindowSizeWidthRawZoomIn = windowSizeWidthRaw + 2*halfZoomWindowSizeRaw;
9595
searchWindowSizeHeightRawZoomIn = windowSizeHeightRaw + 2*halfZoomWindowSizeRaw;
@@ -237,14 +237,28 @@ void cuAmpcorParameter::setChunkStartPixels()
237237
if(sChunkEA < vpixel) sChunkEA = vpixel;
238238
}
239239
}
240+
// Clamp chunk start pixels to valid image range
241+
if (mChunkSD < 0) mChunkSD = 0;
242+
if (mChunkSA < 0) mChunkSA = 0;
243+
if (sChunkSD < 0) sChunkSD = 0;
244+
if (sChunkSA < 0) sChunkSA = 0;
245+
// Compute end pixels and clamp to image range
246+
int mEndD = mChunkED + windowSizeHeightRaw;
247+
if (mEndD > referenceImageHeight) mEndD = referenceImageHeight;
248+
int mEndA = mChunkEA + windowSizeWidthRaw;
249+
if (mEndA > referenceImageWidth) mEndA = referenceImageWidth;
250+
int sEndD = sChunkED + searchWindowSizeHeightRaw;
251+
if (sEndD > secondaryImageHeight) sEndD = secondaryImageHeight;
252+
int sEndA = sChunkEA + searchWindowSizeWidthRaw;
253+
if (sEndA > secondaryImageWidth) sEndA = secondaryImageWidth;
240254
referenceChunkStartPixelDown[idxChunk] = mChunkSD;
241255
referenceChunkStartPixelAcross[idxChunk] = mChunkSA;
242256
secondaryChunkStartPixelDown[idxChunk] = sChunkSD;
243257
secondaryChunkStartPixelAcross[idxChunk] = sChunkSA;
244-
referenceChunkHeight[idxChunk] = mChunkED - mChunkSD + windowSizeHeightRaw;
245-
referenceChunkWidth[idxChunk] = mChunkEA - mChunkSA + windowSizeWidthRaw;
246-
secondaryChunkHeight[idxChunk] = sChunkED - sChunkSD + searchWindowSizeHeightRaw;
247-
secondaryChunkWidth[idxChunk] = sChunkEA - sChunkSA + searchWindowSizeWidthRaw;
258+
referenceChunkHeight[idxChunk] = mEndD - mChunkSD;
259+
referenceChunkWidth[idxChunk] = mEndA - mChunkSA;
260+
secondaryChunkHeight[idxChunk] = sEndD - sChunkSD;
261+
secondaryChunkWidth[idxChunk] = sEndA - sChunkSA;
248262
if(maxReferenceChunkHeight < referenceChunkHeight[idxChunk]) maxReferenceChunkHeight = referenceChunkHeight[idxChunk];
249263
if(maxReferenceChunkWidth < referenceChunkWidth[idxChunk] ) maxReferenceChunkWidth = referenceChunkWidth[idxChunk];
250264
if(maxSecondaryChunkHeight < secondaryChunkHeight[idxChunk]) maxSecondaryChunkHeight = secondaryChunkHeight[idxChunk];
@@ -256,60 +270,37 @@ void cuAmpcorParameter::setChunkStartPixels()
256270
/// check whether reference and secondary windows are within the image range
257271
void cuAmpcorParameter::checkPixelInImageRange()
258272
{
273+
#ifdef CUAMPCOR_DEBUG
259274
int endPixel;
260275
for(int row=0; row<numberWindowDown; row++)
261276
{
262277
for(int col = 0; col < numberWindowAcross; col++)
263278
{
264279
int i = row*numberWindowAcross + col;
265-
if(referenceStartPixelDown[i] <0)
266-
{
267-
fprintf(stderr, "Reference Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
268-
exit(EXIT_FAILURE); //or raise range error
269-
}
270-
if(referenceStartPixelAcross[i] <0)
271-
{
272-
fprintf(stderr, "Reference Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);
273-
exit(EXIT_FAILURE);
274-
}
280+
if(referenceStartPixelDown[i] < 0)
281+
fprintf(stderr, "Warning: Reference Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, referenceStartPixelDown[i]);
282+
if(referenceStartPixelAcross[i] < 0)
283+
fprintf(stderr, "Warning: Reference Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, referenceStartPixelAcross[i]);
275284
endPixel = referenceStartPixelDown[i] + windowSizeHeightRaw;
276285
if(endPixel >= referenceImageHeight)
277-
{
278-
fprintf(stderr, "Reference Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
279-
exit(EXIT_FAILURE);
280-
}
286+
fprintf(stderr, "Warning: Reference Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
281287
endPixel = referenceStartPixelAcross[i] + windowSizeWidthRaw;
282288
if(endPixel >= referenceImageWidth)
283-
{
284-
fprintf(stderr, "Reference Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
285-
exit(EXIT_FAILURE);
286-
}
289+
fprintf(stderr, "Warning: Reference Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
287290
//secondary
288-
if(secondaryStartPixelDown[i] <0)
289-
{
290-
fprintf(stderr, "Secondary Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
291-
exit(EXIT_FAILURE);
292-
}
293-
if(secondaryStartPixelAcross[i] <0)
294-
{
295-
fprintf(stderr, "Secondary Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
296-
exit(EXIT_FAILURE);
297-
}
291+
if(secondaryStartPixelDown[i] < 0)
292+
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelDown[i]);
293+
if(secondaryStartPixelAcross[i] < 0)
294+
fprintf(stderr, "Warning: Secondary Window start pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, secondaryStartPixelAcross[i]);
298295
endPixel = secondaryStartPixelDown[i] + searchWindowSizeHeightRaw;
299296
if(endPixel >= secondaryImageHeight)
300-
{
301-
fprintf(stderr, "Secondary Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
302-
exit(EXIT_FAILURE);
303-
}
297+
fprintf(stderr, "Warning: Secondary Window end pixel out of range in Down, window (%d,%d), pixel %d\n", row, col, endPixel);
304298
endPixel = secondaryStartPixelAcross[i] + searchWindowSizeWidthRaw;
305299
if(endPixel >= secondaryImageWidth)
306-
{
307-
fprintf(stderr, "Secondary Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
308-
exit(EXIT_FAILURE);
309-
}
310-
300+
fprintf(stderr, "Warning: Secondary Window end pixel out of range in Across, window (%d,%d), pixel %d\n", row, col, endPixel);
311301
}
312302
}
303+
#endif
313304
}
314305

315306

cxx/isce3/cuda/matchtemplate/pycuampcor/cuArraysCopy.cu

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void cuArraysCopyToBatch(cuArrays<float2> *image1, cuArrays<float2> *image2,
6868

6969
// kernel for cuArraysCopyToBatchWithOffset
7070
template<typename T_in, typename T_out>
71-
__global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const int inNY,
71+
__global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const int inNX, const int inNY,
7272
T_out *imageOut, const int outNX, const int outNY, const int nImages,
7373
const int *offsetX, const int *offsetY)
7474
{
@@ -77,8 +77,12 @@ __global__ void cuArraysCopyToBatchWithOffset_kernel(const T_in *imageIn, const
7777
int outy = threadIdx.y + blockDim.y*blockIdx.y;
7878
if(idxImage>=nImages || outx >= outNX || outy >= outNY) return;
7979
int idxOut = idxImage*outNX*outNY + outx*outNY + outy;
80-
int idxIn = (offsetX[idxImage]+outx)*inNY + offsetY[idxImage] + outy;
81-
imageOut[idxOut] = T_out{imageIn[idxIn]};
80+
int inx = offsetX[idxImage] + outx;
81+
int iny = offsetY[idxImage] + outy;
82+
if (inx >= 0 && inx < inNX && iny >= 0 && iny < inNY)
83+
imageOut[idxOut] = T_out{imageIn[inx*inNY + iny]};
84+
else
85+
imageOut[idxOut] = T_out{0.0f};
8286
}
8387

8488
/**
@@ -98,14 +102,14 @@ void cuArraysCopyToBatchWithOffset(cuArrays<float2> *image1, const int lda1, cuA
98102
dim3 blockSize(nthreads, nthreads, 1);
99103
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
100104
cuArraysCopyToBatchWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
101-
image1->devData, lda1,
105+
image1->devData, image1->height, lda1,
102106
image2->devData, image2->height, image2->width, image2->count,
103107
offsetH, offsetW);
104108
getLastCudaError("cuArraysCopyToBatchAbsWithOffset_kernel");
105109
}
106110

107111
// same as above, but from complex to real(take amplitudes)
108-
__global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, const int inNY,
112+
__global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, const int inNX, const int inNY,
109113
float2 *imageOut, const int outNX, const int outNY, const int nImages,
110114
const int *offsetX, const int *offsetY)
111115
{
@@ -114,8 +118,12 @@ __global__ void cuArraysCopyToBatchAbsWithOffset_kernel(const float2 *imageIn, c
114118
int outy = threadIdx.y + blockDim.y*blockIdx.y;
115119
if(idxImage>=nImages || outx >= outNX || outy >= outNY) return;
116120
int idxOut = idxImage*outNX*outNY + outx*outNY + outy;
117-
int idxIn = (offsetX[idxImage]+outx)*inNY + offsetY[idxImage] + outy;
118-
imageOut[idxOut] = make_float2(complexAbs(imageIn[idxIn]), 0.0);
121+
int inx = offsetX[idxImage] + outx;
122+
int iny = offsetY[idxImage] + outy;
123+
if (inx >= 0 && inx < inNX && iny >= 0 && iny < inNY)
124+
imageOut[idxOut] = make_float2(complexAbs(imageIn[inx*inNY + iny]), 0.0f);
125+
else
126+
imageOut[idxOut] = make_float2(0.0f, 0.0f);
119127
}
120128

121129
/**
@@ -135,7 +143,7 @@ void cuArraysCopyToBatchAbsWithOffset(cuArrays<float2> *image1, const int lda1,
135143
dim3 blockSize(nthreads, nthreads, 1);
136144
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
137145
cuArraysCopyToBatchAbsWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
138-
image1->devData, lda1,
146+
image1->devData, image1->height, lda1,
139147
image2->devData, image2->height, image2->width, image2->count,
140148
offsetH, offsetW);
141149
getLastCudaError("cuArraysCopyToBatchAbsWithOffset_kernel");
@@ -158,7 +166,7 @@ void cuArraysCopyToBatchWithOffsetR2C(cuArrays<float> *image1, const int lda1, c
158166
dim3 blockSize(nthreads, nthreads, 1);
159167
dim3 gridSize(IDIVUP(image2->height,nthreads), IDIVUP(image2->width,nthreads), image2->count);
160168
cuArraysCopyToBatchWithOffset_kernel<<<gridSize,blockSize, 0 , stream>>> (
161-
image1->devData, lda1,
169+
image1->devData, image1->height, lda1,
162170
image2->devData, image2->height, image2->width, image2->count,
163171
offsetH, offsetW);
164172
getLastCudaError("cuArraysCopyToBatchWithOffsetR2C_kernel");

cxx/isce3/geometry/RTC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ void _RunBlock(const int jmax, const int block_size,
11741174
the bounding-box corners.
11751175
*/
11761176
int dem_margin_x_in_pixels = 100;
1177-
int dem_margin_y_in_pixels = 200;
1177+
int dem_margin_y_in_pixels = 100;
11781178
auto error_code = loadDemFromProj(
11791179
dem_raster, minX, maxX, minY, maxY, &dem_interp_block, proj,
11801180
dem_margin_x_in_pixels, dem_margin_y_in_pixels);

0 commit comments

Comments
 (0)