Exemplo n.º 1
0
    def createImages(self):
        if self.demCropFilename:
            self.demCropImage = createDemImage()
            demAccessMode = 'write'
            demWidth = self.computeGeoImageWidth()
            self.demCropImage.initImage(self.demCropFilename, demAccessMode,
                                        demWidth)
            self.demCropImage.createImage()
            self.demCropAccessor = self.demCropImage.getImagePointer()
        else:
            self.demCropAccessor = 0

        if self.geoFilename is None:
            raise ValueError('Output geoFilename not specified')

        #the topophase files have the same format as the int file. just reuse the previous info
        self.geoImage = createIntImage()
        IU.copyAttributes(self.inputImage, self.geoImage)
        self.geoImage.imageType = self.inputImage.imageType
        self.geoImage.setFilename(self.geoFilename)
        self.geoImage.setAccessMode('write')
        self.geoImage.setWidth(demWidth)

        if not self.geoImage.dataType.upper().count('FLOAT'):
            self.geoImage.setCaster('write', 'FLOAT')

        self.geoImage.createImage()
        self.geoAccessor = self.geoImage.getImagePointer()

        self.polyDopplerAccessor = self.polyDoppler.exportToC()
Exemplo n.º 2
0
    def createImages(self):
        demWidth = self.computeGeoImageWidth()
        demLength = self.computeGeoImageLength()

        if self.demCropFilename:
            self.demCropImage = createDemImage()
            demAccessMode = 'write'
            self.demCropImage.initImage(self.demCropFilename, demAccessMode,
                                        demWidth)
            self.demCropImage.createImage()
            self.demCropAccessor = self.demCropImage.getImagePointer()
        else:
            self.demCropAccessor = 0

        if self.geoFilename is None:
            raise ValueError('Output geoFilename not specified')

        #the topophase files have the same format as the int file. just reuse the previous info
        self.geoImage = createIntImage()
        IU.copyAttributes(self.inputImage, self.geoImage)
        self.geoImage.imageType = self.inputImage.imageType
        self.geoImage.setFilename(self.geoFilename)
        self.geoImage.setAccessMode('write')
        self.geoImage.setWidth(demWidth)
        self.geoImage.coord1.coordEnd = None
        self.geoImage.coord2.coordEnd = None

        if not self.geoImage.dataType.upper().count('FLOAT'):
            self.geoImage.setCaster('write', 'FLOAT')
        self.geoImage.createImage()
        self.geoImage.createFile(demLength)

        self.geoAccessor = self.geoImage.getImagePointer()
        if (self.losImage == None and self.losFilename not in ('', None)):
            self.losImage = createImage()
            accessMode = 'write'
            dataType = 'FLOAT'
            bands = 2
            scheme = 'BIL'
            width = demWidth
            self.losImage.initImage(self.losFilename,
                                    accessMode,
                                    width,
                                    dataType,
                                    bands=bands,
                                    scheme=scheme)
            self.losImage.createImage()
            self.losAccessor = self.losImage.getImagePointer()

        self.polyDopplerAccessor = self.polyDoppler.exportToC()