commit
bfbc555f41
|
@ -65,7 +65,7 @@ def estimateOffsetField(master, slave, denseOffsetFileName,
|
||||||
|
|
||||||
objOffset.offsetImageName = denseOffsetFileName + '.bil'
|
objOffset.offsetImageName = denseOffsetFileName + '.bil'
|
||||||
objOffset.snrImageName = denseOffsetFileName +'_snr.bil'
|
objOffset.snrImageName = denseOffsetFileName +'_snr.bil'
|
||||||
|
objOffset.covImageName = denseOffsetFileName +'_cov.bil'
|
||||||
|
|
||||||
objOffset.denseampcor(sar, sim)
|
objOffset.denseampcor(sar, sim)
|
||||||
|
|
||||||
|
|
|
@ -320,6 +320,14 @@ OFFSET_SNR_FILE = Component.Parameter(
|
||||||
mandatory=False,
|
mandatory=False,
|
||||||
doc='Filename for gross dense offsets SNR. Used in runDenseOffsets.')
|
doc='Filename for gross dense offsets SNR. Used in runDenseOffsets.')
|
||||||
|
|
||||||
|
OFFSET_COV_FILE = Component.Parameter(
|
||||||
|
'covfile',
|
||||||
|
public_name='Offset covariance filename',
|
||||||
|
default='dense_offsets_cov.bil',
|
||||||
|
type=str,
|
||||||
|
mandatory=False,
|
||||||
|
doc='Filename for gross dense offsets covariance. Used in runDenseOffsets.')
|
||||||
|
|
||||||
FILT_OFFSET_OUTPUT_FILE = Component.Parameter(
|
FILT_OFFSET_OUTPUT_FILE = Component.Parameter(
|
||||||
'filt_offsetfile',
|
'filt_offsetfile',
|
||||||
public_name='Filtered offset filename',
|
public_name='Filtered offset filename',
|
||||||
|
@ -333,6 +341,7 @@ OFFSET_GEOCODE_LIST = Component.Parameter('off_geocode_list',
|
||||||
public_name='offset geocode list',
|
public_name='offset geocode list',
|
||||||
default = [OFFSET_OUTPUT_FILE,
|
default = [OFFSET_OUTPUT_FILE,
|
||||||
OFFSET_SNR_FILE,
|
OFFSET_SNR_FILE,
|
||||||
|
OFFSET_COV_FILE,
|
||||||
FILT_OFFSET_OUTPUT_FILE],
|
FILT_OFFSET_OUTPUT_FILE],
|
||||||
container = list,
|
container = list,
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -385,6 +394,7 @@ class TopsProc(Component):
|
||||||
OFFSET_WIDTH,
|
OFFSET_WIDTH,
|
||||||
OFFSET_OUTPUT_FILE,
|
OFFSET_OUTPUT_FILE,
|
||||||
OFFSET_SNR_FILE,
|
OFFSET_SNR_FILE,
|
||||||
|
OFFSET_COV_FILE,
|
||||||
FILT_OFFSET_OUTPUT_FILE,
|
FILT_OFFSET_OUTPUT_FILE,
|
||||||
OFFSET_GEOCODE_LIST)
|
OFFSET_GEOCODE_LIST)
|
||||||
|
|
||||||
|
|
|
@ -118,9 +118,11 @@ def runDenseOffsetsCPU(self):
|
||||||
|
|
||||||
objOffset.offsetImageName = os.path.join(self._insar.mergedDirname, self._insar.offsetfile)
|
objOffset.offsetImageName = os.path.join(self._insar.mergedDirname, self._insar.offsetfile)
|
||||||
objOffset.snrImageName = os.path.join(self._insar.mergedDirname, self._insar.snrfile)
|
objOffset.snrImageName = os.path.join(self._insar.mergedDirname, self._insar.snrfile)
|
||||||
|
objOffset.covImageName = os.path.join(self._insar.mergedDirname, self._insar.covfile)
|
||||||
|
|
||||||
print('Output dense offsets file name: %s' % (objOffset.offsetImageName))
|
print('Output dense offsets file name: %s' % (objOffset.offsetImageName))
|
||||||
print('Output SNR file name: %s' % (objOffset.snrImageName))
|
print('Output SNR file name: %s' % (objOffset.snrImageName))
|
||||||
|
print('Output covariance file name: %s' % (objOffset.covImageName))
|
||||||
print('\n======================================')
|
print('\n======================================')
|
||||||
print('Running dense ampcor...')
|
print('Running dense ampcor...')
|
||||||
print('======================================\n')
|
print('======================================\n')
|
||||||
|
|
|
@ -253,6 +253,13 @@ SNR_IMAGE_NAME = Component.Parameter('snrImageName',
|
||||||
mandatory=False,
|
mandatory=False,
|
||||||
doc = 'File name for output SNR')
|
doc = 'File name for output SNR')
|
||||||
|
|
||||||
|
COV_IMAGE_NAME = Component.Parameter('covImageName',
|
||||||
|
public_name = 'COV_IMAGE_NAME',
|
||||||
|
default = 'dense_ampcor_cov.bil',
|
||||||
|
type=str,
|
||||||
|
mandatory=False,
|
||||||
|
doc = 'File name for output covariance')
|
||||||
|
|
||||||
MARGIN = Component.Parameter('margin',
|
MARGIN = Component.Parameter('margin',
|
||||||
public_name = 'MARGIN',
|
public_name = 'MARGIN',
|
||||||
default = 50,
|
default = 50,
|
||||||
|
@ -298,6 +305,7 @@ class DenseAmpcor(Component):
|
||||||
BAND2,
|
BAND2,
|
||||||
OFFSET_IMAGE_NAME,
|
OFFSET_IMAGE_NAME,
|
||||||
SNR_IMAGE_NAME,
|
SNR_IMAGE_NAME,
|
||||||
|
COV_IMAGE_NAME,
|
||||||
MARGIN,
|
MARGIN,
|
||||||
NUMBER_THREADS)
|
NUMBER_THREADS)
|
||||||
|
|
||||||
|
@ -374,10 +382,16 @@ class DenseAmpcor(Component):
|
||||||
self.locationAcross = np.frombuffer(mp.Array('i', numlen).get_obj(), dtype='i')
|
self.locationAcross = np.frombuffer(mp.Array('i', numlen).get_obj(), dtype='i')
|
||||||
self.locationAcrossOffset = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
self.locationAcrossOffset = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
||||||
self.snr = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
self.snr = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
||||||
|
self.cov1 = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
||||||
|
self.cov2 = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
||||||
|
self.cov3 = np.frombuffer(mp.Array('f', numlen).get_obj(), dtype='f')
|
||||||
|
|
||||||
self.locationDownOffset[:] = -10000.0
|
self.locationDownOffset[:] = -10000.0
|
||||||
self.locationAcrossOffset[:] = -10000.0
|
self.locationAcrossOffset[:] = -10000.0
|
||||||
self.snr[:] = 0.0
|
self.snr[:] = 0.0
|
||||||
|
self.cov1[:] = 999.0
|
||||||
|
self.cov2[:] = 999.0
|
||||||
|
self.cov3[:] = 999.0
|
||||||
|
|
||||||
###run ampcor on parallel processes
|
###run ampcor on parallel processes
|
||||||
threads = []
|
threads = []
|
||||||
|
@ -421,7 +435,6 @@ class DenseAmpcor(Component):
|
||||||
#### Scale images (default is 1.0 to keep as pixel)
|
#### Scale images (default is 1.0 to keep as pixel)
|
||||||
self.locationDownOffset *= self.scaling_factor
|
self.locationDownOffset *= self.scaling_factor
|
||||||
self.locationAcrossOffset *= self.scaling_factor
|
self.locationAcrossOffset *= self.scaling_factor
|
||||||
self.snr *= self.scaling_factor
|
|
||||||
|
|
||||||
self.write_slantrange_images()
|
self.write_slantrange_images()
|
||||||
|
|
||||||
|
@ -487,6 +500,9 @@ class DenseAmpcor(Component):
|
||||||
self.locationAcross[firstind+i] = objAmpcor.locationAcross[j]
|
self.locationAcross[firstind+i] = objAmpcor.locationAcross[j]
|
||||||
self.locationAcrossOffset[firstind+i] = objAmpcor.locationAcrossOffset[j]
|
self.locationAcrossOffset[firstind+i] = objAmpcor.locationAcrossOffset[j]
|
||||||
self.snr[firstind+i] = objAmpcor.snrRet[j]
|
self.snr[firstind+i] = objAmpcor.snrRet[j]
|
||||||
|
self.cov1[firstind+i] = objAmpcor.cov1Ret[j]
|
||||||
|
self.cov2[firstind+i] = objAmpcor.cov2Ret[j]
|
||||||
|
self.cov3[firstind+i] = objAmpcor.cov3Ret[j]
|
||||||
j += 1
|
j += 1
|
||||||
else:
|
else:
|
||||||
self.locationDown[firstind+i] = downInd
|
self.locationDown[firstind+i] = downInd
|
||||||
|
@ -494,6 +510,9 @@ class DenseAmpcor(Component):
|
||||||
self.locationAcross[firstind+i] = acInd
|
self.locationAcross[firstind+i] = acInd
|
||||||
self.locationAcrossOffset[firstind+i] = -10000.
|
self.locationAcrossOffset[firstind+i] = -10000.
|
||||||
self.snr[firstind+i] = 0.
|
self.snr[firstind+i] = 0.
|
||||||
|
self.cov1[firstind+i] = 999.
|
||||||
|
self.cov2[firstind+i] = 999.
|
||||||
|
self.cov3[firstind+i] = 999.
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -518,6 +537,14 @@ class DenseAmpcor(Component):
|
||||||
if self.locationAcross.ndim == 1:
|
if self.locationAcross.ndim == 1:
|
||||||
self.locationAcross = self.locationAcross.reshape(-1,self.offsetCols)
|
self.locationAcross = self.locationAcross.reshape(-1,self.offsetCols)
|
||||||
|
|
||||||
|
if self.cov1.ndim == 1:
|
||||||
|
self.cov1 = self.cov1.reshape(-1,self.offsetCols)
|
||||||
|
|
||||||
|
if self.cov2.ndim == 1:
|
||||||
|
self.cov2 = self.cov2.reshape(-1,self.offsetCols)
|
||||||
|
|
||||||
|
if self.cov3.ndim == 1:
|
||||||
|
self.cov3 = self.cov3.reshape(-1,self.offsetCols)
|
||||||
|
|
||||||
outdata = np.empty((2*self.offsetLines, self.offsetCols), dtype=np.float32)
|
outdata = np.empty((2*self.offsetLines, self.offsetCols), dtype=np.float32)
|
||||||
outdata[::2,:] = self.locationDownOffset
|
outdata[::2,:] = self.locationDownOffset
|
||||||
|
@ -545,6 +572,22 @@ class DenseAmpcor(Component):
|
||||||
snrImg.setAccessMode('read')
|
snrImg.setAccessMode('read')
|
||||||
snrImg.renderHdr()
|
snrImg.renderHdr()
|
||||||
|
|
||||||
|
####Create covariance image
|
||||||
|
covdata = np.empty((3*self.offsetLines, self.offsetCols), dtype=np.float32)
|
||||||
|
covdata[::3,:] = self.cov1
|
||||||
|
covdata[1::3,:] = self.cov2
|
||||||
|
covdata[2::3,:] = self.cov3
|
||||||
|
covdata.tofile(self.covImageName)
|
||||||
|
del covdata
|
||||||
|
covImg = isceobj.createImage()
|
||||||
|
covImg.setDataType('FLOAT')
|
||||||
|
covImg.setFilename(self.covImageName)
|
||||||
|
covImg.setBands(3)
|
||||||
|
covImg.scheme = 'BIL'
|
||||||
|
covImg.setWidth(self.offsetCols)
|
||||||
|
covImg.setLength(self.offsetLines)
|
||||||
|
covImg.setAccessMode('read')
|
||||||
|
covImg.renderHdr()
|
||||||
|
|
||||||
def checkTypes(self):
|
def checkTypes(self):
|
||||||
'''Check if the image datatypes are set.'''
|
'''Check if the image datatypes are set.'''
|
||||||
|
|
Loading…
Reference in New Issue