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 scriptLT1AB
parent
89839bc453
commit
6a02f79277
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
@ -665,7 +665,9 @@ class run(object):
|
|||
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.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()
|
||||
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#
|
||||
#!/usr/bin/env python3
|
||||
# Author: Piyush Agram
|
||||
# Copyright 2016
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue