2019-01-16 19:40:08 +00:00
|
|
|
#!/usr/bin/env python3
|
2019-11-20 00:59:49 +00:00
|
|
|
#
|
2019-01-16 19:40:08 +00:00
|
|
|
# test_cuAmpcor.py
|
|
|
|
# Test program to run ampcor with GPU
|
|
|
|
#
|
2019-11-20 00:59:49 +00:00
|
|
|
#
|
2019-01-16 19:40:08 +00:00
|
|
|
|
|
|
|
import argparse
|
|
|
|
import numpy as np
|
2019-11-20 00:59:49 +00:00
|
|
|
from PyCuAmpcor import PyCuAmpcor
|
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
|
|
|
|
def main():
|
|
|
|
'''
|
|
|
|
main program
|
|
|
|
'''
|
|
|
|
|
|
|
|
objOffset = PyCuAmpcor()
|
|
|
|
|
|
|
|
objOffset.algorithm = 0
|
|
|
|
objOffset.deviceID = 0 # -1:let system find the best GPU
|
|
|
|
objOffset.nStreams = 2 #cudaStreams
|
2020-07-02 19:40:49 +00:00
|
|
|
objOffset.referenceImageName = "20131213.slc.vrt"
|
|
|
|
objOffset.referenceImageHeight = 43008
|
|
|
|
objOffset.referenceImageWidth = 24320
|
|
|
|
objOffset.secondaryImageName = "20131221.slc.vrt"
|
|
|
|
objOffset.secondaryImageHeight = 43008
|
|
|
|
objOffset.secondaryImageWidth = 24320
|
2019-01-16 19:40:08 +00:00
|
|
|
objOffset.windowSizeWidth = 64
|
|
|
|
objOffset.windowSizeHeight = 64
|
|
|
|
objOffset.halfSearchRangeDown = 20
|
|
|
|
objOffset.halfSearchRangeAcross = 20
|
|
|
|
objOffset.derampMethod = 1
|
|
|
|
objOffset.numberWindowDown = 300
|
|
|
|
objOffset.numberWindowAcross = 30
|
|
|
|
objOffset.skipSampleDown = 128
|
|
|
|
objOffset.skipSampleAcross = 64
|
|
|
|
objOffset.numberWindowDownInChunk = 10
|
|
|
|
objOffset.numberWindowAcrossInChunk = 10
|
|
|
|
objOffset.corrSurfaceOverSamplingFactor = 8
|
2019-11-20 00:59:49 +00:00
|
|
|
objOffset.corrSurfaceZoomInWindow = 16
|
|
|
|
objOffset.corrSufaceOverSamplingMethod = 1
|
|
|
|
objOffset.useMmap = 1
|
2019-01-16 19:40:08 +00:00
|
|
|
objOffset.mmapSize = 8
|
|
|
|
|
|
|
|
objOffset.setupParams()
|
2020-07-02 19:40:49 +00:00
|
|
|
objOffset.referenceStartPixelDownStatic = 1000
|
|
|
|
objOffset.referenceStartPixelAcrossStatic = 1000
|
2019-01-16 19:40:08 +00:00
|
|
|
objOffset.setConstantGrossOffset(642, -30)
|
|
|
|
objOffset.checkPixelInImageRange()
|
|
|
|
objOffset.runAmpcor()
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-11-20 00:59:49 +00:00
|
|
|
|
2019-01-16 19:40:08 +00:00
|
|
|
main()
|