Merge pull request #80 from yunjunz/stripmapStack_unwrap

stripmapStack/unwrap: uncomment corrLooks for snaphu
LT1AB
Heresh Fattahi 2019-12-05 22:02:44 -08:00 committed by GitHub
commit 4685bed292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 46 deletions

View File

@ -197,6 +197,8 @@ class config(object):
self.f.write('nomcf : ' + self.noMCF + '\n')
self.f.write('master : ' + self.master + '\n')
self.f.write('defomax : ' + self.defoMax + '\n')
self.f.write('alks : ' + self.alks + '\n')
self.f.write('rlks : ' + self.rlks + '\n')
self.f.write('method : ' + self.unwMethod + '\n')
self.f.write('##########################'+'\n')

View File

@ -113,9 +113,19 @@ def extractInfoFromPickle(pckfile, inps):
data['earthRadius'] = elp.local_radius_of_curvature(llh.lat, hdg)
#azspacing = burst.azimuthTimeInterval * sv.getScalarVelocity()
azres = 20.0
#azres = 20.0
azspacing = sv.getScalarVelocity() / burst.PRF
azres = burst.platform.antennaLength / 2.0
azfact = azres / azspacing
burst.getInstrument()
rgBandwidth = burst.instrument.pulseLength * burst.instrument.chirpSlope
rgres = abs(SPEED_OF_LIGHT / (2.0 * rgBandwidth))
rgspacing = burst.instrument.rangePixelSize
rgfact = rgres / rgspacing
#data['corrlooks'] = inps.rglooks * inps.azlooks * azspacing / azres
data['corrlooks'] = inps.rglooks * inps.azlooks / (azfact * rgfact)
data['rglooks'] = inps.rglooks
data['azlooks'] = inps.azlooks
@ -149,7 +159,7 @@ def runUnwrap(infile, outfile, corfile, config, costMode = None,initMethod = Non
altitude = config['altitude']
rangeLooks = config['rglooks']
azimuthLooks = config['azlooks']
#corrLooks = config['corrlooks']
corrLooks = config['corrlooks']
maxComponents = 20
snp = Snaphu()
@ -163,7 +173,7 @@ def runUnwrap(infile, outfile, corfile, config, costMode = None,initMethod = Non
snp.setAltitude(altitude)
snp.setCorrfile(corfile)
snp.setInitMethod(initMethod)
# snp.setCorrLooks(corrLooks)
snp.setCorrLooks(corrLooks)
snp.setMaxComponents(maxComponents)
snp.setDefoMaxCycles(defomax)
snp.setRangeLooks(rangeLooks)
@ -248,7 +258,8 @@ def runUnwrapIcu(infile, outfile):
unwImage.finalizeImage()
unwImage.renderHdr()
def runUnwrap2Stage(unwrappedIntFilename,connectedComponentsFilename,unwrapped2StageFilename, unwrapper_2stage_name=None, solver_2stage=None):
def runUnwrap2Stage(unwrappedIntFilename,connectedComponentsFilename,unwrapped2StageFilename,
unwrapper_2stage_name=None, solver_2stage=None):
if unwrapper_2stage_name is None:
unwrapper_2stage_name = 'REDARC0'
@ -303,6 +314,7 @@ def main(iargs=None):
pckfile = os.path.join(masterShelveDir,'data')
print(pckfile)
metadata = extractInfoFromPickle(pckfile, inps)
########
print ('unwrapping method : ' , inps.method)
if inps.method == 'snaphu':
@ -311,6 +323,7 @@ def main(iargs=None):
else:
fncall = runUnwrapMcf
fncall(inps.intfile, inps.unwprefix + '_snaphu.unw', inps.cohfile, metadata, defomax=inps.defomax)
elif inps.method == 'snaphu2stage':
if inps.nomcf:
fncall = runUnwrap
@ -319,8 +332,9 @@ def main(iargs=None):
fncall(inps.intfile, inps.unwprefix + '_snaphu.unw', inps.cohfile, metadata, defomax=inps.defomax)
# adding in the two-stage
runUnwrap2Stage(inps.unwprefix + '_snaphu.unw', inps.unwprefix + '_snaphu.unw.conncomp',inps.unwprefix + '_snaphu2stage.unw')
runUnwrap2Stage(inps.unwprefix + '_snaphu.unw',
inps.unwprefix + '_snaphu.unw.conncomp',
inps.unwprefix + '_snaphu2stage.unw')
elif inps.method == 'icu':
runUnwrapIcu(inps.intfile, inps.unwprefix + '_icu.unw')