예제 #1
0
 def createImages(self):
     
     if self.heightSchImage is None and not self.heightSchFilename == '':
         self.heightSchImage = IF.createImage()
         accessMode = 'read'
         dataType = 'FLOAT'
         width = self.width
         self.heightSchImage.initImage(
             self.heightSchFilename, accessMode, width, dataType
         )
     elif self.heightSchImage is None:
         # this should never happen, atleast when using the  
         # correct method. same for other images
         self.logger.error(
         'Must either pass the heightSchImage in the call or set self.heightSchFilename.'
         )
         raise Exception
     
     if (
         self.topophaseFlatImage is None and
         not self.topophaseFlatFilename == ''
         ):
         self.topophaseFlatImage = IF.createIntImage()
         accessMode = 'write'
         width = self.width
         self.topophaseFlatImage.initImage(self.topophaseFlatFilename,
                                           accessMode,
                                           width)
     elif self.topophaseFlatImage is None:
         self.logger.error(
             'Must either pass the topophaseFlatImage in the call or set self.topophaseMphFilename.'
             )
     
     if (
         self.topophaseMphImage is None and
         not self.topophaseMphFilename == ''
         ):
         self.topophaseMphImage = IF.createIntImage()
         accessMode = 'write'
         width = self.width
         self.topophaseMphImage.initImage(self.topophaseMphFilename,
                                          accessMode,
                                          width)
     elif self.topophaseMphImage is None:
         self.logger.error(
             'Must either pass the topophaseMphImage in the call or set self.topophaseMphFilename.'
             )
         #one way or another when it gets here the images better be defined
     self.intImage.createImage()#this is passed but call createImage and finalizeImage from here
     self.heightSchImage.createImage()
     self.topophaseFlatImage.createImage()
     self.topophaseMphImage.createImage()
예제 #2
0
def main():
    #need actual or soft link to alos.int and dem.la
    referenceOrbit = sys.argv[1]  #look for reference_orbit.txt
    fin1 = open(referenceOrbit)
    allLines = fin1.readlines()
    s_mocomp = []
    for line in allLines:
        lineS = line.split()
        s_mocomp.append(float(lineS[2]))
    fin1.close()
    from isceobj import Image as IF

    demNameXml = 'la.dem.xml'
    from iscesys.Parsers.FileParserFactory import createFileParser
    parser = createFileParser('xml')
    #get the properties from the file init file
    prop = parser.parse(demNameXml)[0]
    objDem = IF.createDemImage()
    objDem.initProperties(prop)
    objDem.createImage()
    obj = Topo()
    obj.setReferenceOrbit(s_mocomp)
    intImage = IF.createIntImage()
    width = 1328
    filename = 'alos.int'
    intImage.initImage(filename, 'read', width)
    intImage.createImage()
    obj.wireInputPort(name='interferogram', object=intImage)
    obj.wireInputPort(name='dem', object=objDem)
    obj.pegLatitude = 0.58936848339144254
    obj.pegLongitude = -2.1172133973559606
    obj.pegHeading = -0.22703294510994310
    obj.planetLocalRadius = 6356638.1714100000
    # Frame information
    obj.slantRangePixelSpacing = 9.3685142500000005
    obj.prf = 1930.502000000000
    obj.radarWavelength = 0.23605699999999999
    obj.rangeFirstSample = 750933.00000000000
    # Doppler information
    # Make_raw information
    obj.spacecraftHeight = 698594.96239000000
    obj.bodyFixedVelocity = 7595.2060428100003
    obj.isMocomp = 3072
    obj.numberRangeLooks = 1
    obj.numberAzimuthLooks = 4
    obj.dopplerCentroidConstantTerm = .0690595
    obj.topo()
    minLat = obj.getMinimumLatitude()
    maxLat = obj.getMaximumLatitude()
    minLon = obj.getMinimumLongitude()
    maxLon = obj.getMaximumLongitude()
    azspace = obj.getAzimuthSpacing()
    s0 = obj.getSCoordinateFirstLine()
    print(minLat, maxLat, minLon, maxLon, azspace, s0)
    #squintShift = obj.getSquintShift()
    #for el in squintShift:
    #print(el)
    intImage.finalizeImage()
    objDem.finalizeImage()
예제 #3
0
def main():
    #need actual or soft link to alos.int and dem.la
    referenceOrbit = sys.argv[1] #look for reference_orbit.txt
    fin1 = open(referenceOrbit)
    allLines = fin1.readlines()
    s_mocomp = []
    for line in allLines:
        lineS = line.split()
        s_mocomp.append(float(lineS[2]))
    fin1.close()
    
  
    fp1 = open(sys.argv[3])#mocompbaseline.out
    fp2 = open(sys.argv[4])#mocomppositions.out
    all1 = fp1.readlines()
    all2 = fp2.readlines()
    fp1.close()
    fp2.close()
    mocbase = []
    midpoint = []
    for line in all1:
        ls = line.split()
        mocbase.append([float(ls[1]),float(ls[2]),float(ls[3])])
        midpoint.append([float(ls[5]),float(ls[6]),float(ls[7])])

    sch1 = []
    sch2 = []
    sc = []
    for line in all2:
        ls = line.split()
        sch1.append([float(ls[0]),float(ls[1]),float(ls[2])])
        sch2.append([float(ls[3]),float(ls[4]),float(ls[5])])
        sc.append([float(ls[6]),float(ls[7]),float(ls[8])])

    from  isceobj import Image as IF
    
    obj = Correct()
    obj.setReferenceOrbit(s_mocomp)
    obj.setMocompBaseline(mocbase)
    obj.setMidpoint(midpoint)
    obj.setSch1(sch1)
    obj.setSch2(sch2)
    obj.setSc(sc)
    intImage = IF.createIntImage()
    width = 1328
    filename = 'alos.int'
    intImage.initImage(filename,'read',width)
    intImage.createImage()       
    obj.wireInputPort(name='interferogram',object=intImage)    
    obj.pegLatitude = 0.58936848339144254
    obj.pegLongitude = -2.1172133973559606
    obj.pegHeading = -0.22703294510994310
    obj.planetLocalRadius = 6356638.1714100000
    # Frame information
    obj.slantRangePixelSpacing =  9.3685142500000005
    obj.prf = 1930.502000000000
    obj.radarWavelength =  0.23605699999999999 
    obj.rangeFirstSample =   750933.00000000000
    # Doppler information
    # Make_raw information
    obj.spacecraftHeight = 698594.96239000000
    obj.bodyFixedVelocity = 7595.2060428100003
    obj.isMocomp = 3072
    obj.numberRangeLooks = 1
    obj.numberAzimuthLooks = 4 
    obj.dopplerCentroidConstantTerm = .0690595
    obj.setHeightSchFilename('zsch')
    obj.setTopophaseFlatFilename('topophase.flat')
    obj.setTopophaseMphFilename('topophase.mph')
    obj.correct()
    #squintShift = obj.getSquintShift()
    #for el in squintShift:
        #print(el)
    intImage.finalizeImage()
예제 #4
0
파일: Correct.py 프로젝트: zybbbbbox/isce2
    def createImages(self):

        if self.heightSchImage is None and not self.heightSchFilename == '':
            self.heightSchImage = IF.createImage()
            accessMode = 'read'
            dataType = 'FLOAT'
            width = self.width
            self.heightSchImage.initImage(self.heightSchFilename, accessMode,
                                          width, dataType)
        elif self.heightSchImage is None:
            # this should never happen, atleast when using the
            # correct method. same for other images
            self.logger.error(
                'Must either pass the heightSchImage in the call or set self.heightSchFilename.'
            )
            raise Exception

        if self.intImage is not None:
            if (self.topophaseFlatImage is None
                    and not self.topophaseFlatFilename == ''):
                self.topophaseFlatImage = IF.createIntImage()
                accessMode = 'write'
                width = self.width
                self.topophaseFlatImage.initImage(self.topophaseFlatFilename,
                                                  accessMode, width)
            elif self.topophaseFlatImage is None:
                self.logger.error(
                    'Must either pass the topophaseFlatImage in the call or set self.topophaseMphFilename.'
                )

        if (self.topophaseMphImage is None
                and not self.topophaseMphFilename == ''):
            self.topophaseMphImage = IF.createIntImage()
            accessMode = 'write'
            width = self.width
            self.topophaseMphImage.initImage(self.topophaseMphFilename,
                                             accessMode, width)
        elif self.topophaseMphImage is None:
            self.logger.error(
                'Must either pass the topophaseMphImage in the call or set self.topophaseMphFilename.'
            )

        if self.dumpRangeFiles:
            if (self.slaveRangeImage is None
                    and not self.slaveRangeFilename == ''):
                self.slaveRangeImage = IF.createImage()
                self.slaveRangeImage.setFilename(self.slaveRangeFilename)
                self.slaveRangeImage.setAccessMode('write')
                self.slaveRangeImage.dataType = 'FLOAT'
                self.slaveRangeImage.setWidth(self.width)
                self.slaveRangeImage.bands = 1
                self.slaveRangeImage.scheme = 'BIL'

            if (self.masterRangeImage is None
                    and not self.masterRangeFilename == ''):
                self.masterRangeImage = IF.createImage()
                self.masterRangeImage.setFilename(self.masterRangeFilename)
                self.masterRangeImage.setAccessMode('write')
                self.masterRangeImage.dataType = 'FLOAT'
                self.masterRangeImage.setWidth(self.width)
                self.masterRangeImage.bands = 1
                self.masterRangeImage.scheme = 'BIL'

        if self.polyDoppler is None:
            self.logger.error(
                'Must pass doppler polynomial in the call to correct')

            #one way or another when it gets here the images better be defined
        if self.intImage is not None:
            self.intImage.createImage(
            )  #this is passed but call createImage and finalizeImage from here
            self.topophaseFlatImage.createImage()

        self.heightSchImage.createImage()
        self.topophaseMphImage.createImage()

        if self.dumpRangeFiles:
            self.masterRangeImage.createImage()
            self.slaveRangeImage.createImage()

        self.polyDoppler.createPoly2D()