def preProcess(self, _edObject=None): """ Gets the Configuration Parameters, if found, overrides default parameters """ EDPluginControl.preProcess(self, _edObject) self.DEBUG("EDPluginControlGeneratePredictionv10.preProcess...") xsDataGeneratePredictionInput = self.getDataInput() xsDataSelectedIndexingSolution = xsDataGeneratePredictionInput.getSelectedIndexingSolution() xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined() xsDataCollection = xsDataGeneratePredictionInput.getDataCollection() xsDataSubWedgeList = xsDataCollection.getSubWedge() # List containing instances of all the generate prediction plugins self.__listPluginGeneratePrediction = [] # Loop through all subwedges iIndex = 0 for xsDataSubWedge in xsDataSubWedgeList: xsDataImageList = xsDataSubWedge.getImage() # First find the lowest image number iLowestImageNumber = None for xsDataImage in xsDataImageList: iImageNumber = xsDataImage.getNumber().getValue() if (iLowestImageNumber is None): iLowestImageNumber = iImageNumber elif (iImageNumber < iLowestImageNumber): iLowestImageNumber = iImageNumber # Then loop through all images in a sub wedge for xsDataImage in xsDataImageList: iIndex += 1 edPluginGeneratePrediction = self.loadPlugin(self.__strPluginGeneratePredictionName, "%s-%02d" % (self.__strPluginGeneratePredictionName, iIndex)) xsDataGeneratePredictionInput = XSDataGeneratePredictionInput() xsDataGeneratePredictionInput.setSelectedIndexingSolution(XSDataIndexingSolutionSelected.parseString(xsDataSelectedIndexingSolution.marshal())) xsDataCollectionNew = XSDataCollection() xsDataSubWedgeNew = XSDataSubWedge() xsDataSubWedgeNew.addImage(XSDataImage.parseString(xsDataImage.marshal())) xsDataSubWedgeNew.setExperimentalCondition(XSDataExperimentalCondition.parseString(xsDataSubWedge.getExperimentalCondition().marshal())) # We must modify the rotationOscillationStart for the new subwedge xsDataGoniostatNew = xsDataSubWedgeNew.getExperimentalCondition().getGoniostat() fGoniostatRotationAxisStart = xsDataGoniostatNew.getRotationAxisStart().getValue() fGonioStatOscillationRange = xsDataGoniostatNew.getOscillationWidth().getValue() iImageNumber = xsDataImage.getNumber().getValue() fGoniostatRotationAxisStartNew = fGoniostatRotationAxisStart + (iImageNumber - iLowestImageNumber) * fGonioStatOscillationRange xsDataGoniostatNew.setRotationAxisStart(XSDataAngle(fGoniostatRotationAxisStartNew)) # xsDataCollectionNew.addSubWedge(xsDataSubWedgeNew) xsDataGeneratePredictionInput.setDataCollection(xsDataCollectionNew) from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10 xsDataMOSFLMInputGeneratePrediction = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputGeneratePrediction(xsDataGeneratePredictionInput) edPluginGeneratePrediction.setDataInput(xsDataMOSFLMInputGeneratePrediction) self.__listPluginGeneratePrediction.append(edPluginGeneratePrediction)
def preProcess(self, _edObject=None): """ Gets the Configuration Parameters, if found, overrides default parameters """ EDPluginControl.preProcess(self, _edObject) EDVerbose.DEBUG("EDPluginControlGeneratePredictionv10.preProcess...") xsDataGeneratePredictionInput = self.getDataInput() xsDataSelectedIndexingSolution = xsDataGeneratePredictionInput.getSelectedIndexingSolution( ) xsDataExperimentalConditionRefined = xsDataSelectedIndexingSolution.getExperimentalConditionRefined( ) xsDataCollection = xsDataGeneratePredictionInput.getDataCollection() xsDataSubWedgeList = xsDataCollection.getSubWedge() # List containing instances of all the generate prediction plugins self.__listPluginGeneratePrediction = [] # Loop through all subwedges iIndex = 0 for xsDataSubWedge in xsDataSubWedgeList: xsDataImageList = xsDataSubWedge.getImage() # First find the lowest image number iLowestImageNumber = None for xsDataImage in xsDataImageList: iImageNumber = xsDataImage.getNumber().getValue() if (iLowestImageNumber is None): iLowestImageNumber = iImageNumber elif (iImageNumber < iLowestImageNumber): iLowestImageNumber = iImageNumber # Then loop through all images in a sub wedge for xsDataImage in xsDataImageList: iIndex += 1 edPluginGeneratePrediction = self.loadPlugin( self.__strPluginGeneratePredictionName, "%s-%02d" % (self.__strPluginGeneratePredictionName, iIndex)) xsDataGeneratePredictionInput = XSDataGeneratePredictionInput() xsDataGeneratePredictionInput.setSelectedIndexingSolution( XSDataIndexingSolutionSelected.parseString( xsDataSelectedIndexingSolution.marshal())) xsDataCollectionNew = XSDataCollection() xsDataSubWedgeNew = XSDataSubWedge() xsDataSubWedgeNew.addImage( XSDataImage.parseString(xsDataImage.marshal())) xsDataSubWedgeNew.setExperimentalCondition( XSDataExperimentalCondition.parseString( xsDataSubWedge.getExperimentalCondition().marshal())) # We must modify the rotationOscillationStart for the new subwedge xsDataGoniostatNew = xsDataSubWedgeNew.getExperimentalCondition( ).getGoniostat() fGoniostatRotationAxisStart = xsDataGoniostatNew.getRotationAxisStart( ).getValue() fGonioStatOscillationRange = xsDataGoniostatNew.getOscillationWidth( ).getValue() iImageNumber = xsDataImage.getNumber().getValue() fGoniostatRotationAxisStartNew = fGoniostatRotationAxisStart + ( iImageNumber - iLowestImageNumber) * fGonioStatOscillationRange xsDataGoniostatNew.setRotationAxisStart( XSDataAngle(fGoniostatRotationAxisStartNew)) # xsDataCollectionNew.addSubWedge(xsDataSubWedgeNew) xsDataGeneratePredictionInput.setDataCollection( xsDataCollectionNew) from EDHandlerXSDataMOSFLMv10 import EDHandlerXSDataMOSFLMv10 xsDataMOSFLMInputGeneratePrediction = EDHandlerXSDataMOSFLMv10.generateXSDataMOSFLMInputGeneratePrediction( xsDataGeneratePredictionInput) edPluginGeneratePrediction.setDataInput( xsDataMOSFLMInputGeneratePrediction) self.__listPluginGeneratePrediction.append( edPluginGeneratePrediction)