def exportChildren(self, outfile, level, name_='XSDataResultInterfacev2_2'): XSDataResultInterface.exportChildren(self, outfile, level, name_) if self.__mxv1ResultCharacterisation is not None: self.mxv1ResultCharacterisation.export( outfile, level, name_='mxv1ResultCharacterisation') else: warnEmptyAttribute("mxv1ResultCharacterisation", "XSDataResultCharacterisation") if self.__mxv1ResultCharacterisation_Reference is not None: self.mxv1ResultCharacterisation_Reference.export( outfile, level, name_='mxv1ResultCharacterisation_Reference') if self.__mxv2DataCollection is not None: self.mxv2DataCollection.export(outfile, level, name_='mxv2DataCollection') if self.__mxv2DataCollection_Reference is not None: self.mxv2DataCollection_Reference.export( outfile, level, name_='mxv2DataCollection_Reference') if self.__suggestedStrategy is not None: self.suggestedStrategy.export(outfile, level, name_='suggestedStrategy') if self.__possibleOrientations is not None: self.possibleOrientations.export(outfile, level, name_='possibleOrientations')
def buildChildren(self, child_, nodeName_): if child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'mxv1ResultCharacterisation': obj_ = XSDataResultCharacterisation() obj_.build(child_) self.setMxv1ResultCharacterisation(obj_) elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'mxv1ResultCharacterisation_Reference': obj_ = XSDataResultCharacterisation() obj_.build(child_) self.setMxv1ResultCharacterisation_Reference(obj_) elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'mxv2DataCollection': obj_ = XSDataCollection() obj_.build(child_) self.setMxv2DataCollection(obj_) elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'mxv2DataCollection_Reference': obj_ = XSDataCollection() obj_.build(child_) self.setMxv2DataCollection_Reference(obj_) elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'suggestedStrategy': obj_ = XSDataResultStrategy() obj_.build(child_) self.setSuggestedStrategy(obj_) elif child_.nodeType == Node.ELEMENT_NODE and \ nodeName_ == 'possibleOrientations': obj_ = kappa_alignment_response() obj_.build(child_) self.setPossibleOrientations(obj_) XSDataResultInterface.buildChildren(self, child_, nodeName_)
def __init__(self, resultControlISPyB=None, resultCharacterisation=None, possibleOrientations=None, suggestedStrategy=None, mxv2DataCollection_Reference=None, mxv2DataCollection=None, mxv1ResultCharacterisation_Reference=None, mxv1ResultCharacterisation=None): XSDataResultInterface.__init__(self, resultControlISPyB, resultCharacterisation) checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", mxv1ResultCharacterisation, "XSDataResultCharacterisation") self.__mxv1ResultCharacterisation = mxv1ResultCharacterisation checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", mxv1ResultCharacterisation_Reference, "XSDataResultCharacterisation") self.__mxv1ResultCharacterisation_Reference = mxv1ResultCharacterisation_Reference checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", mxv2DataCollection, "XSDataCollection") self.__mxv2DataCollection = mxv2DataCollection checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", mxv2DataCollection_Reference, "XSDataCollection") self.__mxv2DataCollection_Reference = mxv2DataCollection_Reference checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", suggestedStrategy, "XSDataResultStrategy") self.__suggestedStrategy = suggestedStrategy checkType("XSDataResultInterfacev2_2", "Constructor of XSDataResultInterfacev2_2", possibleOrientations, "kappa_alignment_response") self.__possibleOrientations = possibleOrientations
def exportChildren(self, outfile, level, name_='XSDataResultInterfacev2_2'): XSDataResultInterface.exportChildren(self, outfile, level, name_) if self.__mxv1ResultCharacterisation is not None: self.mxv1ResultCharacterisation.export(outfile, level, name_='mxv1ResultCharacterisation') else: warnEmptyAttribute("mxv1ResultCharacterisation", "XSDataResultCharacterisation") if self.__mxv1ResultCharacterisation_Reference is not None: self.mxv1ResultCharacterisation_Reference.export(outfile, level, name_='mxv1ResultCharacterisation_Reference') if self.__mxv2DataCollection is not None: self.mxv2DataCollection.export(outfile, level, name_='mxv2DataCollection') if self.__mxv2DataCollection_Reference is not None: self.mxv2DataCollection_Reference.export(outfile, level, name_='mxv2DataCollection_Reference') if self.__suggestedStrategy is not None: self.suggestedStrategy.export(outfile, level, name_='suggestedStrategy') if self.__possibleOrientations is not None: self.possibleOrientations.export(outfile, level, name_='possibleOrientations')
def functionXMLout(_strXMLin, _strXMLout): """ This is an example of XMLout function ... it prints only the name of the file created @param _srXMLin: The XML string used to launch the job @type _strXMLin: python string with the input XML @param _strXMLout: The XML string retrieved job @type _strXMLout: python string with the output XML @return: None """ xsDataInputInterface = XSDataInputInterface.parseString(_strXMLin) strImagePath = xsDataInputInterface.getImagePath()[0].getPath().getValue() EDVerbose.screen("Successful processing of image %s" % strImagePath) strResultText = os.path.dirname(strImagePath) + " " + os.path.basename(strImagePath) + " " xsDataResultInterface = XSDataResultInterface.parseString(_strXMLout) xsDataResultCharacterisation = xsDataResultInterface.getResultCharacterisation() # xsDataIndexingResult = xsDataResultCharacterisation.getIndexingResult() #strResultText = _strDirectoryVisit + " " + strFileName + " " if (xsDataIndexingResult is None): strResultText += "Indexing failed" else: xsDataSelectedSolution = xsDataIndexingResult.getSelectedSolution() fMosaicityEstimation = xsDataSelectedSolution.getCrystal().getMosaicity().getValue() strResultText += "Mosaicity: %.2f " % fMosaicityEstimation xsDataStrategyResult = xsDataResultCharacterisation.getStrategyResult() if (xsDataStrategyResult is None): strResultText += "No strategy result" else: xsDataCollectionPlan = xsDataStrategyResult.getCollectionPlan()[0] xsDataStrategySummary = xsDataCollectionPlan.getStrategySummary() fRankingResolution = xsDataStrategySummary.getRankingResolution().getValue() strResultText += "Resolution: %.2f" % fRankingResolution writeToResultFile(strResultText)
def finallyProcess(self, _edPlugin=None): EDPluginControl.finallyProcess(self, _edPlugin) EDVerbose.DEBUG("EDPluginControlInterfacev1_2.finallyProcess...") if (not self.edPluginControlCharacterisation is None): if (self.edPluginControlCharacterisation.hasDataOutput()): self.setDataOutput(self.edPluginControlCharacterisation.getDataOutput(), "characterisation") if (not self.edPluginControlISPyB is None): if (self.edPluginControlISPyB.hasDataOutput()): self.setDataOutput(self.edPluginControlISPyB.getDataOutput(), "ISPyB") if self.hasDataInput(): xsDataResultInterface = XSDataResultInterface() if self.edPluginControlCharacterisation: xsDataResultInterface.setResultCharacterisation(self.edPluginControlCharacterisation.getDataOutput()) if self.edPluginControlISPyB: xsDataResultInterface.setResultControlISPyB(self.edPluginControlISPyB.getDataOutput()) self.setDataOutput(xsDataResultInterface)
def finallyProcess(self, _edPlugin=None): EDPluginControl.finallyProcess(self, _edPlugin) self.DEBUG("EDPluginControlInterfacev1_2.finallyProcess...") if (not self.edPluginControlCharacterisation is None): if (self.edPluginControlCharacterisation.hasDataOutput()): self.setDataOutput(self.edPluginControlCharacterisation.getDataOutput(), "characterisation") if (not self.edPluginControlISPyB is None): if (self.edPluginControlISPyB.hasDataOutput()): self.setDataOutput(self.edPluginControlISPyB.getDataOutput(), "ISPyB") if self.hasDataInput(): xsDataResultInterface = XSDataResultInterface() if self.edPluginControlCharacterisation: xsDataResultInterface.setResultCharacterisation(self.edPluginControlCharacterisation.getDataOutput()) if self.edPluginControlISPyB: xsDataResultInterface.setResultControlISPyB(self.edPluginControlISPyB.getDataOutput()) self.setDataOutput(xsDataResultInterface)
def __init__(self, resultControlISPyB=None, resultCharacterisation=None, possibleOrientations=None, suggestedStrategy=None, mxv2DataCollection_Reference=None, mxv2DataCollection=None, mxv2ResultCharacterisation=None, mxv1ResultCharacterisation_Reference=None, mxv1ResultCharacterisation=None): XSDataResultInterface.__init__(self, resultControlISPyB, resultCharacterisation) if mxv1ResultCharacterisation is None: self._mxv1ResultCharacterisation = None elif mxv1ResultCharacterisation.__class__.__name__ == "XSDataResultCharacterisation": self._mxv1ResultCharacterisation = mxv1ResultCharacterisation else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv1ResultCharacterisation' is not XSDataResultCharacterisation but %s" % self._mxv1ResultCharacterisation.__class__.__name__ raise BaseException(strMessage) if mxv1ResultCharacterisation_Reference is None: self._mxv1ResultCharacterisation_Reference = None elif mxv1ResultCharacterisation_Reference.__class__.__name__ == "XSDataResultCharacterisation": self._mxv1ResultCharacterisation_Reference = mxv1ResultCharacterisation_Reference else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv1ResultCharacterisation_Reference' is not XSDataResultCharacterisation but %s" % self._mxv1ResultCharacterisation_Reference.__class__.__name__ raise BaseException(strMessage) if mxv2ResultCharacterisation is None: self._mxv2ResultCharacterisation = None elif mxv2ResultCharacterisation.__class__.__name__ == "XSDataResultCharacterisationv2_0": self._mxv2ResultCharacterisation = mxv2ResultCharacterisation else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2ResultCharacterisation' is not XSDataResultCharacterisationv2_0 but %s" % self._mxv2ResultCharacterisation.__class__.__name__ raise BaseException(strMessage) if mxv2DataCollection is None: self._mxv2DataCollection = None elif mxv2DataCollection.__class__.__name__ == "XSDataCollection": self._mxv2DataCollection = mxv2DataCollection else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2DataCollection' is not XSDataCollection but %s" % self._mxv2DataCollection.__class__.__name__ raise BaseException(strMessage) if mxv2DataCollection_Reference is None: self._mxv2DataCollection_Reference = None elif mxv2DataCollection_Reference.__class__.__name__ == "XSDataCollection": self._mxv2DataCollection_Reference = mxv2DataCollection_Reference else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2DataCollection_Reference' is not XSDataCollection but %s" % self._mxv2DataCollection_Reference.__class__.__name__ raise BaseException(strMessage) if suggestedStrategy is None: self._suggestedStrategy = None elif suggestedStrategy.__class__.__name__ == "XSDataResultStrategy": self._suggestedStrategy = suggestedStrategy else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'suggestedStrategy' is not XSDataResultStrategy but %s" % self._suggestedStrategy.__class__.__name__ raise BaseException(strMessage) if possibleOrientations is None: self._possibleOrientations = None elif possibleOrientations.__class__.__name__ == "kappa_alignment_response": self._possibleOrientations = possibleOrientations else: strMessage = "ERROR! XSDataResultInterfacev2_2 constructor argument 'possibleOrientations' is not kappa_alignment_response but %s" % self._possibleOrientations.__class__.__name__ raise BaseException(strMessage)
def __init__( self, resultControlISPyB=None, resultCharacterisation=None, possibleOrientations=None, suggestedStrategy=None, mxv2DataCollection_Reference=None, mxv2DataCollection=None, mxv2ResultCharacterisation=None, mxv1ResultCharacterisation_Reference=None, mxv1ResultCharacterisation=None, ): XSDataResultInterface.__init__(self, resultControlISPyB, resultCharacterisation) if mxv1ResultCharacterisation is None: self._mxv1ResultCharacterisation = None elif mxv1ResultCharacterisation.__class__.__name__ == "XSDataResultCharacterisation": self._mxv1ResultCharacterisation = mxv1ResultCharacterisation else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv1ResultCharacterisation' is not XSDataResultCharacterisation but %s" % self._mxv1ResultCharacterisation.__class__.__name__ ) raise BaseException(strMessage) if mxv1ResultCharacterisation_Reference is None: self._mxv1ResultCharacterisation_Reference = None elif mxv1ResultCharacterisation_Reference.__class__.__name__ == "XSDataResultCharacterisation": self._mxv1ResultCharacterisation_Reference = mxv1ResultCharacterisation_Reference else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv1ResultCharacterisation_Reference' is not XSDataResultCharacterisation but %s" % self._mxv1ResultCharacterisation_Reference.__class__.__name__ ) raise BaseException(strMessage) if mxv2ResultCharacterisation is None: self._mxv2ResultCharacterisation = None elif mxv2ResultCharacterisation.__class__.__name__ == "XSDataResultCharacterisationv2_0": self._mxv2ResultCharacterisation = mxv2ResultCharacterisation else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2ResultCharacterisation' is not XSDataResultCharacterisationv2_0 but %s" % self._mxv2ResultCharacterisation.__class__.__name__ ) raise BaseException(strMessage) if mxv2DataCollection is None: self._mxv2DataCollection = None elif mxv2DataCollection.__class__.__name__ == "XSDataCollection": self._mxv2DataCollection = mxv2DataCollection else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2DataCollection' is not XSDataCollection but %s" % self._mxv2DataCollection.__class__.__name__ ) raise BaseException(strMessage) if mxv2DataCollection_Reference is None: self._mxv2DataCollection_Reference = None elif mxv2DataCollection_Reference.__class__.__name__ == "XSDataCollection": self._mxv2DataCollection_Reference = mxv2DataCollection_Reference else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'mxv2DataCollection_Reference' is not XSDataCollection but %s" % self._mxv2DataCollection_Reference.__class__.__name__ ) raise BaseException(strMessage) if suggestedStrategy is None: self._suggestedStrategy = None elif suggestedStrategy.__class__.__name__ == "XSDataResultStrategy": self._suggestedStrategy = suggestedStrategy else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'suggestedStrategy' is not XSDataResultStrategy but %s" % self._suggestedStrategy.__class__.__name__ ) raise BaseException(strMessage) if possibleOrientations is None: self._possibleOrientations = None elif possibleOrientations.__class__.__name__ == "kappa_alignment_response": self._possibleOrientations = possibleOrientations else: strMessage = ( "ERROR! XSDataResultInterfacev2_2 constructor argument 'possibleOrientations' is not kappa_alignment_response but %s" % self._possibleOrientations.__class__.__name__ ) raise BaseException(strMessage)