Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
7710060
PyCuAmpcor: offer an option to fix the starting pixel locations
May 28, 2022
cf86b83
PyCuAmpcor: merge #622 by rtburns-jpl
May 25, 2023
3a4fa40
pycuampcor: deallocate memory objects
Dec 17, 2023
be9d498
Merge branch 'main' into pycuampcor
Nov 5, 2024
1be8be4
pycuampcor: add debug messages for loading the images
Nov 16, 2024
9ecd6b9
PyCuAmpcor V2: start with oversampled images
Nov 25, 2024
e85f962
PyCuAmpcor: fix the formula for determining the final offset
Nov 26, 2024
5f48f3e
PyCuAmpcor: oversampling procedure adjustment
Dec 11, 2024
6704ee9
PyCuAmpcor: add extra pads to correlation surface
Dec 12, 2024
85c8ec1
PyCuAmpcor: use split spectrum for even sequence oversampling
Dec 13, 2024
fe15e7a
PyCuAmpcor: add margin to the loaded secondary chip as well
Dec 13, 2024
3d7de1b
PyCuAmpcor: add a python script to plot offset fields
Dec 13, 2024
9ad2269
PyCuAmpcor: use a larger area to oversample the reference image
Dec 17, 2024
68cf742
PyCuAmpcor: first attemp with double precision - use CUAMPCOR_DOUBLE …
Dec 18, 2024
90fe814
PyCuAmpcor-DB: first running version
Dec 19, 2024
bcd2b91
PyCuAmpcor-DB: fixed some errors to produce the correct results
Dec 19, 2024
0cbd93b
PyCuAmpcor-DP: disable time domain algorithm for (os) window larger t…
Dec 19, 2024
67250aa
PyCuAmpcor-DP: change default to single precision
Dec 20, 2024
fd28b41
PyCuAmpcor-v2: solution to time domain code for gpus with 48K shared …
Dec 22, 2024
c656d72
PyCuAmpcor-V2: in zero padding for FFT oversampling, resort to conven…
Dec 23, 2024
1da8c64
PyCuAmpcor-v2: add correlation surface statistics (snr and variance) …
Dec 23, 2024
baf1df3
PyCuAmpcor-v2: add the correlation surface peak values to output
Dec 23, 2024
cc25c3b
PyCuAmpcor-v2: rename cuAmpcorChunk to cuAmpcorProcessor and use the …
Jan 10, 2025
03e3300
PyCuAmpcor-v2: bring back ROIPAC/ampcor workflow (set as default), br…
Jan 16, 2025
a6764b8
PyCuAmpcor-v2: repair Readme
Jan 16, 2025
7d3eb2c
PyAcuAmpcor-v2: add debug info to cuderamp=1
Jan 28, 2025
a3eb6a4
PyAcuAmpcor-v2: fix the search range in presence of extra pads
Jan 29, 2025
dd21e68
PyAcuAmpcor-v2: rename two workflows to TwoPass and OnePass wrt the n…
Feb 1, 2025
5d070d5
PyCuAmpcor-v2: clarify notations and notes, per PR comments
Feb 1, 2025
538704f
PyCuAmpcor-v2: add description for the offset visualization tool plot…
Feb 1, 2025
fa3231e
PyCuAmpcor-v2: revert to custom mmap image loader
Feb 14, 2025
936d7bc
PyCuAmpcor-v2: 1) fix data types for DP; 2) reduce the search range o…
Feb 28, 2025
fbcc209
pycuampcor-v2: fix an error in determining the corrwindow size
Feb 28, 2025
80a7c45
pycuampcor-v2: fix also the corrwindow size error for two-pass workflow
Feb 28, 2025
cecdee8
pycuampcor-v2: add get_sm_count method - the batch size is recommende…
Mar 6, 2025
68a4199
patch getLineBand in some fortran code
Apr 3, 2025
1670d80
Merge branch 'main' into pycuampcor-v2-devel
Apr 3, 2025
1ea8c27
Merge branch 'fortran-patch' into pycuampcor-v2-devel
Apr 3, 2025
9df1506
PyCuAmpcor: patch the scons script for the two different vironments i…
Apr 3, 2025
54070c2
pycuampcor-v2: change the order of parameters in classes to suppress …
Apr 3, 2025
7acaf20
pycuAmpcor add new workflow to TopsProc, topsApp
yuankailiu Apr 10, 2025
3269450
pycuampcor for topsApp: change the slc access method; add the output …
Apr 11, 2025
b99a56c
add OFFSET_PEAKVALUE_FILE to TopsProc
yuankailiu Apr 11, 2025
b9572cd
pycuampcor in topsApp: fix the runDenseOffsets script
Apr 11, 2025
d2b4104
revert typo changes
yuankailiu Apr 15, 2025
c417f5f
pycuampcor-v2: fix the distance in variance estimate in one-pass work…
Apr 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions applications/topsApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 California Institute of Technology. ALL RIGHTS RESERVED.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# United States Government Sponsorship acknowledged. This software is subject to
# U.S. export control laws and regulations and has been classified as 'EAR99 NLR'
# (No [Export] License Required except when exporting to an embargoed country,
Expand Down Expand Up @@ -295,6 +295,15 @@


######Adding stuff from topsOffsetApp for integration
OFFSET_WORKFLOW = Application.Parameter(
'off_workflow',
public_name='Ampcor workflow',
default=0,
type=int,
mandatory=False,
doc='Ampcor workflow. 0 for Two-pass search (integer search then oversampled search). 1 for One-pass straight oversampled search.'
)

WINDOW_SIZE_WIDTH = Application.Parameter(
'winwidth',
public_name='Ampcor window width',
Expand Down Expand Up @@ -660,6 +669,7 @@ class TopsInSAR(Application):
USE_VIRTUAL_FILES,
SWATHS,
ROI,
OFFSET_WORKFLOW,
WINDOW_SIZE_HEIGHT,
WINDOW_SIZE_WIDTH,
SEARCH_WINDOW_HEIGHT,
Expand Down
18 changes: 14 additions & 4 deletions applications/topsOffsetApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2016 California Institute of Technology. ALL RIGHTS RESERVED.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# United States Government Sponsorship acknowledged. This software is subject to
# U.S. export control laws and regulations and has been classified as 'EAR99 NLR'
# (No [Export] License Required except when exporting to an embargoed country,
Expand Down Expand Up @@ -231,6 +231,15 @@
doc='Application-specific parameter to indicate whether running topsApp or topsOffsetApp.'
)

OFFSET_WORKFLOW = Application.Parameter(
'off_workflow',
public_name='Ampcor workflow',
default=0,
type=int,
mandatory=False,
doc='Ampcor workflow. 0 for Two-pass search (integer search then oversampled search). 1 for One-pass straight oversampled search.'
)

OFFSET_GEOCODE_LIST = Application.Parameter(
'off_geocode_list',
public_name='offset geocode list',
Expand All @@ -246,6 +255,7 @@ class TopsOffset(TopsInSAR):

# Pull TopsInSAR's parameter/facility lists
parameter_list = TopsInSAR.parameter_list + ( \
OFFSET_WORKFLOW,
WINDOW_SIZE_WIDTH,
WINDOW_SIZE_HEIGHT,
SEARCH_WINDOW_WIDTH,
Expand Down
10 changes: 10 additions & 0 deletions components/isceobj/TopsProc/TopsProc.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,14 @@
mandatory=False,
doc='Filename for gross dense offsets covariance. Used in runDenseOffsets.')

OFFSET_PEAKVALUE_FILE = Component.Parameter(
'peakvaluefile',
public_name='Offset correlation surface peak value filename',
default='dense_offsets_peakvalue.bil',
type=str,
mandatory=False,
doc='Filename for gross offsets correlation surface peak values. Used in runDenseOffsets.')

FILT_OFFSET_OUTPUT_FILE = Component.Parameter(
'filt_offsetfile',
public_name='Filtered offset filename',
Expand All @@ -342,6 +350,7 @@
default = [OFFSET_OUTPUT_FILE,
OFFSET_SNR_FILE,
OFFSET_COV_FILE,
OFFSET_PEAKVALUE_FILE,
FILT_OFFSET_OUTPUT_FILE],
container = list,
type=str,
Expand Down Expand Up @@ -395,6 +404,7 @@ class TopsProc(Component):
OFFSET_OUTPUT_FILE,
OFFSET_SNR_FILE,
OFFSET_COV_FILE,
OFFSET_PEAKVALUE_FILE,
FILT_OFFSET_OUTPUT_FILE,
OFFSET_GEOCODE_LIST)

Expand Down
28 changes: 24 additions & 4 deletions components/isceobj/TopsProc/runDenseOffsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def runDenseOffsetsCPU(self):
print('Gross offset across: %d' % (self.rgshift))
print('Gross offset down: %d\n' % (self.azshift))

objOffset.workflow = self.off_workflow
objOffset.setWindowSizeWidth(self.winwidth)
objOffset.setWindowSizeHeight(self.winhgt)
objOffset.setSearchWindowSizeWidth(self.srcwidth)
Expand Down Expand Up @@ -190,14 +191,19 @@ def runDenseOffsetsGPU(self):
### Set parameters
# cross-correlation method, 0=Frequency domain, 1= Time domain
objOffset.algorithm = 0
# ampcor workflow, 0=two-pass workflow, 1= one-pass workflow
objOffset.workflow = self.off_workflow
# deramping method: 0 to take magnitude (fixed for Tops)
objOffset.derampMethod = 0
objOffset.referenceImageName = reference + '.vrt'
objOffset.referenceImageName = reference
objOffset.referenceImageHeight = length
objOffset.referenceImageWidth = width
objOffset.secondaryImageName = secondary + '.vrt'
objOffset.referenceImageDataType = 2 if m.getDataType().upper().startswith('C') else 1
objOffset.secondaryImageName = secondary
objOffset.secondaryImageHeight = length
objOffset.secondaryImageWidth = width
objOffset.secondaryImageDataType = 2 if s.getDataType().upper().startswith('C') else 1


# adjust the margin
margin = max(self.margin, abs(self.azshift), abs(self.rgshift))
Expand Down Expand Up @@ -232,9 +238,9 @@ def runDenseOffsetsGPU(self):
objOffset.nStreams = 2
# number of windows in a chunk/batch
objOffset.numberWindowDownInChunk = 1
objOffset.numberWindowAcrossInChunk = 64
objOffset.numberWindowAcrossInChunk = 20
# memory map cache size in GB
objOffset.mmapSize = 16
objOffset.mmapSize = 4

# Modify BIL in filename to BIP if needed and store for future use
prefix, ext = os.path.splitext(self._insar.offsetfile)
Expand All @@ -247,11 +253,13 @@ def runDenseOffsetsGPU(self):
objOffset.grossOffsetImageName = os.path.join(self._insar.mergedDirname, self._insar.offsetfile + ".gross")
objOffset.snrImageName = os.path.join(self._insar.mergedDirname, self._insar.snrfile)
objOffset.covImageName = os.path.join(self._insar.mergedDirname, self._insar.covfile)
objOffset.peakValueImageName = os.path.join(self._insar.mergedDirname, self._insar.peakvaluefile)

# merge gross offset to final offset
objOffset.mergeGrossOffset = 1

### print the settings
print('Workflow: %d\n' % (self.off_workflow))
print('\nReference frame: %s' % (mf))
print('Secondary frame: %s' % (sf))
print('Main window size width: %d' % (self.winwidth))
Expand All @@ -268,6 +276,8 @@ def runDenseOffsetsGPU(self):
print('Output gross offsets file name: %s' % (objOffset.grossOffsetImageName))
print('Output SNR file name: %s' % (objOffset.snrImageName))
print('Output COV file name: %s' % (objOffset.covImageName))
print('Output Correlation Surface Peak Value file name: %s' % (objOffset.peakValueImageName))
print(f'Number of windows: {objOffset.numberWindowDown} x {objOffset.numberWindowAcross}')

# pass the parameters to C++ programs
objOffset.setupParams()
Expand Down Expand Up @@ -332,6 +342,16 @@ def runDenseOffsetsGPU(self):
covImg.setAccessMode('read')
covImg.renderHdr()

peakValueImg = isceobj.createImage()
peakValueImg.setFilename(objOffset.peakValueImageName)
peakValueImg.setDataType('FLOAT')
peakValueImg.setBands(1)
peakValueImg.scheme = 'BIP'
peakValueImg.setWidth(objOffset.numberWindowAcross)
peakValueImg.setLength(objOffset.numberWindowDown)
peakValueImg.setAccessMode('read')
peakValueImg.renderHdr()


if __name__ == '__main__' :
'''
Expand Down
4 changes: 2 additions & 2 deletions components/isceobj/Util/denseoffsets/src/denseoffsetsRead.F
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subroutine readCpxAmp(acc,arr,irow,band,n,carr)
integer*8 :: acc
integer :: irow,band,n,i

call getLineBand(acc,carr,band,irow)
call getLineBand_c(acc,carr,band,irow)
end subroutine readCpxAmp

subroutine readAmp(acc,arr,irow,band,n,carr)
Expand All @@ -49,7 +49,7 @@ subroutine readAmp(acc,arr,irow,band,n,carr)
integer :: irow,band,n
integer :: i

call getLineBand(acc,arr,band,irow)
call getLineBand_r4(acc,arr,band,irow)
do i=1,n
carr(i) = cmplx(arr(i), 0.0)
enddo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ subroutine readCpxAmp(acc,arr,irow,band,n,carr)
integer*8 :: acc
integer :: irow,band,n,i

call getLineBand(acc,carr,band,irow)
call getLineBand_c(acc,carr,band,irow)
!call getLine(acc, carr, irow)
do i=1,n
arr(i) = cabs(carr(i))
Expand All @@ -52,7 +52,7 @@ subroutine readAmp(acc,arr,irow,band,n,carr)
integer*8 :: acc
integer :: irow,band,n

call getLineBand(acc,arr,band,irow)
call getLineBand_r4(acc,arr,band,irow)
end subroutine

end module estimateoffsetsRead
8 changes: 6 additions & 2 deletions contrib/PyCuAmpcor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ endif()

set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --prec-div=true --prec-sqrt=true")


pybind11_add_module(PyCuAmpcor
src/PyCuAmpcor.cpp
src/GDALImage.cpp
src/SlcImage.cpp
src/SConscript
src/cuAmpcorChunk.cpp
src/cuAmpcorProcessor.cpp
src/cuAmpcorProcessorTwoPass.cpp
src/cuAmpcorProcessorOnePass.cpp
src/cuAmpcorController.cpp
src/cuAmpcorParameter.cpp
src/cuArrays.cpp
Expand Down
50 changes: 50 additions & 0 deletions contrib/PyCuAmpcor/CMakeLists.txt.isce2
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Early exit if prereqs not available
if(NOT TARGET GDAL::GDAL
OR NOT TARGET CUDA::cufft
OR NOT pybind11_FOUND
)
return()
endif()

set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --prec-div=true --prec-sqrt=true")


pybind11_add_module(PyCuAmpcor
src/PyCuAmpcor.cpp
src/SlcImage.cpp
src/SConscript
src/cuAmpcorProcessor.cpp
src/cuAmpcorProcessorTwoPass.cpp
src/cuAmpcorProcessorOnePass.cpp
src/cuAmpcorController.cpp
src/cuAmpcorParameter.cpp
src/cuArrays.cpp
src/cuArraysCopy.cu
src/cuArraysPadding.cu
src/cuCorrFrequency.cu
src/cuCorrNormalization.cu
src/cuCorrNormalizationSAT.cu
src/cuCorrNormalizer.cpp
src/cuCorrTimeDomain.cu
src/cuDeramp.cu
src/cuEstimateStats.cu
src/cuOffset.cu
src/cuOverSampler.cpp
src/cuSincOverSampler.cu
src/cudaError.cpp
src/cudaUtil.cpp
)
target_include_directories(PyCuAmpcor PRIVATE
src
)
target_link_libraries(PyCuAmpcor PRIVATE
CUDA::cufft
GDAL::GDAL
)

InstallSameDir(
__init__.py
PyCuAmpcor
)
Loading