Exemple #1
0
    def unwrap(self):

        with isceobj.contextIntImage(filename=self.wrapName,
                                     width=self.width,
                                     accessMode='read') as intImage:

            with isceobj.contextOffsetImage(filename=self.corName,
                                            width=self.width,
                                            accessMode='read') as cohImage:

                with isceobj.contextIntImage(filename=self.unwrapName,
                                             width=self.width,
                                             accessMode='write') as unwImage:

                    grs = Grass()
                    grs.wireInputPort(name='interferogram', object=intImage)
                    grs.wireInputPort(name='correlation', object=cohImage)
                    grs.wireOutputPort(name='unwrapped interferogram',
                                       object=unwImage)
                    grs.unwrap()
                    unwImage.renderHdr()

                    pass
                pass
            pass

        return None
Exemple #2
0
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()
Exemple #3
0
def fGrass(widthInt, topoflatIntFilename):

    with isceobj.contextIntImage(
        filename=topoflatIntFilename,
        width=widthInt,
        accessMode='read') as intImage:

        ## Note: filename is extecpted to  end in'.flat'- what
        ## if it doesn't??? Use:
        ## os.path.extsep + topoflatIntFilename.split(os.path.extsep)[-1]
        with isceobj.contextOffsetImage(
            filename=topoflatIntFilename.replace('.flat', '.cor'),
            width=widthInt,
            accessMode='write') as cohImage:
            
            with isceobj.contextIntImage(
                filename=topoflatIntFilename.replace('.flat', '.unw'),
                width=widthInt,
                accessMode='write') as unwImage:

                grass = Grass()
                grass.wireInputPort(name='interferogram', object=intImage)
                grass.wireInputPort(name='correlation', object=cohImage)
                grass.wireOutputPort(name='unwrapped interferogram', object=unwImage)
                grass.unwrap()
                
                pass
            pass
        pass
    return None
Exemple #4
0
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
Exemple #5
0
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