def run(width, infos, sceneid='NO_ID'): logger.info("Unwrapping interferogram using Grass: %s" % sceneid) wrapName = infos['outputPath'] + '.' + infos['topophaseFlatFilename'] unwrapName = infos['outputPath'] + '.' + infos['unwrappedIntFilename'] corName = infos['outputPath'] + '.' + infos['coherenceFilename'] with isceobj.contextIntImage(filename=wrapName, width=width, accessMode='read') as intImage: with isceobj.contextOffsetImage(filename=corName, width=width, accessMode='read') as cohImage: with isceobj.contextUnwImage(filename=unwrapName, width=width, accessMode='write') as unwImage: grs = Grass(name='insarapp_grass') grs.configure() grs.wireInputPort(name='interferogram', object=intImage) grs.wireInputPort(name='correlation', object=cohImage) grs.wireInputPort(name='unwrapped interferogram', object=unwImage) grs.unwrap() unwImage.renderHdr()
def runUnwrap(self): wrapName = self.insar.topophaseFlatFilename unwrapName = self.insar.unwrappedIntFilename corName = self.insar.coherenceFilename width = self.insar.resampIntImage.width with isceobj.contextIntImage(filename=wrapName, width=width, accessMode='read') as intImage: with isceobj.contextOffsetImage(filename=corName, width=width, accessMode='read') as cohImage: with isceobj.contextUnwImage(filename=unwrapName, width=width, accessMode='write') as unwImage: grs = Grass(name='insarapp_grass') grs.configure() grs.wireInputPort(name='interferogram', object=intImage) grs.wireInputPort(name='correlation', object=cohImage) grs.wireInputPort(name='unwrapped interferogram', object=unwImage) grs.unwrap() unwImage.renderHdr() pass pass pass return None
def runUnwrap(self): wrapName = os.path.join(self._insar.mergedDirname, self._insar.filtFilename) unwrapName = os.path.join(self._insar.mergedDirname, self._insar.unwrappedIntFilename) corName = os.path.join(self._insar.mergedDirname, self._insar.coherenceFilename) intImage = isceobj.createImage() intImage.load(wrapName + '.xml') intImage.setAccessMode('READ') cohImage = isceobj.createImage() cohImage.load(corName + '.xml') cohImage.setAccessMode('READ') unwImage = isceobj.createImage() unwImage.bands = 2 unwImage.scheme = 'BIL' unwImage.dataType = 'FLOAT' unwImage.setFilename(unwrapName) unwImage.setWidth(intImage.getWidth()) unwImage.setAccessMode('WRITE') grs = Grass(name='topsapp_grass') grs.configure() grs.wireInputPort(name='interferogram', object=intImage) grs.wireInputPort(name='correlation', object=cohImage) grs.wireInputPort(name='unwrapped interferogram', object=unwImage) grs.unwrap() unwImage.renderHdr() return None
def runUnwrap(self, igramSpectrum="full"): if igramSpectrum == "full": ifgDirname = self.insar.ifgDirname elif igramSpectrum == "low": if not self.doDispersive: print( 'Estimating dispersive phase not requested ... skipping sub-band interferogram unwrapping' ) return ifgDirname = os.path.join(self.insar.ifgDirname, self.insar.lowBandSlcDirname) elif igramSpectrum == "high": if not self.doDispersive: print( 'Estimating dispersive phase not requested ... skipping sub-band interferogram unwrapping' ) return ifgDirname = os.path.join(self.insar.ifgDirname, self.insar.highBandSlcDirname) wrapName = os.path.join(ifgDirname, 'filt_' + self.insar.ifgFilename) if '.flat' in wrapName: unwrapName = wrapName.replace('.flat', '.unw') elif '.int' in wrapName: unwrapName = wrapName.replace('.int', '.unw') else: unwrapName = wrapName + '.unw' corName = os.path.join(ifgDirname, self.insar.coherenceFilename) img1 = isceobj.createImage() img1.load(wrapName + '.xml') width = img1.getWidth() with isceobj.contextIntImage(filename=wrapName, width=width, accessMode='read') as intImage: with isceobj.contextOffsetImage(filename=corName, width=width, accessMode='read') as cohImage: with isceobj.contextUnwImage(filename=unwrapName, width=width, accessMode='write') as unwImage: grs = Grass(name='stripmapapp_grass') grs.configure() grs.wireInputPort(name='interferogram', object=intImage) grs.wireInputPort(name='correlation', object=cohImage) grs.wireInputPort(name='unwrapped interferogram', object=unwImage) grs.unwrap() unwImage.renderHdr() pass pass pass return None