def doSuccessExecSaxsMac(self, _edPlugin=None): self.DEBUG("EDPluginBioSaxsNormalizev1_0.doSuccessExecSaxsMac") self.retrieveSuccessMessages(_edPlugin, "EDPluginBioSaxsNormalizev1_0.doSuccessExecSaxsMac") strEdnaLogFile = os.path.join(self.__edPluginExecSaxsMac.getWorkingDirectory(), self.__edPluginExecSaxsMac.getScriptLogFileName()) self.DEBUG("ExecPlugin log file is in: %s" % strEdnaLogFile) if os.path.isfile(self.strNormalizedImage) and self.isVerboseDebug(): shutil.copy(self.strNormalizedImage, self.strNormalizedImage + ".bak") if os.path.isfile(strEdnaLogFile): shutil.copy(strEdnaLogFile, self.strLogFile) xsLogFile = XSDataFile() xsLogFile.setPath(XSDataString(self.strLogFile)) self.xsdResult.setLogFile(xsLogFile) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.xsdInput.normalizedImage) xsdiMetadata.setOutputImage(self.xsdInput.normalizedImage) xsdiMetadata.setBeamStopDiode(self.xsdInput.experimentSetup.beamStopDiode) xsdiMetadata.setNormalizationFactor(self.xsdInput.experimentSetup.normalizationFactor) xsdiMetadata.setDetector(self.xsdInput.experimentSetup.getDetector()) xsdiMetadata.setMachineCurrent(self.xsdInput.experimentSetup.machineCurrent) xsdiMetadata.setMaskFile(self.xsdInput.experimentSetup.maskFile) xsdiMetadata.setDetectorDistance(self.xsdInput.experimentSetup.detectorDistance) xsdiMetadata.setWavelength(self.xsdInput.experimentSetup.wavelength) xsdiMetadata.setPixelSize_1(self.xsdInput.experimentSetup.pixelSize_1) xsdiMetadata.setPixelSize_2(self.xsdInput.experimentSetup.pixelSize_2) xsdiMetadata.setBeamCenter_1(self.xsdInput.experimentSetup.beamCenter_1) xsdiMetadata.setBeamCenter_2(self.xsdInput.experimentSetup.beamCenter_2) xsdiMetadata.setConcentration(self.xsdInput.sample.concentration) xsdiMetadata.setComments(self.xsdInput.sample.comments) xsdiMetadata.setCode(self.xsdInput.sample.code) self.__edPluginExecMetadata.setDataInput(xsdiMetadata)
def doSuccessWaitMultiFile(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAveragev1_0.doSuccessWaitMultiFile") self.retrieveSuccessMessages( _edPlugin, "EDPluginBioSaxsAveragev1_0.doSuccessWaitMultiFile") self.strProcessLog += "Retrieve metadata from file %s\n" % ( self.integratedImages[0]) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.getIntegratedImage()[0]) xsdiMetadata.setConcentration(self.dataInput.concentration) xsdiMetadata.setComments(self.dataInput.comments) xsdiMetadata.setCode(self.dataInput.code) xsdiMetadata.setDetector(self.dataInput.getDetector()) xsdiMetadata.setDetectorDistance(self.dataInput.detectorDistance) xsdiMetadata.setPixelSize_1(self.dataInput.pixelSize_1) xsdiMetadata.setPixelSize_2(self.dataInput.pixelSize_2) xsdiMetadata.setBeamCenter_1(self.dataInput.beamCenter_1) xsdiMetadata.setBeamCenter_2(self.dataInput.beamCenter_2) xsdiMetadata.setWavelength(self.dataInput.wavelength) xsdiMetadata.setMachineCurrent(self.dataInput.machineCurrent) xsdiMetadata.setMaskFile(self.dataInput.maskFile) xsdiMetadata.setNormalizationFactor(self.dataInput.normalizationFactor) self.__edPluginSaxsGetMetadata.setDataInput(xsdiMetadata) self.__edPluginSaxsGetMetadata.connectSUCCESS(self.doSucessGetMetadata) self.__edPluginSaxsGetMetadata.connectFAILURE( self.doFailureGetMetadata) self.__edPluginSaxsGetMetadata.executeSynchronous()
def doSuccessWaitFile(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAsciiExportv1_0.doSuccessWaitFile") self.retrieveSuccessMessages( _edPlugin, "EDPluginBioSaxsAsciiExportv1_0.doSuccessWaitFile") xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.getIntegratedImage()) self.__edPluginSaxsGetMetadata.setDataInput(xsdiMetadata)
def testCheckParameters(self): xsDataInput = XSDataInputBioSaxsMetadatav1_0() xsDataInput.setInputImage(XSDataImage()) EDVerbose.DEBUG("xsdIn:%s" % xsDataInput.marshal()) edPluginExec = self.createPlugin() edPluginExec.setDataInput(xsDataInput) edPluginExec.checkParameters()
def doSuccessWaitFile(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAzimutIntv1_0.doSuccessWaitFile") self.retrieveSuccessMessages(_edPlugin, "EDPluginBioSaxsAzimutIntv1_0.doSuccessWaitFile") self.strProcessLog += "Retrieve metadata from file %s\n" % (self.normalizedImage) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.normalizedImage) xsdiMetadata.setConcentration(self.sample.concentration) xsdiMetadata.setComments(self.sample.comments) xsdiMetadata.setCode(self.sample.code) xsdiMetadata.setDetector(self.exprimentSetup.getDetector()) xsdiMetadata.setDetectorDistance(self.exprimentSetup.detectorDistance) xsdiMetadata.setPixelSize_1(self.exprimentSetup.pixelSize_1) xsdiMetadata.setPixelSize_2(self.exprimentSetup.pixelSize_2) xsdiMetadata.setBeamCenter_1(self.exprimentSetup.beamCenter_1) xsdiMetadata.setBeamCenter_2(self.exprimentSetup.beamCenter_2) xsdiMetadata.setWavelength(self.exprimentSetup.wavelength) xsdiMetadata.setMachineCurrent(self.exprimentSetup.machineCurrent) xsdiMetadata.setMaskFile(self.exprimentSetup.maskFile) xsdiMetadata.setNormalizationFactor(self.exprimentSetup.normalizationFactor) self.__edPluginSaxsGetMetadata.setDataInput(xsdiMetadata)
def doSuccessWaitFile(self, _edPlugin=None): self.DEBUG("EDPluginBioSaxsAzimutIntv1_3.doSuccessWaitFile") self.retrieveSuccessMessages(_edPlugin, "EDPluginBioSaxsAzimutIntv1_3.doSuccessWaitFile") self.lstProcessLog.append("Retrieve metadata from file %s" % (self.normalizedImage)) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.inputImage = self.dataInput.normalizedImage xsdiMetadata.concentration = self.sample.concentration xsdiMetadata.comments = self.sample.comments xsdiMetadata.code = self.sample.code xsdiMetadata.detector = self.experimentSetup.detector xsdiMetadata.detectorDistance = self.experimentSetup.detectorDistance xsdiMetadata.pixelSize_1 = self.experimentSetup.pixelSize_1 xsdiMetadata.pixelSize_2 = self.experimentSetup.pixelSize_2 xsdiMetadata.beamCenter_1 = self.experimentSetup.beamCenter_1 xsdiMetadata.beamCenter_2 = self.experimentSetup.beamCenter_2 xsdiMetadata.wavelength = self.experimentSetup.wavelength xsdiMetadata.machineCurrent = self.experimentSetup.machineCurrent xsdiMetadata.maskFile = self.experimentSetup.maskFile xsdiMetadata.normalizationFactor = self.experimentSetup.normalizationFactor xsdiMetadata.beamStopDiode = self.experimentSetup.beamStopDiode self.__edPluginMetadata.dataInput = xsdiMetadata
def doSuccessSaxsAdd(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAzimutIntv1_0.doSuccessSaxsAdd") self.retrieveSuccessMessages(_edPlugin, "EDPluginBioSaxsAzimutIntv1_0.doSuccessSaxsAdd") self.xsdResult.setCorrectedImage(self.dataInput.getCorrectedImage()) self.strProcessLog += "Appending metadata to Corrected EDF image '%s'.\n" % (self.correctedImage) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.getCorrectedImage()) xsdiMetadata.setOutputImage(self.dataInput.getCorrectedImage()) xsdiMetadata.setConcentration(self.xsdMetadata.concentration) xsdiMetadata.setComments(self.xsdMetadata.comments) xsdiMetadata.setCode(self.xsdMetadata.code) xsdiMetadata.setDetector(self.xsdMetadata.getDetector()) xsdiMetadata.setDetectorDistance(self.xsdMetadata.detectorDistance) xsdiMetadata.setPixelSize_1(self.xsdMetadata.pixelSize_1) xsdiMetadata.setPixelSize_2(self.xsdMetadata.pixelSize_2) xsdiMetadata.setBeamCenter_1(self.xsdMetadata.beamCenter_1) xsdiMetadata.setBeamCenter_2(self.xsdMetadata.beamCenter_2) xsdiMetadata.setWavelength(self.xsdMetadata.wavelength) xsdiMetadata.setMachineCurrent(self.xsdMetadata.machineCurrent) xsdiMetadata.setMaskFile(self.xsdMetadata.maskFile) xsdiMetadata.setNormalizationFactor(self.xsdMetadata.normalizationFactor) self.__edPluginSaxsSetMetadata.setDataInput(xsdiMetadata)
def doSuccessWaitFile(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAsciiExportv1_1.doSuccessWaitFile") self.retrieveSuccessMessages(_edPlugin, "EDPluginBioSaxsAsciiExportv1_1.doSuccessWaitFile") xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.getIntegratedImage()) if self.dataInput.sample is not None: xsdiMetadata.code = self.dataInput.sample.code xsdiMetadata.concentration = self.dataInput.sample.concentration xsdiMetadata.comments = self.dataInput.sample.comments if self.dataInput.experimentSetup is not None: xsdiMetadata.detector = self.dataInput.experimentSetup.detector xsdiMetadata.detectorDistance = self.dataInput.experimentSetup.detectorDistance # this is deliberately taken out as pixels size are redefined during integration JK # xsdiMetadata.pixelSize_1 = self.dataInput.experimentSetup.pixelSize_1 # xsdiMetadata.pixelSize_2 = self.dataInput.experimentSetup.pixelSize_2 xsdiMetadata.beamCenter_1 = self.dataInput.experimentSetup.beamCenter_1 xsdiMetadata.beamCenter_2 = self.dataInput.experimentSetup.beamCenter_2 xsdiMetadata.beamStopDiode = self.dataInput.experimentSetup.beamStopDiode xsdiMetadata.wavelength = self.dataInput.experimentSetup.wavelength xsdiMetadata.machineCurrent = self.dataInput.experimentSetup.machineCurrent xsdiMetadata.maskFile = self.dataInput.experimentSetup.maskFile xsdiMetadata.normalizationFactor = self.dataInput.experimentSetup.normalizationFactor self.__edPluginSaxsGetMetadata.setDataInput(xsdiMetadata)
def doSuccessSaxsMac(self, _edPlugin=None): EDVerbose.DEBUG("EDPluginBioSaxsAveragev1_0.doSuccessSaxsMac") self.retrieveSuccessMessages( _edPlugin, "EDPluginBioSaxsAveragev1_0.doSuccessSaxsMac") strEdnaLogFile = os.path.join(_edPlugin.getWorkingDirectory(), _edPlugin.getScriptLogFileName()) EDVerbose.DEBUG("ExecPlugin log file is in: %s" % strEdnaLogFile) if os.path.isfile(strEdnaLogFile): shutil.copy(strEdnaLogFile, self.strLogFile) xsLogFile = XSDataFile() xsLogFile.setPath(XSDataString(self.strLogFile)) self.xsdResult.setLogFile(xsLogFile) xsdiMetadata = XSDataInputBioSaxsMetadatav1_0() xsdiMetadata.setInputImage(self.dataInput.getAveragedImage()) xsdiMetadata.setOutputImage(self.dataInput.getAveragedImage()) xsdiMetadata.setConcentration(self.xsdMetadata.concentration) xsdiMetadata.setComments(self.xsdMetadata.comments) xsdiMetadata.setCode(self.xsdMetadata.code) xsdiMetadata.setDetector(self.xsdMetadata.getDetector()) xsdiMetadata.setDetectorDistance(self.xsdMetadata.detectorDistance) xsdiMetadata.setPixelSize_1(self.xsdMetadata.pixelSize_1) xsdiMetadata.setPixelSize_2(self.xsdMetadata.pixelSize_2) xsdiMetadata.setBeamCenter_1(self.xsdMetadata.beamCenter_1) xsdiMetadata.setBeamCenter_2(self.xsdMetadata.beamCenter_2) xsdiMetadata.setWavelength(self.xsdMetadata.wavelength) xsdiMetadata.setMachineCurrent(self.xsdMetadata.machineCurrent) xsdiMetadata.setMaskFile(self.xsdMetadata.maskFile) xsdiMetadata.setNormalizationFactor( self.xsdMetadata.normalizationFactor) self.__edPluginSaxsSetMetadata.setDataInput(xsdiMetadata) self.__edPluginSaxsSetMetadata.connectSUCCESS( self.doSuccessSetMetadata) self.__edPluginSaxsSetMetadata.connectFAILURE( self.doFailureSetMetadata) self.__edPluginSaxsSetMetadata.executeSynchronous()