def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginLabelitv1_1.postProcess(self, _edObject) self.DEBUG("EDPluginLabelitIndexingv1_1.postProcess...") strLabelitLog = self.readProcessLogFile() if (strLabelitLog is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataLabelitScreenOutput = self.parseLabelitScreenOutput(strLabelitLog) if xsDataLabelitScreenOutput is None: strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Cannot parse output" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber() if (xsDataIntegerSelectedSolutionNumber is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : No selected solution" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: strLabelitMosflmScriptsOutput = self.readProcessFile(self.generateMosflmScriptName(xsDataIntegerSelectedSolutionNumber.getValue())) xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput(strLabelitMosflmScriptsOutput) # Path to log file xsDataLabelitScreenOutput.setPathToLogFile(XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())))) self.dataOutput.screenOutput = xsDataLabelitScreenOutput self.dataOutput.mosflmScriptsOutput = xsDataLabelitMosflmScriptsOutput
def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginLabelitv1_1.postProcess(self, _edObject) EDVerbose.DEBUG("EDPluginLabelitIndexingv1_1.postProcess...") strLabelitLog = self.readProcessLogFile() if (strLabelitLog is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Could not read the Labelit log file" EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataLabelitScreenOutput = self.parseLabelitScreenOutput(strLabelitLog) if xsDataLabelitScreenOutput is None: strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Cannot parse output" EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber() if (xsDataIntegerSelectedSolutionNumber is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : No selected solution" EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: strLabelitMosflmScriptsOutput = self.readProcessFile(self.generateMosflmScriptName(xsDataIntegerSelectedSolutionNumber.getValue())) xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput(strLabelitMosflmScriptsOutput) self.setDataOutput(xsDataLabelitScreenOutput, "labelitScreenOutput") self.setDataOutput(xsDataLabelitMosflmScriptsOutput, "mosflmScriptsOutput")
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) self.DEBUG("EDPluginLabelitIndexingv1_1.preProcess...") strCommandLabelit = "--index_only" if len(self.dataInput.image) > 2: file = open( os.path.join(self.getWorkingDirectory(), "dataset_preferences.py"), "w") file.write("wedgelimit={0}\n".format(len(self.dataInput.image))) file.close() for xsDataImage in self.dataInput.image: strCommandLabelit = strCommandLabelit + " " + xsDataImage.getPath( ).getValue() self.setScriptCommandline(strCommandLabelit) if self.dataInput.forcedSpaceGroup is not None: self.strForcedSpaceGroup = self.dataInput.forcedSpaceGroup.value if self.strForcedSpaceGroup != "": strScriptCommandline = self.getScriptCommandline() self.setScriptCommandline( "known_symmetry=%s %s" % (self.strForcedSpaceGroup, strScriptCommandline)) self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript()) self.addListCommandPostExecution( "[ -f \"LABELIT_possible\" ] && labelit.mosflm_scripts") # Force name of log file self.setScriptLogFileName( self.compactPluginName(self.getClassName()) + ".log")
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) EDVerbose.DEBUG("EDPluginLabelitDistlv1_1.preProcess...") self.setScriptExecutable("labelit.distl") self.initaliseLabelitCommandLine() self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript())
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) self.DEBUG("EDPluginLabelitDistlv1_1.preProcess...") self.setScriptExecutable("labelit.distl") self.initaliseLabelitCommandLine() self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript())
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) EDVerbose.DEBUG("EDPluginLabelitIndexingv1_1.preProcess...") self.setScriptExecutable("labelit.screen") self.initaliseLabelitCommandLine() if self.hasDataInput("forcedSpaceGroup"): self.__strForcedSpaceGroup = self.getDataInput("forcedSpaceGroup")[0].getValue() strScriptCommandline = self.getScriptCommandline() self.setScriptCommandline("known_symmetry=%s %s" % (self.__strForcedSpaceGroup, strScriptCommandline)) self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript()) self.addListCommandPostExecution("[ -f \"LABELIT_possible\" ] && labelit.mosflm_scripts")
def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginLabelitv1_1.postProcess(self, _edObject) EDVerbose.DEBUG("EDPluginLabelitDistlv1_1.postProcess") strLabelitDistlLog = self.readProcessLogFile() if (strLabelitDistlLog is None): strErrorMessage = "EDPluginLabelitDistlv1_1.postProcess : Could not read the Labelit log file" EDVerbose.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataImageQualityIndicators = self.parseLabelitDistlOutput(strLabelitDistlLog) xsDataImage = self.getDataInput("referenceImage")[0] xsDataImageQualityIndicators.setImage(xsDataImage) self.setDataOutput(xsDataImageQualityIndicators, "imageQualityIndicators")
def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginLabelitv1_1.postProcess(self, _edObject) self.DEBUG("EDPluginLabelitDistlv1_1.postProcess") strLabelitDistlLog = self.readProcessLogFile() if (strLabelitDistlLog is None): strErrorMessage = "EDPluginLabelitDistlv1_1.postProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataImageQualityIndicators = self.parseLabelitDistlOutput(strLabelitDistlLog) xsDataImage = self.getDataInput("referenceImage")[0] xsDataImageQualityIndicators.setImage(xsDataImage) self.setDataOutput(xsDataImageQualityIndicators, "imageQualityIndicators")
def postProcess(self, _edObject=None): """ Parses the labelit.screen log file and the generated MOSFLM script """ EDPluginLabelitv1_1.postProcess(self, _edObject) self.DEBUG("EDPluginLabelitIndexingv1_1.postProcess...") strLabelitLog = self.readProcessLogFile() if (strLabelitLog is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Could not read the Labelit log file" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataLabelitScreenOutput = self.parseLabelitScreenOutput( strLabelitLog) if xsDataLabelitScreenOutput is None: strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : Cannot parse output" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: xsDataIntegerSelectedSolutionNumber = xsDataLabelitScreenOutput.getSelectedSolutionNumber( ) if (xsDataIntegerSelectedSolutionNumber is None): strErrorMessage = "EDPluginLabelitIndexingv1_1.postProcess : No selected solution" self.error(strErrorMessage) self.addErrorMessage(strErrorMessage) self.setFailure() else: strLabelitMosflmScriptsOutput = self.readProcessFile( self.generateMosflmScriptName( xsDataIntegerSelectedSolutionNumber.getValue())) xsDataLabelitMosflmScriptsOutput = self.parseMosflmScriptsOutput( strLabelitMosflmScriptsOutput) # Path to log file xsDataLabelitScreenOutput.setPathToLogFile( XSDataFile( XSDataString( os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())))) self.setDataOutput(xsDataLabelitScreenOutput, "labelitScreenOutput") self.setDataOutput(xsDataLabelitMosflmScriptsOutput, "mosflmScriptsOutput")
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) self.DEBUG("EDPluginLabelitIndexingv1_1.preProcess...") self.setScriptExecutable("labelit.screen") self.initaliseLabelitCommandLine() if self.hasDataInput("forcedSpaceGroup"): self.__strForcedSpaceGroup = self.getDataInput( "forcedSpaceGroup")[0].getValue() strScriptCommandline = self.getScriptCommandline() self.setScriptCommandline( "known_symmetry=%s %s" % (self.__strForcedSpaceGroup, strScriptCommandline)) self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript()) self.addListCommandPostExecution( "[ -f \"LABELIT_possible\" ] && labelit.mosflm_scripts") # Force name of log file self.setScriptLogFileName( self.compactPluginName(self.getClassName()) + ".log")
def preProcess(self, _edObject=None): """ Sets up the Labelit command line """ EDPluginLabelitv1_1.preProcess(self, _edObject) self.DEBUG("EDPluginLabelitIndexingv1_1.preProcess...") strCommandLabelit = "--index_only" if len(self.dataInput.image) > 2: file = open(os.path.join(self.getWorkingDirectory(), "dataset_preferences.py"), "w") file.write("wedgelimit={0}\n".format(len(self.dataInput.image))) file.close() for xsDataImage in self.dataInput.image: strCommandLabelit = strCommandLabelit + " " + xsDataImage.getPath().getValue() self.setScriptCommandline(strCommandLabelit) if self.dataInput.forcedSpaceGroup is not None: self.strForcedSpaceGroup = self.dataInput.forcedSpaceGroup.value if self.strForcedSpaceGroup != "": strScriptCommandline = self.getScriptCommandline() self.setScriptCommandline("known_symmetry=%s %s" % (self.strForcedSpaceGroup, strScriptCommandline)) self.addListCommandPreExecution("export PYTHONPATH=\"\" ") self.addListCommandPreExecution(". %s" % self.getPathToLabelitSetpathScript()) self.addListCommandPostExecution("[ -f \"LABELIT_possible\" ] && labelit.mosflm_scripts") # Force name of log file self.setScriptLogFileName(self.compactPluginName(self.getClassName()) + ".log")
def __init__(self): EDPluginLabelitv1_1.__init__(self) self.setXSDataInputClass(XSDataString, "forcedSpaceGroup") self.__strForcedSpaceGroup = None
def __init__(self): EDPluginLabelitv1_1.__init__(self) self.setXSDataInputClass(XSDataInputLabelitIndexing) self.setDataOutput(XSDataResultLabelitIndexing()) self.strForcedSpaceGroup = None