def runResamp_only(self): imageInt = self._insar.getResampIntImage() imageAmp = self._insar.getResampAmpImage() objInt = isceobj.createIntImage() objIntOut = isceobj.createIntImage() IU.copyAttributes(imageInt, objInt) IU.copyAttributes(imageInt, objIntOut) outIntFilename = self._insar.getResampOnlyImageName() objInt.setAccessMode('read') objIntOut.setFilename(outIntFilename) self._insar.setResampOnlyImage(objIntOut) objIntOut.setAccessMode('write') objInt.createImage() objIntOut.createImage() objAmp = isceobj.createAmpImage() objAmpOut = isceobj.createAmpImage() IU.copyAttributes(imageAmp, objAmp) IU.copyAttributes(imageAmp, objAmpOut) outAmpFilename = self.insar.resampOnlyAmpName objAmp.setAccessMode('read') objAmpOut.setFilename(outAmpFilename) self._insar.setResampOnlyAmp(objAmpOut) objAmpOut.setAccessMode('write') objAmp.createImage() objAmpOut.createImage() numRangeBin = objInt.getWidth() lines = objInt.getLength() instrument = self._insar.getMasterFrame().getInstrument() offsetField = self._insar.getRefinedOffsetField() dopplerCoeff = self._insar.getDopplerCentroid().getDopplerCoefficients( inHz=False) numFitCoeff = self._insar.getNumberFitCoefficients() pixelSpacing = self._insar.getSlantRangePixelSpacing() objResamp = stdproc.createResamp_only() objResamp.setNumberLines(lines) objResamp.setNumberFitCoefficients(numFitCoeff) objResamp.setSlantRangePixelSpacing(pixelSpacing) objResamp.setNumberRangeBin(numRangeBin) objResamp.setDopplerCentroidCoefficients(dopplerCoeff) objResamp.wireInputPort(name='offsets', object=offsetField) objResamp.wireInputPort(name='instrument', object=instrument) #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 self._stdWriter.setFileTag("resamp_only", "log") self._stdWriter.setFileTag("resamp_only", "err") self._stdWriter.setFileTag("resamp_only", "out") objResamp.setStdWriter(self._stdWriter) objResamp.resamp_only(objInt, objIntOut, objAmp, objAmpOut) # Record the inputs and outputs from isceobj.Catalog import recordInputsAndOutputs recordInputsAndOutputs(self._insar.procDoc, objResamp, "runResamp_only", \ logger, "runResamp_only") objInt.finalizeImage() objIntOut.finalizeImage() objAmp.finalizeImage() objAmpOut.finalizeImage()
def run(imageInt, imageAmp, instrument, offsetField, infos, stdWriter, catalog=None, sceneid='NO_ID'): logger.info("Running Resamp_only: %s" % sceneid) objInt = isceobj.createIntImage() objIntOut = isceobj.createIntImage() IU.copyAttributes(imageInt, objInt) IU.copyAttributes(imageInt, objIntOut) outIntFilename = infos['outputPath'] + '.' + infos['resampOnlyImageName'] objInt.setAccessMode('read') objIntOut.setFilename(outIntFilename) objIntOut.setAccessMode('write') objInt.createImage() objIntOut.createImage() objAmp = isceobj.createAmpImage() objAmpOut = isceobj.createAmpImage() IU.copyAttributes(imageAmp, objAmp) IU.copyAttributes(imageAmp, objAmpOut) outAmpFilename = outIntFilename.replace('int', 'amp') objAmp.setAccessMode('read') objAmpOut.setFilename(outAmpFilename) objAmpOut.setAccessMode('write') objAmp.createImage() objAmpOut.createImage() numRangeBin = objInt.getWidth() lines = objInt.getLength() dopplerCoeff = infos['dopplerCentroid'].getDopplerCoefficients(inHz=False) objResamp = stdproc.createResamp_only() objResamp.setNumberLines(lines) objResamp.setNumberFitCoefficients(infos['numberFitCoefficients']) objResamp.setSlantRangePixelSpacing(infos['slantRangePixelSpacing']) objResamp.setNumberRangeBin(numRangeBin) objResamp.setDopplerCentroidCoefficients(dopplerCoeff) objResamp.wireInputPort(name='offsets', object=offsetField) objResamp.wireInputPort(name='instrument', object=instrument) #set the tag used in the outfile. each message is precided by this tag #if the writer is not of "file" type the call has no effect objResamp.stdWriter = stdWriter.set_file_tags("resamp_only", "log", "err", "out") objResamp.resamp_only(objInt, objIntOut, objAmp, objAmpOut) if catalog is not None: # Record the inputs and outputs isceobj.Catalog.recordInputsAndOutputs(catalog, objResamp, "runResamp_only.%s" % sceneid, logger, "runResamp_only.%s" % sceneid) objInt.finalizeImage() objIntOut.finalizeImage() objAmp.finalizeImage() objAmpOut.finalizeImage() return objIntOut, objAmpOut