def main(self): import time timeStart = time.time() super(Dpm, self).main() # self.runCorrect() self.runShadecpx2rg() self.runRgoffset() # Cull offoutliers self.iterate_runOffoutliers() self.runResamp_only() self.insar.topoIntImage = self.insar.resampOnlyImage self.runTopo() self.runCorrect() # Coherence ? self.runCoherence(method=self.correlation_method) #ouput the procDoc and pause in order to process coherence off line #this processing should really be done using _steps. self.insar.procDoc.renderXml() pause(message="Paused in main") # Filter ? self.runFilter() # Unwrap ? self.verifyUnwrap() # Geocode self.geocodeCorIfg() timeEnd = time.time() logger.info("Total Time: %i seconds" % (timeEnd - timeStart)) self.insar.procDoc.renderXml() return None
def runGeocode4rlks(self, inFilename, widthIn, geoFilename, demcropFilename): import stdproc from isceobj import createIntImage, createImage print("runGeocode4rlks: inFilename, widthIn = ", inFilename, widthIn) print("runGeocode4rlks: geoFilename, demcropFilename = ", geoFilename, demcropFilename) pause(message="Paused in runGeocode4rlks") logger.info("Geocoding Image") # Initialize the Dem from isceobj import createDemImage demImage = createDemImage() IU.copyAttributes(self.insar.demImage, demImage) demImage.setAccessMode('read') demImage.createImage() print("demImage.firstLatitude = ", demImage.firstLatitude) print("demImage.firstLongitude = ", demImage.firstLongitude) print("demImage.deltaLatitude = ", demImage.deltaLatitude) print("demImage.deltaLongitude = ", demImage.deltaLongitude) print("demImage.width = ", demImage.width) print("demImage.length = ", demImage.length) demImage_lastLatitude = ( demImage.firstLatitude + (demImage.length - 1) * demImage.deltaLatitude) demImage_lastLongitude = ( demImage.firstLongitude + (demImage.width - 1) * demImage.deltaLongitude) print("demImage_lastLatitude = ", demImage_lastLatitude) print("demImage_lastLongitude = ", demImage_lastLongitude) # Initialize the input image intImage = createIntImage() intImage.setFilename(inFilename) intImage.setWidth(widthIn) intImage.setAccessMode('read') intImage.createImage() minLat, maxLat, minLon, maxLon = self.insar.topo.snwe print("objTopo.minLat = ", minLat) print("objTopo.minLon = ", minLon) print("objTopo.maxLat = ", maxLat) print("objTopo.maxLon = ", maxLon) pause(message="Paused in runGeocode4rlks") planet = self.insar.masterFrame.instrument.getPlatform().getPlanet() objGeo = stdproc.createGeocode() objGeo.listInputPorts() objGeo.wireInputPort(name='peg', object=self.insar.peg) # objGeo.wireInputPort(name='frame',object=self.insar.masterFrame) objGeo.rangeFirstSample = self.insar.masterFrame.getStartingRange() objGeo.slantRangePixelSpacing = self.insar.masterFrame.instrument.getRangePixelSize( ) * 4 objGeo.prf = self.insar.masterFrame.instrument.getPulseRepetitionFrequency( ) objGeo.radarWavelength = self.insar.masterFrame.instrument.getRadarWavelength( ) objGeo.wireInputPort(name='planet', object=planet) objGeo.wireInputPort(name='dem', object=demImage) objGeo.wireInputPort(name='interferogram', object=intImage) print("self.geoPosting = ", self.geoPosting) objGeo.wireInputPort(name='geoPosting', object=self.geoPosting) objGeo.snwe = minLat, maxLat, minLon, maxLon objGeo.setGeocodeFilename(geoFilename) objGeo.setDemCropFilename(demcropFilename) #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 objGeo.stdWriter = self.stdWriter.set_file_tags( "geocode", "log", "err", "out") # see mocompbaseline objFormSlc1 = self.insar.formSLC1 mocompPosition1 = objFormSlc1.getMocompPosition() posIndx = 1 objGeo.setReferenceOrbit(mocompPosition1[posIndx]) prf1 = self.insar.masterFrame.instrument.getPulseRepetitionFrequency() dp = self.insar.dopplerCentroid.getDopplerCoefficients(inHz=False)[0] v = self.insar.procVelocity h = self.insar.averageHeight objGeo.setDopplerCentroidConstantTerm(dp) objGeo.setBodyFixedVelocity(v) objGeo.setSpacecraftHeight(h) objGeo.setNumberRangeLooks(1.0) #self.insar.numberRangeLooks) objGeo.setNumberAzimuthLooks(1.0) #self.insar.numberAzimuthLooks) # I have no idea what ismocomp means goodLines = self.insar.numberValidPulses patchSize = self.insar.patchSize # this variable was hardcoded in geocode.f90 and was equal to (8192 - 2048)/2 is_mocomp = self.insar.is_mocomp # is_mocomp = int((patchSize - goodLines)/2) objGeo.setISMocomp(is_mocomp) objGeo.geocode() print("Input state paraemters to gecode.f90:") print("Minimum Latitude = ", objGeo.minimumLatitude) print("Maximum Latitude = ", objGeo.maximumLatitude) print("Minimum Longitude = ", objGeo.minimumLongitude) print("Maximum Longitude = ", objGeo.maximumLongitude) print("Ellipsoid Major Semi Axis = ", objGeo.ellipsoidMajorSemiAxis) print("Ellipsoid Eccentricity Squared = ", objGeo.ellipsoidEccentricitySquared) print("Peg Latitude = ", objGeo.pegLatitude) print("Peg Longitude = ", objGeo.pegLongitude) print("Peg Heading = ", objGeo.pegHeading) print("Range Pixel Spacing = ", objGeo.slantRangePixelSpacing) print("Range First Sample = ", objGeo.rangeFirstSample) print("Spacecraft Height = ", objGeo.spacecraftHeight) print("Planet Local Radius = ", objGeo.planetLocalRadius) print("Body Fixed Velocity = ", objGeo.bodyFixedVelocity) print("Doppler Centroid Constant Term = ", objGeo.dopplerCentroidConstantTerm) print("PRF = ", objGeo.prf) print("Radar Wavelength = ", objGeo.radarWavelength) print("S Coordinate First Line = ", objGeo.sCoordinateFirstLine) print("Azimuth Spacing = ", objGeo.azimuthSpacing) print("First Latitude = ", objGeo.firstLatitude) print("First Longitude = ", objGeo.firstLongitude) print("Delta Latitude = ", objGeo.deltaLatitude) print("Delta Longitude = ", objGeo.deltaLongitude) print("Length = ", objGeo.length) print("Width = ", objGeo.width) print("Number Range Looks = ", objGeo.numberRangeLooks) print("Number Azimuth Looks = ", objGeo.numberAzimuthLooks) print("Number Points Per DEM Post = ", objGeo.numberPointsPerDemPost) print("Is Mocomp = ", objGeo.isMocomp) print("DEM Width = ", objGeo.demWidth) print("DEM Length = ", objGeo.demLength) # print("Reference Orbit = ", objGeo.referenceOrbit) print("Dim1 Reference Orbit = ", objGeo.dim1_referenceOrbit) intImage.finalizeImage() demImage.finalizeImage() return objGeo