FilterAndCoh: use fine.cor(.full) for multilooked (full-reso) cpx cor file

topsStack/FilterAndCoherence.py:
+ add .full suffix to the complex coherence filename only if the multilook number is 1
+ for multilook number as 1, do not run looks sub-module

topsStack/Stack.filter_coherence(): add .full suffix only when azLooks * rgLooks == 1

topsStack/mergeBursts.py: add python3 at the top of script
LT1AB
yunjunz 2020-05-14 15:23:17 -07:00 committed by piyushrpt
parent 89839bc453
commit 6a02f79277
3 changed files with 55 additions and 50 deletions

View File

@ -128,25 +128,31 @@ def estCpxCoherence(slc1_file, slc2_file, cpx_coh_file, alks=3, rlks=9):
from isceobj.TopsProc.runBurstIfg import computeCoherence
from mroipac.looks.Looks import Looks
# get the full resolution file name
if alks * rlks == 1:
cpx_coh_file_full = cpx_coh_file
else:
cpx_coh_file_full = cpx_coh_file+'.full'
# calculate complex coherence in full resolution
computeCoherence(slc1_file, slc2_file, cpx_coh_file)
computeCoherence(slc1_file, slc2_file, cpx_coh_file_full)
# multilook
print('Multilooking {0} ...'.format(cpx_coh_file))
if alks * rlks > 1:
print('Multilooking {0} ...'.format(cpx_coh_file_full))
inimg = isceobj.createImage()
inimg.load(cpx_coh_file + '.xml')
inimg.load(cpx_coh_file_full + '.xml')
outname = os.path.splitext(inimg.filename)[0]
lkObj = Looks()
lkObj.setDownLooks(alks)
lkObj.setAcrossLooks(rlks)
lkObj.setInputImage(inimg)
lkObj.setOutputFilename(outname)
lkObj.setOutputFilename(cpx_coh_file)
lkObj.looks()
# remove full resolution coherence file
ret=os.system('rm '+cpx_coh_file)
os.remove(cpx_coh_file_full)
return

View File

@ -207,7 +207,7 @@ class config(object):
self.f.write('strength : ' + self.filtStrength + '\n')
self.f.write('slc1 : ' + self.slc1 + '\n')
self.f.write('slc2 : ' + self.slc2 + '\n')
self.f.write('complex_coh : '+ self.cpxcor + '\n')
self.f.write('complex_coh : '+ self.cpxCohName + '\n')
self.f.write('range_looks : ' + self.rangeLooks + '\n')
self.f.write('azimuth_looks : ' + self.azimuthLooks + '\n')
@ -657,15 +657,17 @@ class run(object):
secondary = pair[1]
mergedDir = os.path.join(self.work_dir, 'merged/interferograms/' + reference + '_' + secondary)
mergedSLCDir = os.path.join(self.work_dir, 'merged/SLC')
configName = os.path.join(self.config_path ,'config_igram_filt_coh_' + reference + '_' + secondary)
configName = os.path.join(self.config_path, 'config_igram_filt_coh_' + reference + '_' + secondary)
configObj = config(configName)
configObj.configure(self)
configObj.input = os.path.join(mergedDir,'fine.int')
configObj.filtName = os.path.join(mergedDir,'filt_fine.int')
configObj.cohName = os.path.join(mergedDir,'filt_fine.cor')
configObj.slc1=os.path.join(mergedSLCDir, '{}/{}.slc.full'.format(reference, reference))
configObj.slc2=os.path.join(mergedSLCDir, '{}/{}.slc.full'.format(secondary, secondary))
configObj.cpxcor=os.path.join(mergedDir,'fine.cor.full')
configObj.input = os.path.join(mergedDir, 'fine.int')
configObj.filtName = os.path.join(mergedDir, 'filt_fine.int')
configObj.cohName = os.path.join(mergedDir, 'filt_fine.cor')
configObj.slc1 = os.path.join(mergedSLCDir, '{}/{}.slc.full'.format(reference, reference))
configObj.slc2 = os.path.join(mergedSLCDir, '{}/{}.slc.full'.format(secondary, secondary))
configObj.cpxCohName = os.path.join(mergedDir, 'fine.cor')
if int(self.rangeLooks) * int(self.azimuthLooks) == 1:
configObj.cpxCohName += '.full'
#configObj.filtStrength = str(self.filtStrength)
configObj.FilterAndCoherence('[Function-1]')
configObj.finalize()
@ -1012,6 +1014,3 @@ echo " "
f.close()
"""

View File

@ -1,4 +1,4 @@
#
#!/usr/bin/env python3
# Author: Piyush Agram
# Copyright 2016
#