예제 #1
0
def runTopo(self):
    logger.info("Running topo")

    objMocompbaseline = self.insar.mocompBaseline
    objFormSlc1 = self.insar.formSLC1

    #objDem = isceobj.createDemImage()
    #demImage = self.insar.demImage

    #IU.copyAttributes(demImage, objDem)
    objDem = self.insar.demImage.clone()

    topoIntImage = self._insar.getTopoIntImage()
    #intImage = isceobj.createIntImage()
    #IU.copyAttributes(topoIntImage, intImage)
    intImage = topoIntImage.clone()
    intImage.setAccessMode('read')

    posIndx = 1
    mocompPosition1 = objFormSlc1.getMocompPosition()

    planet = self.insar.masterFrame.getInstrument().getPlatform().getPlanet()
    prf1 = self.insar.masterFrame.getInstrument().getPulseRepetitionFrequency()

    objTopo = stdproc.createTopo()
    objTopo.wireInputPort(name='peg', object=self.insar.peg)
    objTopo.wireInputPort(name='frame', object=self.insar.masterFrame)
    objTopo.wireInputPort(name='planet', object=planet)
    objTopo.wireInputPort(name='dem', object=objDem)
    objTopo.wireInputPort(name='interferogram', object=intImage)
    objTopo.wireInputPort(name='masterslc',
                          object=self.insar.formSLC1)  #Piyush

    centroid = self.insar.dopplerCentroid.getDopplerCoefficients(inHz=False)[0]
    objTopo.setDopplerCentroidConstantTerm(centroid)

    v = self.insar.procVelocity
    h = self.insar.averageHeight

    objTopo.setBodyFixedVelocity(v)
    objTopo.setSpacecraftHeight(h)

    objTopo.setReferenceOrbit(mocompPosition1[posIndx])

    # Options
    objTopo.setNumberRangeLooks(self.insar.numberRangeLooks)
    objTopo.setNumberAzimuthLooks(self.insar.numberAzimuthLooks)
    objTopo.setNumberIterations(self.insar.topophaseIterations)
    objTopo.setHeightSchFilename(self.insar.heightSchFilename)
    objTopo.setHeightRFilename(self.insar.heightFilename)
    objTopo.setLatFilename(self.insar.latFilename)
    objTopo.setLonFilename(self.insar.lonFilename)
    objTopo.setLosFilename(self.insar.losFilename)

    if self.insar.is_mocomp is None:
        self.insar.get_is_mocomp()

    objTopo.setISMocomp(self.insar.is_mocomp)
    #set the tag used in the outfile. each message is precided by this tag
    #is the writer is not of "file" type the call has no effect
    objTopo.stdWriter = self._writer_set_file_tags("topo", "log", "err", "out")
    objTopo.setLookSide(self.insar._lookSide)
    objTopo.topo()

    # Record the inputs and outputs
    from isceobj.Catalog import recordInputsAndOutputs
    recordInputsAndOutputs(self._insar.procDoc, objTopo, "runTopo", logger,
                           "runTopo")

    self._insar.setTopo(objTopo)
    if self.insar.applyWaterMask:
        sw = SWBDStitcher()
        sw.toRadar(self.insar.wbdImage.filename, self.insar.latFilename,
                   self.insar.lonFilename, self.insar.waterMaskImageName)

    return objTopo
예제 #2
0
def run(objFormSlc1,
        intImage,
        frame1,
        velocity,
        height,
        infos,
        stdWriter,
        catalog=None,
        sceneid='NO_ID'):
    logger.info("Running Topo: %s" % sceneid)

    demImage = infos['demImage']
    objDem = isceobj.createDemImage()
    IU.copyAttributes(demImage, objDem)

    posIndx = 1
    mocompPosition1 = objFormSlc1.getMocompPosition()

    planet = frame1.getInstrument().getPlatform().getPlanet()
    prf1 = frame1.getInstrument().getPulseRepetitionFrequency()

    centroid = infos['dopplerCentroid'].getDopplerCoefficients(inHz=False)[0]

    objTopo = stdproc.createTopo()
    objTopo.wireInputPort(name='peg', object=infos['peg'])
    objTopo.wireInputPort(name='frame', object=frame1)
    objTopo.wireInputPort(name='planet', object=planet)
    objTopo.wireInputPort(name='dem', object=objDem)
    objTopo.wireInputPort(name='interferogram',
                          object=intImage)  #ML 2014-09-26
    objTopo.wireInputPort(name='masterslc', object=objFormSlc1)  #Piyush
    objTopo.setDopplerCentroidConstantTerm(centroid)

    objTopo.setBodyFixedVelocity(velocity)
    objTopo.setSpacecraftHeight(height)

    objTopo.setReferenceOrbit(mocompPosition1[posIndx])

    #objTopo.setWidth(infos['intWidth']) #ML 2014-09-26
    #objTopo.setLength(infos['intLength']) #ML 2014-09-26

    # Options
    objTopo.setNumberRangeLooks(infos['numberRangeLooks'])
    objTopo.setNumberAzimuthLooks(infos['numberAzimuthLooks'])
    objTopo.setNumberIterations(infos['topophaseIterations'])
    objTopo.setHeightSchFilename(infos['outputPath'] + '.' +
                                 infos['heightSchFilename'])  #sch height file
    # KK 2013-12-12: added output paths to real height, latitude, longitude and los files
    objTopo.setHeightRFilename(infos['outputPath'] + '.' +
                               infos['heightFilename'])
    objTopo.setLatFilename(infos['outputPath'] + '.' + infos['latFilename'])
    objTopo.setLonFilename(infos['outputPath'] + '.' + infos['lonFilename'])
    objTopo.setLosFilename(infos['outputPath'] + '.' + infos['losFilename'])
    # KK

    objTopo.setISMocomp(infos['is_mocomp'])
    objTopo.setLookSide(infos['lookSide'])
    #set the tag used in the outfile. each message is precided by this tag
    #is the writer is not of "file" type the call has no effect
    objTopo.stdWriter = stdWriter.set_file_tags("topo", "log", "err", "out")
    objTopo.topo()

    if catalog is not None:
        # Record the inputs and outputs
        isceobj.Catalog.recordInputsAndOutputs(catalog, objTopo,
                                               "runTopo.%s" % sceneid, logger,
                                               "runTopo.%s" % sceneid)

    return objTopo