Example #1
0
def runGeocodeOffset(self):
    '''geocode offset fied
    '''
    if not self.doDenseOffset:
        return
    if not ((self._insar.modeCombination == 0) or
            (self._insar.modeCombination == 1)):
        return

    catalog = isceobj.Catalog.createCatalog(self._insar.procDoc.name)
    self.updateParamemetersFromUser()

    #use original track object to determine bbox
    if self.bbox == None:
        masterTrack = self._insar.loadTrack(master=True)
        bbox = getBboxGeo(masterTrack)
    else:
        bbox = self.bbox
    catalog.addItem('geocode bounding box', bbox, 'runGeocodeOffset')

    demFile = os.path.abspath(self._insar.demGeo)

    denseOffsetDir = 'dense_offset'
    if not os.path.exists(denseOffsetDir):
        os.makedirs(denseOffsetDir)
    os.chdir(denseOffsetDir)

    masterTrack = self._insar.loadProduct(self._insar.masterTrackParameter)
    #slaveTrack = self._insar.loadProduct(self._insar.slaveTrackParameter)

    #########################################################################################
    #compute bounding box for geocoding
    #if self.bbox == None:
    #    bbox = getBboxGeo(masterTrack)
    #else:
    #    bbox = self.bbox
    #catalog.addItem('geocode bounding box', bbox, 'runGeocodeOffset')

    geocodeList = [self._insar.denseOffset, self._insar.denseOffsetSnr]
    if self.doOffsetFiltering:
        geocodeList.append(self._insar.denseOffsetFilt)

    for inputFile in geocodeList:
        interpMethod = 'nearest'
        geocode(masterTrack,
                demFile,
                inputFile,
                bbox,
                self.offsetSkipWidth,
                self.offsetSkipHeight,
                interpMethod,
                self._insar.offsetImageTopoffset,
                self._insar.offsetImageLeftoffset,
                addMultilookOffset=False)
#########################################################################################

    os.chdir('../')
    catalog.printToLog(logger, "runGeocodeOffset")
    self._insar.procDoc.addAllFromCatalog(catalog)
Example #2
0
def runGeocodeSd(self):
    '''geocode final products
    '''
    catalog = isceobj.Catalog.createCatalog(self._insar.procDoc.name)
    self.updateParamemetersFromUser()

    referenceTrack = self._insar.loadTrack(reference=True)
    #secondaryTrack = self._insar.loadTrack(reference=False)

    demFile = os.path.abspath(self._insar.demGeo)

    sdDir = 'sd'
    os.makedirs(sdDir, exist_ok=True)
    os.chdir(sdDir)

    if self.geocodeListSd == None:
        geocodeList = self._insar.multilookCoherenceSd + self._insar.azimuthDeformationSd + self._insar.maskedAzimuthDeformationSd
    else:
        geocodeList = []
        for xxx in self.geocodeListSd:
            geocodeList += glob.glob(xxx)

    if self.bbox == None:
        bbox = getBboxGeo(referenceTrack)
    else:
        bbox = self.bbox
    catalog.addItem('geocode bounding box', bbox, 'runGeocodeSd')

    numberRangeLooks = self._insar.numberRangeLooks1 * self._insar.numberRangeLooksSd
    numberAzimuthLooks = self._insar.numberAzimuthLooks1 * self._insar.numberAzimuthLooksSd

    for inputFile in geocodeList:
        if self.geocodeInterpMethodSd == None:
            img = isceobj.createImage()
            img.load(inputFile + '.xml')
            if img.dataType.upper() == 'CFLOAT':
                interpMethod = 'sinc'
            else:
                interpMethod = 'bilinear'
        else:
            interpMethod = self.geocodeInterpMethodSd.lower()

        geocode(referenceTrack, demFile, inputFile, bbox, numberRangeLooks, numberAzimuthLooks, interpMethod, 0, 0)


    os.chdir('../')

    catalog.printToLog(logger, "runGeocodeSd")
    self._insar.procDoc.addAllFromCatalog(catalog)
Example #3
0
    #######################################################

    demFile = os.path.abspath(demGeo)
    trackReferenceStack = loadProduct(ref_date_stack_track)

    #compute bounding box for geocoding
    if bbox is not None:
        bbox = [float(x) for x in bbox.split('/')]
        if len(bbox) != 4:
            raise Exception('user input bbox must have four elements')
    else:
        img = isceobj.createImage()
        img.load(inputFile + '.xml')
        bbox = getBboxGeo(trackReferenceStack,
                          useTrackOnly=True,
                          numberOfSamples=img.width,
                          numberOfLines=img.length,
                          numberRangeLooks=numberRangeLooks,
                          numberAzimuthLooks=numberAzimuthLooks)
    print(
        '====================================================================================================='
    )
    print('geocode bounding box: {}'.format(bbox))
    print(
        '====================================================================================================='
    )

    interpMethod = geocodeInterpMethod
    geocode(trackReferenceStack, demFile, inputFile, bbox, numberRangeLooks,
            numberAzimuthLooks, interpMethod, 0, 0)