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 finallyProcess(self, _edObject=None): EDPluginControl.finallyProcess(self, _edObject) EDVerbose.DEBUG("EDPluginControlStrategyv1_2.finallyProcess") if not self.hasDataOutput(): self.setDataOutput(XSDataResultStrategy())
def getXSDataResultStrategy(self, _xsDataResultBest, _xsDataExperimentalCondition, _xsDataSample): xsDataResultStrategy = XSDataResultStrategy() listXSDataBestCollectionPlan = _xsDataResultBest.getCollectionPlan() for xsDataBestCollectionPlan in listXSDataBestCollectionPlan: xsDataCollectionPlan = XSDataCollectionPlan() xsDataCollectionStrategy = XSDataCollection() xsDataBestStrategySummary = xsDataBestCollectionPlan.getStrategySummary( ) xsDataDoubleTransmission = xsDataBestStrategySummary.getTransmission( ) for xsDataBestCollectionRun in xsDataBestCollectionPlan.getCollectionRun( ): xsDataSubWedge = XSDataSubWedge() strXmlStringDataExperimentalCondition = _xsDataExperimentalCondition.marshal( ) xsDataExperimentalCondition = XSDataExperimentalCondition.parseString( strXmlStringDataExperimentalCondition) xsDataExperimentalCondition.getBeam().setExposureTime( xsDataBestCollectionRun.getExposureTime()) if (xsDataBestCollectionRun.getTransmission() is None): xsDataExperimentalCondition.getBeam().setTransmission( xsDataDoubleTransmission) else: xsDataExperimentalCondition.getBeam().setTransmission( xsDataBestCollectionRun.getTransmission()) xsDataExperimentalCondition.getDetector().setDistance( xsDataBestStrategySummary.getDistance()) xsDataExperimentalCondition.getGoniostat( ).setRotationAxisStart(xsDataBestCollectionRun.getPhiStart()) xsDataExperimentalCondition.getGoniostat().setOscillationWidth( xsDataBestCollectionRun.getPhiWidth()) fRotationAxisEnd = xsDataBestCollectionRun.getPhiStart( ).getValue( ) + xsDataBestCollectionRun.getNumberOfImages().getValue( ) * xsDataBestCollectionRun.getPhiWidth().getValue() xsDataExperimentalCondition.getGoniostat().setRotationAxisEnd( XSDataAngle(fRotationAxisEnd)) xsDataSubWedge.setExperimentalCondition( xsDataExperimentalCondition) xsDataSubWedge.setSubWedgeNumber( xsDataBestCollectionRun.getCollectionRunNumber()) if xsDataBestCollectionRun.getCrystalPosition(): xsDataSubWedge.setAction( XSDataString("Crystal position: %d" % xsDataBestCollectionRun. getCrystalPosition().getValue())) else: xsDataSubWedge.setAction( xsDataBestCollectionRun.getAction()) xsDataCollectionStrategy.addSubWedge(xsDataSubWedge) xsDataCollectionStrategy.setSample(_xsDataSample) xsDataCollectionPlan.setCollectionStrategy( xsDataCollectionStrategy) xsDataStrategySummary = XSDataStrategySummary() xsDataStrategySummary.setCompleteness( xsDataBestStrategySummary.getCompleteness()) xsDataStrategySummary.setISigma( xsDataBestStrategySummary.getISigma()) xsDataStrategySummary.setRankingResolution( xsDataBestStrategySummary.getRankingResolution()) xsDataStrategySummary.setRedundancy( xsDataBestStrategySummary.getRedundancy()) xsDataStrategySummary.setResolution( xsDataBestStrategySummary.getResolution()) xsDataStrategySummary.setResolutionReasoning( xsDataBestStrategySummary.getResolutionReasoning()) xsDataStrategySummary.setTotalDataCollectionTime( xsDataBestStrategySummary.getTotalDataCollectionTime()) xsDataStrategySummary.setTotalExposureTime( xsDataBestStrategySummary.getTotalExposureTime()) xsDataCollectionPlan.setStrategySummary(xsDataStrategySummary) if xsDataBestCollectionPlan.getStatisticalPrediction() is not None: xsDataStatisticsStrategy = XSDataStatisticsStrategy.parseString( xsDataBestCollectionPlan.getStatisticalPrediction( ).marshal()) xsDataCollectionPlan.setStatistics(xsDataStatisticsStrategy) xsDataCollectionPlan.setCollectionPlanNumber( xsDataBestCollectionPlan.getCollectionPlanNumber()) xsDataResultStrategy.addCollectionPlan(xsDataCollectionPlan) if _xsDataResultBest.getPathToLogFile() != None: xsDataResultStrategy.setBestLogFile( _xsDataResultBest.getPathToLogFile()) return xsDataResultStrategy
def getXSDataResultStrategy(self, _xsDataResultBest, _xsDataExperimentalCondition, _xsDataSample): xsDataResultStrategy = XSDataResultStrategy() #xsDataCollectionRunsBest = _xsDataResultBest.getCollectionRun() xsDataCollectionPlansBest = _xsDataResultBest.getCollectionPlan() for xsDataCollectionPlanBest in xsDataCollectionPlansBest: xsDataCollectionPlan = XSDataCollectionPlan() xsDataCollectionStrategy = XSDataCollection() xsDataDoubleTransmission = xsDataCollectionPlanBest.getStrategySummary( ).getAttenuation() for xsDataCollectionRunBest in xsDataCollectionPlanBest.getCollectionRun( ): xsDataSubWedge = XSDataSubWedge() strXmlStringDataExperimentalCondition = _xsDataExperimentalCondition.marshal( ) xsDataExperimentalCondition = XSDataExperimentalCondition.parseString( strXmlStringDataExperimentalCondition) xsDataExperimentalCondition.getBeam().setExposureTime( xsDataCollectionRunBest.getExposureTime()) xsDataExperimentalCondition.getBeam().setTransmission( xsDataDoubleTransmission) xsDataExperimentalCondition.getDetector().setDistance( xsDataCollectionRunBest.getDistance()) xsDataExperimentalCondition.getGoniostat( ).setRotationAxisStart(xsDataCollectionRunBest.getPhiStart()) xsDataExperimentalCondition.getGoniostat().setOscillationWidth( xsDataCollectionRunBest.getPhiWidth()) fRotationAxisEnd = xsDataCollectionRunBest.getPhiStart( ).getValue( ) + xsDataCollectionRunBest.getNumberOfImages().getValue( ) * xsDataCollectionRunBest.getPhiWidth().getValue() xsDataExperimentalCondition.getGoniostat().setRotationAxisEnd( XSDataAngle(fRotationAxisEnd)) xsDataSubWedge.setExperimentalCondition( xsDataExperimentalCondition) xsDataSubWedge.setSubWedgeNumber( xsDataCollectionRunBest.getCollectionRunNumber()) xsDataCollectionStrategy.addSubWedge(xsDataSubWedge) xsDataCollectionStrategy.setSample(_xsDataSample) xsDataCollectionPlan.setCollectionStrategy( xsDataCollectionStrategy) xsDataStrategySummary = xsDataCollectionPlanBest.getStrategySummary( ) xsDataCollectionPlan.setStrategySummary(xsDataStrategySummary) xsDataStatistics = xsDataCollectionPlanBest.getStatisticalPrediction( ) xsDataCollectionPlan.setStatistics(xsDataStatistics) xsDataCollectionPlan.setCollectionPlanNumber( xsDataCollectionPlanBest.getCollectionPlanNumber()) xsDataResultStrategy.addCollectionPlan(xsDataCollectionPlan) return xsDataResultStrategy