コード例 #1
0
    def postProcess(self):
        self.DEBUG('Import: postProcess')
        EDPluginControl.postProcess(self)

        res = XSDataEDNAprocImportOut()
        status = XSDataStatus()
        res.status = status
        if self.dataInput.input_noanom:
            all_good = not self.anom.isFailure() and not self.noanom.isFailure()
        else:
            all_good = not self.anom.isFailure()
        status.isSuccess = XSDataBoolean(all_good)
        files = list()
        if not self.anom.isFailure():
            files.append(self.anom.dataInput.output_file)
        if self.dataInput.input_noanom and not self.noanom.isFailure():
            files.append(self.noanom.dataInput.output_file)
        res.files = files

        if self.dataInput.input_noanom:
            res.pointless_sgnumber = self.noanom.dataOutput.pointless_sgnumber
            res.pointless_sgstring = self.noanom.dataOutput.pointless_sgstring
            res.pointless_cell = self.noanom.dataOutput.pointless_cell
        else:
            res.pointless_sgnumber = self.anom.dataOutput.pointless_sgnumber
            res.pointless_sgstring = self.anom.dataOutput.pointless_sgstring
            res.pointless_cell = self.anom.dataOutput.pointless_cell

        res.aimless_log_anom = self.anom.dataOutput.aimless_log

        if self.dataInput.input_noanom:
            res.aimless_log_noanom = self.noanom.dataOutput.aimless_log

        self.dataOutput = res
コード例 #2
0
    def __init__(self):
        """
        """
        EDPluginControl.__init__(self)
        self.setXSDataInputClass(XSDataInputBioSaxsAsciiExportv1_0)
        self.__strControlledPluginSaxsCurves = "EDPluginExecSaxsCurvesv1_0"
        self.__strControlledPluginWaitFile = "EDPluginWaitFile"
        self.__strControlledPluginSaxsGetMetadata = "EDPluginBioSaxsMetadatav1_1"
        self.__edPluginSaxsCurves = None
        self.__edPluginWaitFile = None
        self.__edPluginSaxsGetMetadata = None

        self.integratedImage = None
        self.integratedCurve = None

        self.detector = None
        self.detectorDistance = None
        self.pixelSize_1 = None
        self.pixelSize_2 = None
        self.beamCenter_1 = None
        self.beamCenter_2 = None
        self.beamStopDiode = None
        self.wavelength = None
        self.maskFile = None
        self.normalizationFactor = None
        self.machineCurrent = None

        self.code = None
        self.comments = None
        self.concentration = None

        self.strProcessLog = ""
        self.xsdResult = XSDataResultBioSaxsAsciiExportv1_0()
コード例 #3
0
    def configure(self):
        """
        Gets the configuration parameters (if any). Use the Python name mangling rules for storing the parameters in 
        the private variables of the parent class.
        """
        EDPluginControl.configure(self)
        EDVerbose.DEBUG("EDPluginControlCharForReorientInterfacev2_0.configure")
        pluginConfiguration = self.getConfiguration()
        strUseISPyBPlugin = "false"

        if pluginConfiguration is None:
            EDVerbose.DEBUG("No plugin configuration found for EDPluginControlCharForReorientInterfacev2_0.")
        else:
            if self.getControlledPluginName("subWedgeAssemblePlugin") is not None:
                self._EDPluginControlInterfacev2_0__strEDPluginControlSubWedgeAssembleName = self.getControlledPluginName(
                    "subWedgeAssemblePlugin"
                )
            if self.getControlledPluginName("characterisationPlugin") is not None:
                self._EDPluginControlInterfacev2_0__strEDPluginControlCharacterisationName = self.getControlledPluginName(
                    "characterisationPlugin"
                )
            if self.getControlledPluginName("ispybPlugin") is not None:
                self._EDPluginControlInterfacev2_0__strEDPluginControlISPyBName = self.getControlledPluginName(
                    "ispybPlugin"
                )
            strUseISPyBPlugin = EDConfiguration.getStringParamValue(pluginConfiguration, "useISPyBPlugin")

        if strUseISPyBPlugin.lower() != "true":
            self._EDPluginControlInterfacev2_0__strEDPluginControlISPyBName = None
コード例 #4
0
    def postProcess(self, _edObject=None):
        EDPluginControl.postProcess(self, _edObject)
        EDVerbose.DEBUG("EDPluginControlStrategyv1_2.postProcess...")

        xsDataResultBest = self._edPluginBest.getDataOutput()
        #
        # Create the BEST graphs from the plot mtv file
        #
        xsDataInputPlotGle = XSDataInputPlotGle()
        xsDataInputPlotGle.filePlotMtv = xsDataResultBest.pathToPlotMtvFile
        self._edPluginPlotGle.dataInput = xsDataInputPlotGle
        self._edPluginPlotGle.executeSynchronous()
        # TODO
        # Temporary! Otherwise fails Model from -bonly is different
        xsDataResultStrategy = None
        if(xsDataResultBest is not None and self.getDataInput().getDiffractionPlan().getStrategyOption() is not None):
            if (self.getDataInput().getDiffractionPlan().getStrategyOption().getValue() != "-Bonly"):
                xsDataResultStrategy = self._edHandlerXSDataBest.getXSDataResultStrategy(xsDataResultBest, self.getDataInput().getExperimentalCondition(), self._xsDataSampleCopy)
        else:
            xsDataResultStrategy = self._edHandlerXSDataBest.getXSDataResultStrategy(xsDataResultBest, self.getDataInput().getExperimentalCondition(), self._xsDataSampleCopy)

        if self.xsDataFileRaddoseLog is not None:
            xsDataResultStrategy.setRaddoseLogFile(self.xsDataFileRaddoseLog)
        # Plots
        if not self._edPluginPlotGle.isFailure():
            listFileGraph = self._edPluginPlotGle.dataOutput.fileGraph
            xsDataResultStrategy.bestGraphFile = listFileGraph
        # Sample
        xsDataResultStrategy.setSample(self._xsDataSampleCopy)
        self.setDataOutput(xsDataResultStrategy)
        self.generateStrategyShortSummary(xsDataResultStrategy)
コード例 #5
0
 def postProcess(self, _oedObject=None):
     EDPluginControl.postProcess(self, _oedObject)
     EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblev10.postProcess")
     if (self.__xsDataResultSubWedgeMerge is not None):
         xsDataResultSubWedgeAssemble = XSDataResultSubWedgeAssemble()
         xsDataResultSubWedgeAssemble.setSubWedge(self.__xsDataResultSubWedgeMerge.getSubWedge())
         self.setDataOutput(xsDataResultSubWedgeAssemble)
コード例 #6
0
 def configure(self):
     EDPluginControl.configure(self)
     if not self.configured:
         with self.classlock:
             if not self.configured:
                 EDPluginControl.configure(self)
                 dammif_jobs = self.config.get("dammifJobs", None)
                 if (dammif_jobs != None):
                     self.__class__.dammif_jobs = int(dammif_jobs)
                     self.DEBUG("EDPluginControlSaxsModelingv1_1.configure: setting number of dammif jobs to %d" % self.dammif_jobs)
                 unit = self.config.get("unit", None)
                 if (unit != None):
                     self.__class__.unit = unit.upper()
                     self.DEBUG("EDPluginControlSaxsModelingv1_1.configure: setting input units to %s" % self.unit)
                 symmetry = self.config.get("symmetry", None)
                 if (symmetry != None):
                     self.__class__.symmetry = symmetry
                     self.DEBUG("EDPluginControlSaxsModelingv1_1.configure: setting symmetry to %s" % self.symmetry)
                 mode = self.config.get("mode", None)
                 if (mode != None):
                     self.__class__.mode = mode
                     self.DEBUG("EDPluginControlSaxsModelingv1_1.configure: setting dammif mode to %s" % self.mode)
                 clusterSize = self.config.get("clusterSize", None)
                 if (clusterSize != None):
                     self.__class__.cluster_size = int(clusterSize)
                     self.DEBUG("EDPluginControl.configure: setting cluster size to %d" % self.cluster_size)
                 self.__class__.configured = True
コード例 #7
0
    def preProcess(self):
        EDPluginControl.preProcess(self)
        self.DEBUG('Import : preprocess')
        self.anom = self.loadPlugin('EDPluginControlFileConversionv1_0')
        if self.dataInput.input_noanom:
            self.noanom = self.loadPlugin('EDPluginControlFileConversionv1_0')
        tocopy = ['dataCollectionID', 'start_image', 'end_image',
                  'res', 'nres', 'image_prefix']

        anom_in = XSDataFileConversion()
        noanom_in = XSDataFileConversion()

        # copy the common attributes from our data model to the subplugins'
        for a in tocopy:
            for dm in anom_in, noanom_in:
                setattr(dm, a, getattr(self.dataInput, a))

        # now set the specific bits
        anom_in.anom = XSDataBoolean(True)
        anom_in.input_file = self.dataInput.input_anom
        anom_in.output_file = XSDataString(os.path.join(self.outdir, OUTFILE_TEMPLATE.format('anom')))
        self.anom.dataInput = anom_in

        if self.dataInput.input_noanom:
            noanom_in.anom = XSDataBoolean(False)
            noanom_in.input_file = self.dataInput.input_noanom
            noanom_in.output_file = XSDataString(os.path.join(self.outdir, OUTFILE_TEMPLATE.format('noanom')))
            self.noanom.dataInput = noanom_in

        if self.dataInput.choose_spacegroup is not None:
            anom_in.choose_spacegroup = self.dataInput.choose_spacegroup
            if self.dataInput.input_noanom:
                noanom_in.choose_spacegroup = self.dataInput.choose_spacegroup
コード例 #8
0
 def postProcess(self, _edObject=None):
     EDPluginControl.postProcess(self)
     self.DEBUG("EDPluginControlSingleSamplev1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResultBioSaxsSingleSamplev1_0()
     xsDataResult.status = XSDataStatus(executiveSummary=XSDataString(self.strExecutiveSummary))
     self.setDataOutput(xsDataResult)
コード例 #9
0
 def postProcess(self, _edObject=None):
     EDPluginControl.postProcess(self, _edObject)
     self.DEBUG("EDPluginControlSubWedgeAssemblyv2_0.postProcess")
     if (self.xsDataResultSubWedgeAssemble is not None):
         self.setDataOutput(self.xsDataResultSubWedgeAssemble , "mxv1Assemble")
         if self.xsDatacollection_v2 != None:
             self.setDataOutput(self.xsDatacollection_v2 , "mxv2DataCollection")
コード例 #10
0
 def process(self, _edObject=None):
     EDPluginControl.process(self, _edObject)
     EDVerbose.DEBUG("EDPluginControlSubWedgeAssemblyv2_0.process")
     if (self.edPluginControlSubwedgeAssembleOLD is not None):
         self.connectProcess(self.callOldSubWedgeAssembler)
         self.edPluginControlSubwedgeAssembleOLD.connectSUCCESS (self.doSuccessActionOldSubWedgeAssemble)
         self.edPluginControlSubwedgeAssembleOLD.connectFAILURE (self.doFailureActionOldSubWedgeAssemble)
コード例 #11
0
 def process(self, _edObject=None):
     EDPluginControl.process(self)
     self.DEBUG("EDPluginControlReadImageHeaderv10.process")
     if self.edPluginExecWaitFile is not None:
         self.edPluginExecWaitFile.connectSUCCESS(self.doSuccessWaitFile)
         self.edPluginExecWaitFile.connectFAILURE(self.doFailureWaitFile)
         self.executePluginSynchronous(self.edPluginExecWaitFile)
コード例 #12
0
    def __init__(self):
        """
        """
        EDPluginControl.__init__(self)
        self.__strControlledPluginDataver = "EDPluginExecDataverv1_0"
        self.__strControlledPluginDatcmp = "EDPluginExecDatcmpv1_0"
        self.__strControlledPluginWaitFile = "EDPluginWaitMultiFile"
        self.__strControlledPluginAutoSub = "EDPluginAutoSubv1_0"
#        self.__strControlledPluginDatop = "EDPluginExecDatopv1_0"

        self.__edPluginExecDatcmp = None
        self.__edPluginExecDataver = None
        self.__edPluginExecWaitFile = None
        self.__edPluginExecAutoSub = None
        self.__edPluginExecDataop = None
        self.setXSDataInputClass(XSDataInputBioSaxsSmartMergev1_0)
        self.__edPluginExecDatCmp = None
        self.lstInput = []
        self.lstMerged = []
        self.lstXsdInput = []
        self.absoluteFidelity = None
        self.relativeFidelity = None
        self.dictSimilarities = {} #key: 2-tuple of images, similarities
        self.lstSummary = []
        self.lstStrInput = []
#        self.sample = XSDataSample()
        self.autoRg = None
        self.strRadiationDamage = None
        self.strMergedFile = None
#        self.tKey = (None,)
        self.lstSub = []
        self.strSubFile = None
        self.fConcentration = None
コード例 #13
0
 def preProcess(self, _edObject=None):
     EDPluginControl.preProcess(self)
     self.DEBUG("EDPluginControlSaxsModelingv1_1.preProcess")
     self.xsGnomFile = self.dataInput.gnomFile
     if self.dataInput.graphFormat:
         self.graph_format = self.dataInput.graphFormat.value
     self.checkRg()
コード例 #14
0
    def __init__ (self):
        """
        """
        EDPluginControl.__init__(self)
        self.setXSDataInputClass(XSDataInputStrategy)

        self._strPluginRaddoseName = "EDPluginRaddosev10"
        self._edPluginRaddose = None
        self._edHandlerXSDataRaddose = None

        self._strPluginBestName = "EDPluginBestv1_2"
        self._edPluginBest = None
        self._edHandlerXSDataBest = None

        self._strPluginPlotGleName = "EDPluginExecPlotGlev1_0"
        self._edPluginPlotGle = None

        self._strCONF_SYMOP_HOME = "symopHome"
        # Default value for the location of the symop table
        self._strSymopHome = None

        self._xsDataSampleCopy = None

        # For default chemical composition
        self._fAverageAminoAcidVolume = 135.49
        self._fAverageCrystalSolventContent = 0.47
        self._fAverageSulfurContentPerAminoacid = 0.05
        self._fAverageSulfurConcentration = 314

        # This varaible determines if Raddose should be executed or not
        self._bEstimateRadiationDamage = None
        
        # Raddose log file
        self.xsDataFileRaddoseLog = None
コード例 #15
0
 def finallyProcess(self, _edObject=None):
     EDPluginControl.finallyProcess(self)
     self.DEBUG("EDPluginControlReadImageHeaderv10.finallyProcess")
     if self.xsDataResultReadImageHeader is None:
         # Create empty xsDataResult
         self.xsDataResultReadImageHeader = XSDataResultReadImageHeader()
     self.setDataOutput(self.xsDataResultReadImageHeader)
コード例 #16
0
 def preProcess(self, _edPlugin=None):
     EDPluginControl.preProcess(self, _edPlugin)
     # Check the input
     if self.hasDataInput():
         self.mxv1InputCharacterisation = self.getDataInput().getMxv1InputCharacterisation()
         self.mxv2DataCollection = self.getDataInput().getMxv2DataCollection()
     else:
         if self.hasDataInput("mxv1InputCharacterisation"):
             self.mxv1InputCharacterisation = self.getDataInput("mxv1InputCharacterisation")[0]
         if self.hasDataInput("mxv2DataCollection"):
             self.mxv2DataCollection = self.getDataInput("mxv2DataCollection")[0]
     # Load the plugins
     self.edPluginControlCharacterisation = self.loadPlugin(self.strPluginControlCharacterisation, \
                                                                "MXv1Characterisation")
     self.edPluginControlCharacterisation.setDataInput(self.mxv1InputCharacterisation)
     xsDataListOpt=self.mxv1InputCharacterisation.getDataCollection().getDiffractionPlan().getKappaStrategyOption()
     listOpt = map(lambda xsDataOpt : xsDataOpt.getValue(), xsDataListOpt)
     # Check if kappa strategy option is specified
     if (not "NoKappa" in listOpt) and (self.mxv2DataCollection is not None):
         self.edPluginControlCharacterisation.doStrategyCalculation(False)
         #if there is specific KAPPA option request, do that and suggest a characterisation at a new orientation
         listOpt=self.mxv1InputCharacterisation.getDataCollection().getDiffractionPlan().getKappaStrategyOption()
         if listOpt == []:
             #otherwise simply do an mxv2 characterisation
             #providing mxv1 style strategy at the give orientation 
             #and standard reorientation possibilities in the Executive Summary
             self.strPluginStrategyName = "EDPluginControlKappaStrategyv2_0"        
         else:
             self.strPluginStrategyName = "EDPluginControlKappaReorientationStrategyv2_0"
コード例 #17
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        h5Grp = EDPluginHDF5.createStructure(self.HDF5filename.path.value, self.internalHDF5Path.value)
        self.DEBUG("EDPluginControlFullFieldXASv1_0.process")
        self.makeHDF5OffsetStructure()
        if self.energy is not None:
            self.makeHDF5EnergyStructure()
        edPluginExecNormalize = self.loadPlugin(self.__strControlledNormalize)
        edPluginExecNormalize.connectSUCCESS(self.doSuccessExecNormalize)
        edPluginExecNormalize.connectFAILURE(self.doFailureExecNormalize)
        sdi = self.dataInput
        xsdInNorm = XSDataInputNormalize(data=sdi.data,
                                         flat=sdi.flat,
                                         dark=sdi.dark,
                                         dataScaleFactor=sdi.dataScaleFactor,
                                         darkScaleFactor=sdi.darkScaleFactor,
                                         flatScaleFactor=sdi.flatScaleFactor)
        if self.xsdNormalizedFilename is not None:
            xsdInNorm.output = XSDataImageExt(path=self.xsdNormalizedFilename.path)
        else:
            xsdInNorm.output = XSDataImageExt(shared=XSDataString("Normalized-%06i" % sdi.index.value))
        edPluginExecNormalize.dataInput = xsdInNorm
        edPluginExecNormalize.executeSynchronous()

        if self.xsdAlignStack is not None:
            edPluginAlign = self.loadPlugin(self.__strControlledAlign)
            edPluginAlign.dataInput = self.xsdAlignStack
            edPluginAlign.connectSUCCESS(self.doSuccessExecAlign)
            edPluginAlign.connectFAILURE(self.doFailureExecAlign)
            edPluginAlign.executeSynchronous()
コード例 #18
0
    def __init__ (self):
        """
        """
        EDPluginControl.__init__(self)
        #self.setXSDataInputClass( XSDataInputCharacterisation )
        #self.setXSDataInputClass(EDList)
        #self.strPluginIndexingName = "EDPluginControlIndexingv2_0"
        self.strPluginIndexingName = "EDPluginControlIndexingv10"
        self.edPluginIndexing = None
        self.strPluginIntegrationName = "EDPluginControlIntegrationv10"
        self.edPluginIntegration = None
        self.strPluginStrategyName = "EDPluginControlKappaStrategyv2_0"
        self.edPluginStrategy = None
        self.xsDataResultCharacterisationv2_0 = None
        self.xsDataResultCharacterisation = None
        self.xsDataInputStrategy = None

        self.setXSDataInputClass(XSDataInputCharacterisationv2_0)
        
        EDFactoryPluginStatic.loadModule("XSDataMXv1")
        import XSDataMXv1
        self.setXSDataInputClass(XSDataMXv1.XSDataInputCharacterisation, "mxv1InputCharacterisation")
        EDFactoryPluginStatic.loadModule("XSDataMXv2")
        import XSDataMXv2
        self.setXSDataInputClass(XSDataMXv2.XSDataCollection, "mxv2DataCollection")
 def process(self, _edObject=None):
     EDPluginControl.process(self)
     self.DEBUG("EDPluginControlPyarchThumbnailGeneratorv1_0.process")
     if self.edPluginExecThumbnail and self.edPluginMXWaitFile:
         self.edPluginMXWaitFile.connectSUCCESS(self.doSuccessMXWaitFile)
         self.edPluginMXWaitFile.connectFAILURE(self.doFailureMXWaitFile)
         self.edPluginMXWaitFile.executeSynchronous()
コード例 #20
0
 def postProcess(self, _edObject=None):
     """
     """
     EDPluginControl.postProcess(self, _edObject)
     EDVerbose.DEBUG("EDPluginControlCharacterisationv2_0.postProcess")
     if (self.xsDataResultCharacterisationv2_0 is not None):
         self.setDataOutput(self.xsDataResultCharacterisationv2_0)
コード例 #21
0
    def __init__(self):
        EDPluginControl.__init__(self)
        self.setXSDataInputClass(CCP4DataInputControlPipelineCalcDiffMap)

        # handles for the plugins I will use

        self._prepare_mtz_plugin = None
        self._prepare_pdb_plugin = None
        #self._rigidbody_plugin = None
        self._rigigbody_phaser_plugin = None
        self._restrained_plugin = None
        self._check_for_Validity_of_HKL = None
        self._check_for_Validity_of_XYZ = None
        self._pointless_origin_check = None

        # convenience handles

        self._hklin = None
        self._hklout = None
        self._xyzin = None
        self._xyzout = None

        self._ColLabels = None

        return
コード例 #22
0
 def process(self, _edPlugin=None):
     EDPluginControl.process(self, _edPlugin)
     EDVerbose.DEBUG("EDPluginControlInterfacev10.process...")
     if(self.__edPluginCharacterisation is not None):
         self.connectProcess(self.__edPluginCharacterisation.executeSynchronous)
         self.__edPluginCharacterisation.connectSUCCESS(self.doSuccessActionCharacterisation)
         self.__edPluginCharacterisation.connectFAILURE(self.doFailureActionCharacterisation)
コード例 #23
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginBioSaxsProcessOneFilev1_1.process")
        self.__edPluginNormalize.connectSUCCESS(self.doSuccessNormalize)
        self.__edPluginNormalize.connectFAILURE(self.doFailureNormalize)
        xsd = XSDataInputBioSaxsNormalizev1_0()
        xsd.rawImage = self.dataInput.rawImage
        xsd.normalizedImage = self.dataInput.normalizedImage
        xsd.rawImageSize = (self.rawImageSize)
        xsd.experimentSetup = self.dataInput.experimentSetup
        xsd.sample = self.dataInput.sample
        self.__edPluginNormalize.dataInput = xsd
        self.__edPluginNormalize.executeSynchronous()
        if self.isFailure():
            return

        self.__edPluginIntegrate.connectSUCCESS(self.doSuccessIntegrate)
        self.__edPluginIntegrate.connectFAILURE(self.doFailureIntegrate)
        xsd = XSDataInputBioSaxsAzimutIntv1_0()
        xsd.normalizedImage = self.dataInput.normalizedImage
        xsd.normalizedImageSize = (self.rawImageSize)
        xsd.integratedImage = self.dataInput.integratedImage
        xsd.integratedCurve = self.dataInput.integratedCurve
        xsd.experimentSetup = self.dataInput.experimentSetup
        xsd.sample = self.dataInput.sample
        self.__edPluginIntegrate.dataInput = xsd
        self.__edPluginIntegrate.executeSynchronous()
コード例 #24
0
    def process(self, _edPlugin=None):
        EDPluginControl.process(self, _edPlugin)
        self.DEBUG("EDPluginControlInterfaceToMXCuBEv1_3.process...")

        xsDataInputMXCuBE = self.getDataInput()
        xsDataInputInterface = XSDataInputInterface()
        self.edPluginControlInterface = self.loadPlugin(self.strPluginControlInterface)
        xsDataFirstImage = None
        for xsDataSetMXCuBE in xsDataInputMXCuBE.getDataSet():
            for xsDataFile in xsDataSetMXCuBE.getImageFile():
                xsDataInputInterface.addImagePath(xsDataFile)
                if xsDataFirstImage is None:
                    xsDataFirstImage = xsDataFile
        
        xsDataExperimentalCondition = self.getFluxAndBeamSizeFromISPyB(xsDataFirstImage, \
                                                            xsDataInputMXCuBE.getExperimentalCondition())
        
        xsDataInputInterface.setExperimentalCondition(xsDataExperimentalCondition)
        xsDataInputInterface.setDiffractionPlan(xsDataInputMXCuBE.getDiffractionPlan())
        xsDataInputInterface.setSample(xsDataInputMXCuBE.getSample())
        xsDataInputInterface.setDataCollectionId(xsDataInputMXCuBE.getDataCollectionId())
        self.edPluginControlInterface.setDataInput(xsDataInputInterface)

        if self.edPluginControlInterface is not None:
            self.connectProcess(self.edPluginControlInterface.executeSynchronous)
            self.edPluginControlInterface.connectSUCCESS(self.doSuccessActionInterface)
            self.edPluginControlInterface.connectFAILURE(self.doFailureActionInterface)
コード例 #25
0
 def __init__ (self):
     """
     Initialisation of EDPluginControlInterfaceToMXCuBEv1_3:
     - Input data type class : XSDataInputMXCuBE
     - Name of default characterisation plugin : EDPluginControlCharacterisationv1_1
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputMXCuBE)
     self.strPluginControlInterface = "EDPluginControlInterfacev1_2"
     self.edPluginControlInterface = None
     self.strPluginControlISPyB = "EDPluginControlISPyBv1_4"
     self.edPluginControlISPyB = None
     self.xsDataResultMXCuBE = None
     self.xsDataIntegerDataCollectionId = None
     self.strPluginExecOutputHTMLName = "EDPluginExecOutputHTMLv1_0"
     self.edPluginExecOutputHTML = None
     self.strPluginExecSimpleHTMLName = "EDPluginExecSimpleHTMLPagev1_0"
     self.edPluginExecSimpleHTML = None
     self.strPluginISPyBRetrieveDataCollection = "EDPluginISPyBRetrieveDataCollectionv1_4"
     self.edPluginISPyBRetrieveDataCollection = None
     self.strEDNAContactEmail = None
     self.strEDNAEmailSender = "*****@*****.**"
     self.tStart = None
     self.tStop = None
     self.fFluxThreshold = 1e3
コード例 #26
0
    def process(self, _edPlugin=None):
        """
        """
        EDPluginControl.process(self, _edPlugin)
        self.DEBUG("EDPluginControlInterfacev2_0.process...")

        if (self.edPluginControlSubWedgeAssemble is not None):
            if(self.bTemplateMode == True):
                self.edPluginControlSubWedgeAssemble.connectSUCCESS(self.generateTemplateFile)
            else:
                self.edPluginControlSubWedgeAssemble.connectSUCCESS(self.doSubWedgeAssembleSUCCESS)
            self.edPluginControlSubWedgeAssemble.connectFAILURE(self.doSubWedgeAssembleFAILURE)

        if(self.edPluginControlCharacterisation is not None):
            self.edPluginControlCharacterisation.connectSUCCESS(self.doSuccessActionCharacterisation)
            self.edPluginControlCharacterisation.connectFAILURE(self.doFailureActionCharacterisation)

        if (self.edPluginControlISPyB is not None):
            self.edPluginControlISPyB.connectSUCCESS(self.doSuccessActionISPyB)
            self.edPluginControlISPyB.connectFAILURE(self.doFailureActionISPyB)

        if (self.xsDataInputCharacterisation is None):
            self.createInputCharacterisationFromImageHeaders(self.edPluginControlSubWedgeAssemble)
        else:
            self.runCharacterisationPlugin(self.edPluginControlCharacterisation)
コード例 #27
0
    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        self.DEBUG("EDPluginControlXia2DIALSv1_0.preProcess")
        self.screen("Xia2DIALS processing started")

        if self.dataInput.doAnomAndNonanom is not None:
            if self.dataInput.doAnomAndNonanom.value:
                self.doAnomAndNonanom = True
            else:
                self.doAnomAndNonanom = False

        self.strHost = socket.gethostname()
        self.screen("Running on {0}".format(self.strHost))
        try:
            strLoad = os.getloadavg()
            self.screen("System load avg: {0}".format(strLoad))
        except OSError:
            pass

        self.edPluginWaitFileFirst = self.loadPlugin("EDPluginMXWaitFilev1_1", "MXWaitFileFirst")
        self.edPluginWaitFileLast = self.loadPlugin("EDPluginMXWaitFilev1_1", "MXWaitFileLast")

        self.edPluginRetrieveDataCollection = self.loadPlugin("EDPluginISPyBRetrieveDataCollectionv1_4")
        self.edPluginExecXia2DIALSAnom = self.loadPlugin("EDPluginExecXia2DIALSv1_0", "EDPluginExecXia2DIALSv1_0_anom")
        if self.doAnomAndNonanom:
            self.edPluginExecXia2DIALSNoanom = self.loadPlugin("EDPluginExecXia2DIALSv1_0", "EDPluginExecXia2DIALSv1_0_noanom")
コード例 #28
0
 def __init__(self):
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputCharacterisation)
     self._strPluginControlIndexingIndicators = "EDPluginControlIndexingIndicatorsv10"
     self._strPluginControlIndexingLabelit = "EDPluginControlIndexingLabelitv10"
     self._strPluginExecEvaluationIndexing = "EDPluginExecEvaluationIndexingv10"
     self._strPluginControlGeneratePrediction = "EDPluginControlGeneratePredictionv10"
     self._strPluginControlIntegration = "EDPluginControlIntegrationv10"
     self._strPluginControlXDSGenerateBackgroundImage = "EDPluginControlXDSGenerateBackgroundImagev1_0"
     self._strPluginControlStrategy = "EDPluginControlStrategyv1_2"
     self._edPluginControlIndexingIndicators = None
     self._edPluginControlIndexingLabelit = None
     self._edPluginExecEvaluationIndexingMOSFLM = None
     self._edPluginExecEvaluationIndexingLABELIT = None
     self._edPluginControlGeneratePrediction = None
     self._edPluginControlIntegration = None
     self._edPluginControlXDSGenerateBackgroundImage = None
     self._edPluginControlStrategy = None
     self._xsDataCollection = None
     self._xsDataResultCharacterisation = None
     self._xsDataIndexingResultMOSFLM = None
     self._xsDataCrystal = None
     self._strCharacterisationShortSummary = ""
     self._strStatusMessage = ""
     self._xsDataFileXdsBackgroundImage = None
     self._bDoStrategyCalculation = True
コード例 #29
0
 def finallyProcess(self, _edObject=None):
     EDPluginControl.finallyProcess(self)
     executiveSummary = os.linesep.join(self.lstExecutiveSummary)
     self.xsDataResult.status = XSDataStatus(executiveSummary=XSDataString(executiveSummary))
     self.dataOutput = self.xsDataResult
     if self.frame:
         self.frame.processing = False
コード例 #30
0
ファイル: EDPluginWaitMultiFile.py プロジェクト: gbourgh/edna
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginWaitMultiFile.process  global time-out is set to: %s (default value)" % (self.getTimeOut()))
        self.setTimeInit()
################################################################################
# Initialize the accumulator with the query
################################################################################
        xsdiAccumulator = XSDataInputAccumulator()
        xsdQuery = XSDataQuery()
        xsdQuery.setRemoveItems(XSDataBoolean(1))
        xsdQuery.setItem(self.listXsdStrings)
        xsdiAccumulator.setQuery([xsdQuery])
        edPluginAccumulator = self.loadPlugin(self.__strControlledPluginAccumulator)
        edPluginAccumulator.setDataInput(xsdiAccumulator)
        edPluginAccumulator.connectSUCCESS(self.doSuccessAccumulator)
        edPluginAccumulator.connectFAILURE(self.doFailureAccumulator)
        edPluginAccumulator.execute()

        for oneXSDImage in self.listXsdFiles:
            xsdiWaitFile = XSDataInputWaitFile()
            xsdiWaitFile.setExpectedFile(oneXSDImage)
            xsdiWaitFile.setExpectedSize(self.dataInput.expectedSize)
            xsdiWaitFile.setTimeOut(self.dataInput.timeOut)
            edPluginWaitFile = self.loadPlugin(self.__strControlledPluginWaitFile)
            edPluginWaitFile.setDataInput(xsdiWaitFile)
            edPluginWaitFile.connectSUCCESS(self.doSuccessWaitFile)
            edPluginWaitFile.connectFAILURE(self.doFailureWaitFile)
            edPluginWaitFile.execute()
コード例 #31
0
    def __init__(self):
        """
        """
        EDPluginControl.__init__(self)
        self.setXSDataInputClass(XSDataInputBioSaxsISPyB_HPLCv1_0)
        self.dataBioSaxsSample = None
        self.pyarchcurves = []
        self.pyarchgraph = {}
        self.lstError = []
        self.code = "opd"
        self.number = "29"
        self.hdf5File = None
        self.jsonFile = None
        self.hplcPlot = None
        self.visitorFilePath = None

        self.xsdResult = XSDataResultBioSaxsISPyB_HPLCv1_0()
コード例 #32
0
 def configure(self):
     """
     Configures the plugin from the configuration file with the following parameters
      - Excpected image size
     """
     EDPluginControl.configure(self)
     EDVerbose.DEBUG("EDPluginControlDiffractionCTv1_2.configure")
     xsPluginItem = self.getConfiguration()
     if (xsPluginItem == None):
         EDVerbose.warning("EDPluginControlDiffractionCTv1_2.configure: No plugin item defined.")
         xsPluginItem = XSPluginItem()
     strImageSize = EDConfiguration.getStringParamValue(xsPluginItem, EDPluginControlDiffractionCTv1_2.CONF_INPUT_IMAGE_SIZE)
     if(strImageSize == None):
         EDVerbose.WARNING("EDPluginControlDiffractionCTv1_2.configure: No configuration parameter found for: %s, using default value: %s " % (\
                      EDPluginControlDiffractionCTv1_2.CONF_INPUT_IMAGE_SIZE, self.iImageSize))
     else:
         self.iImageSize = int(strImageSize)
コード例 #33
0
    def __init__(self):
        EDPluginControl.__init__(self)
        #self.setXSDataInputClass(EDList)

        self.setRequiredToHaveConfiguration(True)

        self.strPluginRaddoseName = "EDPluginRaddosev10"
        self.edPluginRaddose = None
        self.edHandlerXSDataRaddose = None

        self.strPluginBestName = "EDPluginBestv1_2"
        self.edPluginBest = None
        from EDHandlerXSDataBestv1_2 import EDHandlerXSDataBestv1_2
        self.edHandlerXSDataBest = EDHandlerXSDataBestv1_2()

        self.strPluginAlignmentName = "EDPluginSTACAlignmentv2_0"
        self.edPluginAlignment = None
        self.edHandlerXSDataAlignment = None

        self.strPluginKappaStrategyName = "EDPluginSTACStrategyv2_0"
        self.edPluginKappaStrategy = None
        self.edHandlerXSDataKappaStrategy = None

        self.setXSDataInputClass(XSDataInputStrategy, "mxv1InputStrategy")
        EDFactoryPluginStatic.loadModule("XSDataMXv2")
        import XSDataMXv2
        self.setXSDataInputClass(XSDataMXv2.XSDataCollection,
                                 "mxv2DataCollection")
        import XSDataMXv1
        self.setXSDataInputClass(XSDataMXv1.XSDataIndexingResult,
                                 "mxv1IndexingResult")

        #disable kappa by default
        self.KappaStrategy = 0

        self.strCONF_SYMOP_HOME = "symopHome"
        # Default value for the location of the symop table
        self.strSymopHome = os.path.normpath("/opt/pxsoft/ccp4-6.0.2/lib/data")

        self.xsDataSampleCopy = None

        # For default chemical composition
        self.fAverageAminoAcidVolume = 135.49
        self.fAverageCrystalSolventContent = 0.47
        self.fAverageSulfurContentPerAminoacid = 0.05
        self.fAverageSulfurConcentration = 314
コード例 #34
0
 def preProcess(self, _edObject=None):
     EDPluginControl.preProcess(self)
     self.DEBUG("EDPluginControlStitchImagev1_0.preProcess")
     self.lInputFiles = [
         i.path.value for i in self.getDataInput().getInputImages()
         if os.path.isfile(i.path.value)
     ]
     l = len(self.lInputFiles)
     self.ndaDistance = numpy.zeros((l, l, 2), dtype="float32")
     self.xDummy = self.getDataInput().dummyValue
     self.xDeltaDummy = self.getDataInput().deltaDummy
     self.xOutFile = self.getDataInput().outputImage
     self.xAutoscale = self.getDataInput().autoscale
     self.xCenter = self.getDataInput().centerROI
     self.xWidth = self.getDataInput().widthROI
     self.xBlending = self.getDataInput().blending
     self.xMask = self.getDataInput().mask
コード例 #35
0
    def configure(self):
        """
        Gets the configuration parameters (if any).
        """
        EDPluginControl.configure(self)
        self.DEBUG("EDPluginControlInterfacev1_2.configure")
        if (self.getControlledPluginName("subWedgeAssemblePlugin") is not None):
            self.strEDPluginControlSubWedgeAssembleName = self.getControlledPluginName("subWedgeAssemblePlugin")
        if (self.getControlledPluginName("characterisationPlugin") is not None):
            self.strEDPluginControlCharacterisationName = self.getControlledPluginName("characterisationPlugin")
        if (self.getControlledPluginName("ispybPlugin") is not None):
            self.strEDPluginControlISPyBName = self.getControlledPluginName("ispybPlugin")

        bUseISPyBPlugin = self.config.get("useISPyBPlugin")
        if not bUseISPyBPlugin:
            self.DEBUG("EDPluginControlInterfacev1_2 configured to not use ISPyB")
            self.strEDPluginControlISPyBName = None
コード例 #36
0
    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)
コード例 #37
0
 def __init__(self):
     """
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputBioSaxsProcessOneFilev1_0)
     self.__edPluginWaitFile = None
     self.rawImage = None
     self.rawImageSize = XSDataInteger(1024)
     self.normalizedImage = None
     self.integratedCurve = None
     self.integratedImage = None
     self.lstExecutiveSummary = []
     self.sample = None
     self.experimentSetup = None
     self.integrator_config = {}
     self.scale = None
     self.detector = None
コード例 #38
0
    def finallyProcess(self, _edObject=None):
        EDPluginControl.finallyProcess(self)
        self.edPluginExecXDSAPPAnom.synchronize()
        if self.doAnomAndNonanom:
            self.edPluginExecXDSAPPNoanom.synchronize()
        strMessage = ""
        if self.getListOfWarningMessages() != []:
            strMessage += "Warning messages: \n\n"
            for strWarningMessage in self.getListOfWarningMessages():
                strMessage += strWarningMessage + "\n\n"
        if self.getListOfErrorMessages() != []:
            strMessage += "Error messages: \n\n"
            for strErrorMessage in self.getListOfErrorMessages():
                strMessage += strErrorMessage + "\n\n"
        if self.isFailure():
            self.timeEnd = time.localtime()
            if self.dataInput.dataCollectionId is not None:
                # Upload program status to ISPyB
                # anom
                if not self.hasUploadedAnomResultsToISPyB:
                    EDHandlerXSDataISPyBv1_4.setIspybToFailed(
                        self,
                        dataCollectionId=self.dataInput.dataCollectionId.value,
                        autoProcIntegrationId=self.autoProcIntegrationIdAnom,
                        autoProcProgramId=self.autoProcProgramIdAnom,
                        processingCommandLine=self.processingCommandLine,
                        processingPrograms=self.processingPrograms,
                        isAnom=True,
                        timeStart=self.timeStart,
                        timeEnd=self.timeEnd)

                if self.doAnomAndNonanom:
                    # noanom
                    if not self.hasUploadedNoanomResultsToISPyB:
                        EDHandlerXSDataISPyBv1_4.setIspybToFailed(
                            self,
                            dataCollectionId=self.dataInput.dataCollectionId.
                            value,
                            autoProcIntegrationId=self.
                            autoProcIntegrationIdNoanom,
                            autoProcProgramId=self.autoProcProgramIdNoanom,
                            processingCommandLine=self.processingCommandLine,
                            processingPrograms=self.processingPrograms,
                            isAnom=False,
                            timeStart=self.timeStart,
                            timeEnd=self.timeEnd)
コード例 #39
0
    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        self.DEBUG("EDPluginControlXia2DIALSv1_0.preProcess")
        self.screen("Xia2DIALS processing started")

        self.processingCommandLine = ' '.join(sys.argv)
        self.processingPrograms = "XIA2_DIALS"
        if self.reprocess:
            self.processingPrograms += " reprocess"

        if self.dataInput.doAnomAndNonanom is not None:
            self.doAnomAndNonanom = self.dataInput.doAnomAndNonanom.value

        if self.doAnomAndNonanom:
            self.doAnom = True
            self.doNoanom = True
        else:
            if self.dataInput.doAnom is not None:
                self.doAnom = self.dataInput.doAnom.value
            self.doNoanom = not self.doAnom

        if self.dataInput.reprocess is not None:
            self.reprocess = self.dataInput.reprocess.value

        self.strHost = socket.gethostname()
        self.screen("Running on {0}".format(self.strHost))
        try:
            strLoad = os.getloadavg()
            self.screen("System load avg: {0}".format(strLoad))
        except OSError:
            pass

        self.edPluginWaitFileFirst = self.loadPlugin("EDPluginMXWaitFilev1_1",
                                                     "MXWaitFileFirst")
        self.edPluginWaitFileLast = self.loadPlugin("EDPluginMXWaitFilev1_1",
                                                    "MXWaitFileLast")

        self.edPluginRetrieveDataCollection = self.loadPlugin(
            "EDPluginISPyBRetrieveDataCollectionv1_4")
        if self.doAnom:
            self.edPluginExecXia2DIALSAnom = self.loadPlugin(
                "EDPluginExecXia2DIALSv1_0", "EDPluginExecXia2DIALSv1_0_anom")
        if self.doNoanom:
            self.edPluginExecXia2DIALSNoanom = self.loadPlugin(
                "EDPluginExecXia2DIALSv1_0",
                "EDPluginExecXia2DIALSv1_0_noanom")
コード例 #40
0
 def process(self, _edObject=None):
     """
     Executes the execution plugins
     """
     EDPluginControl.process(self, _edObject)
     EDVerbose.DEBUG("EDPluginControlImageQualityIndicatorsv1_0.process")
     # Prepare the action cluster
     for edPluginPluginExecImageQualityIndicator in self.__listPluginExecImageQualityIndicator:
         edPluginPluginExecImageQualityIndicator.connectSUCCESS(
             self.doSuccessExecPlugin)
         edPluginPluginExecImageQualityIndicator.connectFAILURE(
             self.doFailureExecPlugin)
         self.addPluginToActionCluster(
             edPluginPluginExecImageQualityIndicator)
     # Launch the cluster
     self.executeActionCluster()
     self.synchronizeActionCluster()
コード例 #41
0
 def configure(self):
     """
     Configures the plugin from the configuration file with the following parameters:
      - DummyPixelValue: the value be assigned to dummy pixels.
      - DummyPixelDelta: the value be assigned to delta dummy.
      - DeviceType: "lut_ocl_1,3" will select device #3 on first platform #1 
     """
     EDPluginControl.configure(self)
     if not self.__configured:
         with self.semaphore:
             if not self.__configured:
                 self.DEBUG("EDPluginBioSaxsProcessOneFilev1_6.configure")
                 dummy = self.config.get(self.CONF_DUMMY_PIXEL_VALUE)
                 if dummy is None:
                     strMessage = 'EDPluginBioSaxsProcessOneFilev1_6.configure: %s Configuration parameter missing: \
         %s, defaulting to "%s"' % (self.getBaseName(), self.CONF_DUMMY_PIXEL_VALUE, self.dummy)
                     self.WARNING(strMessage)
                     self.addErrorWarningMessagesToExecutiveSummary(strMessage)
                 else:
                     self.__class__.dummy = float(dummy)
                 ddummy = self.config.get(self.CONF_DUMMY_PIXEL_DELTA)
                 if ddummy is None:
                     strMessage = 'EDPluginBioSaxsProcessOneFilev1_6.configure: %s Configuration parameter missing: \
         %s, defaulting to "%s"' % (self.getBaseName(), self.CONF_DUMMY_PIXEL_DELTA, self.delta_dummy)
                     self.WARNING(strMessage)
                     self.addErrorWarningMessagesToExecutiveSummary(strMessage)
                 else:
                     self.__class__.delta_dummy = float(ddummy)
                 method = self.config.get(self.CONF_OPENCL_DEVICE)
                 if method is None:
                     strMessage = 'EDPluginBioSaxsProcessOneFilev1_6.configure: %s Configuration parameter missing: \
         %s, defaulting to "%s"' % (self.getBaseName(), self.CONF_OPENCL_DEVICE, self.METHOD)
                     self.WARNING(strMessage)
                     self.addErrorWarningMessagesToExecutiveSummary(strMessage)
                 else:
                     self.__class__.METHOD = method
                 number_of_bins = self.config.get(self.CONF_NUMBER_OF_BINS)
                 if number_of_bins is None:
                     strMessage = 'EDPluginBioSaxsProcessOneFilev1_6.configure: %s Configuration parameter missing: \
         %s, defaulting to max(image.shape)' % (self.getBaseName(), self.CONF_NUMBER_OF_BINS)
                     self.WARNING(strMessage)
                     self.addErrorWarningMessagesToExecutiveSummary(strMessage)
                 else:
                     self.__class__.number_of_bins = number_of_bins
                 self.__class__.__configured = True
コード例 #42
0
    def configure(self):
        """
        Configures the plugin from the configuration file with the following parameters:
         - DummyPixelValue: the value to be assigned to dummy pixels.
        """
        EDPluginControl.configure(self)
        self.DEBUG("EDPluginBioSaxsNormalizev1_1.configure")
        xsPluginItem = self.getConfiguration()
        if (xsPluginItem == None):
            self.warning("EDPluginBioSaxsNormalizev1_1.configure: No plugin item defined.")
            xsPluginItem = XSPluginItem()
        self.dummy = EDConfiguration.getStringParamValue(xsPluginItem, self.CONF_DUMMY_PIXEL_VALUE)
        if self.dummy is None:
            strMessage = 'EDPluginBioSaxsNormalizev1_1.configure: %s Configuration parameter missing: \
%s, defaulting to "-1"' % (self.getBaseName(), self.CONF_DUMMY_PIXEL_VALUE)
            self.WARNING(strMessage)
            self.addErrorWarningMessagesToExecutiveSummary(strMessage)
            self.dummy = -1
コード例 #43
0
 def configure(self):
     """
     Gets the configuration parameters (if any).
     """
     EDPluginControl.configure(self)
     self.DEBUG("EDPluginControlCharacterisationv1_4.configure")
     self._strMxCuBE_URI = self.config.get("mxCuBE_URI", None)
     if self._strMxCuBE_URI is not None and "mxCuBE_XMLRPC_log" in os.environ.keys(
     ):
         self.DEBUG(
             "Enabling sending messages to mxCuBE via URI {0}".format(
                 self._strMxCuBE_URI))
         self._oServerProxy = ServerProxy(self._strMxCuBE_URI)
     self._runKappa = self.config.get("runKappa", False)
     self._fMinTransmission = self.config.get("minTransmissionWarning",
                                              self._fMinTransmission)
     self._bDoOnlyMoslmfIndexing = self.config.get("doOnlyMosflmIndexing",
                                                   False)
コード例 #44
0
 def process(self, _edObject=None):
     EDPluginControl.process(self)
     EDVerbose.DEBUG("EDPluginBioSaxsAsciiExportv1_1.process")
     xsdiWaitFile = XSDataInputWaitFile()
     xsdiWaitFile.setExpectedFile(XSDataFile(self.dataInput.integratedImage.path))
     xsdiWaitFile.setExpectedSize(XSDataInteger(8196)) #size of the header
     self.__edPluginWaitFile.setDataInput(xsdiWaitFile)
     self.__edPluginWaitFile.connectSUCCESS(self.doSuccessWaitFile)
     self.__edPluginWaitFile.connectFAILURE(self.doFailureWaitFile)
     self.__edPluginWaitFile.executeSynchronous()
     if not self.isFailure():
         self.__edPluginSaxsGetMetadata.connectSUCCESS(self.doSucessGetMetadata)
         self.__edPluginSaxsGetMetadata.connectFAILURE(self.doFailureGetMetadata)
         self.__edPluginSaxsGetMetadata.executeSynchronous()
     if not self.isFailure():
         self.__edPluginSaxsCurves.connectSUCCESS(self.doSuccessSaxsCurves)
         self.__edPluginSaxsCurves.connectFAILURE(self.doFailureSaxsCurves)
         self.__edPluginSaxsCurves.executeSynchronous()
コード例 #45
0
 def finallyProcess(self, _edObject=None):
     EDPluginControl.finallyProcess(self)
     EDVerbose.DEBUG("EDPluginControlCharacterisationv1_3.finallyProcess")
     if self._edPluginControlGeneratePrediction.isRunning():
         self._edPluginControlGeneratePrediction.synchronize()
     if self._strStatusMessage != None:
         self.setDataOutput(XSDataString(self._strStatusMessage),
                            "statusMessage")
         self._xsDataResultCharacterisation.setStatusMessage(
             XSDataString(self._strStatusMessage))
     if self._strCharacterisationShortSummary != None:
         self.setDataOutput(
             XSDataString(self._strCharacterisationShortSummary),
             "shortSummary")
         self._xsDataResultCharacterisation.setShortSummary(
             XSDataString(self._strCharacterisationShortSummary))
     if self._xsDataResultCharacterisation is not None:
         self.setDataOutput(self._xsDataResultCharacterisation)
コード例 #46
0
ファイル: EDPluginBioSaxsHPLCv1_2.py プロジェクト: kif/edna
 def configure(self):
     """
     Configures the HPLC plugin by reading from the configuration file 
      - The threshold for similarity with sample & buffer
     """
     EDPluginControl.configure(self)
     if self.__class__.SIMILARITY_THRESHOLD_SAMPLE is None:
         with self._sem:
             if self.__class__.SIMILARITY_THRESHOLD_SAMPLE is None:
                 self.DEBUG("EDPluginBioSaxsHPLCv1_2.configure")
                 self.__class__.SIMILARITY_THRESHOLD_BUFFER = float(
                     self.config.get(
                         self.SIMILARITY_THRESHOLD_BUFFER_KEY,
                         self.SIMILARITY_THRESHOLD_BUFFER_DEFAULT))
                 self.__class__.SIMILARITY_THRESHOLD_SAMPLE = float(
                     self.config.get(
                         self.SIMILARITY_THRESHOLD_SAMPLE_KEY,
                         self.SIMILARITY_THRESHOLD_SAMPLE_DEFAULT))
コード例 #47
0
 def __init__(self):
     """
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputBioSaxsHPLCv1_0)
     self.__edPluginProcessOneFile = None
     self.__edPluginSubtract = None
     self.__edPluginSaxsAnalysis = None
     self.__edPluginDatCmp = None
     self.xsDataResult = XSDataResultBioSaxsHPLCv1_0()
     self.runId = None
     self.frameId = None
     self.frame = None
     self.hplc_run = None
     self.curve = None
     self.subtracted = None
     self.lstExecutiveSummary = []
     self.isBuffer = False
コード例 #48
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        EDVerbose.DEBUG('*** CopySpaceGroupPDBtoMTZv10.process')

        self._pdbdump_plugin.connectSUCCESS(self._success_pdbdump)
        self._pdbdump_plugin.connectFAILURE(self._failure_pdbdump)

        self._pdbdump_plugin.executeSynchronous()

        # copy out information from pdbdump, pack it into input
        # for reindex

        self._reindex_plugin.connectSUCCESS(self._success_reindex)
        self._reindex_plugin.connectFAILURE(self._failure_reindex)

        self._reindex_plugin.executeSynchronous()

        return
コード例 #49
0
 def __init__(self):
     """
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputStitchImage)
     self.__strControlledPluginMeasure = "EDPluginExecMeasureOffsetv1_0"
     self.__strControlledPluginStitch = "EDPluginExecStitchOffsetedImagev1_0"
     self.lInputFiles = []
     self.xDummy = None
     self.xDeltaDummy = None
     self.xAutoscale = None
     self.xBlending = None
     self.xOutFile = None
     self.xMask = None
     self.result = None
     self.ndaDistance = None
     self.xCenter = []
     self.xWidth = []
コード例 #50
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginBioSaxsFlushHPLCv1_3.process")
        if self.runId in EDPluginBioSaxsHPLCv1_3.dictHPLC:
            self.processRun(EDPluginBioSaxsHPLCv1_3.dictHPLC[self.runId])
            try:
                edpluginIsPyB = self.loadPlugin(self.strControlledPluginISPyB)
                edpluginIsPyB.dataInput = XSDataInputBioSaxsISPyB_HPLCv1_0(sample=self.dataInput.sample,
                                                                           hdf5File=self.xsDataResult.hplcFile,
                                                                           jsonFile=XSDataFile(XSDataString(self.json)),
                                                                           hplcPlot=self.xsDataResult.hplcImage)
                edpluginIsPyB.executeSynchronous()
                self.dataOutputBioSaxsISPyB_HPLC = edpluginIsPyB.xsdResult
            except Exception as error:
                traceback.print_stack()
                self.ERROR("EDPluginBioSaxsFlushHPLCv1_3 calling to EDPluginBioSaxsISPyB_HPLCv1_0: %s" % error)

            self.processMerges(EDPluginBioSaxsHPLCv1_3.dictHPLC[self.runId])
コード例 #51
0
 def process(self, _edObject=None):
     EDPluginControl.process(self)
     self.DEBUG("EDPluginControlCharacterisationv1_2.process")
     self.__edPluginControlIndexingIndicators.connectSUCCESS(self.doSuccessIndexingIndicators)
     self.__edPluginControlIndexingIndicators.connectFAILURE(self.doFailureIndexingIndicators)
     self.__edPluginControlIndexingLabelit.connectSUCCESS(self.doSuccessIndexingLabelit)
     self.__edPluginControlIndexingLabelit.connectFAILURE(self.doFailureIndexingLabelit)
     self.__edPluginExecEvaluationIndexingMOSFLM.connectSUCCESS(self.doSuccessEvaluationIndexingMOSFLM)
     self.__edPluginExecEvaluationIndexingMOSFLM.connectFAILURE(self.doFailureEvaluationIndexingMOSFLM)
     self.__edPluginExecEvaluationIndexingLABELIT.connectSUCCESS(self.doSuccessEvaluationIndexingLABELIT)
     self.__edPluginExecEvaluationIndexingLABELIT.connectFAILURE(self.doFailureEvaluationIndexingLABELIT)
     self.__edPluginControlGeneratePrediction.connectSUCCESS(self.doSuccessGeneratePrediction)
     self.__edPluginControlGeneratePrediction.connectFAILURE(self.doFailureGeneratePrediction)
     self.__edPluginControlIntegration.connectSUCCESS(self.doSuccessIntegration)
     self.__edPluginControlIntegration.connectFAILURE(self.doFailureIntegration)
     self.__edPluginControlStrategy.connectSUCCESS(self.doSuccessStrategy)
     self.__edPluginControlStrategy.connectFAILURE(self.doFailureStrategy)
     self.__edPluginControlIndexingIndicators.executeSynchronous()
コード例 #52
0
    def finallyProcess(self, _edPlugin=None):
        EDPluginControl.finallyProcess(self, _edPlugin)
        xsDataResultCharacterisationv2_0 = XSDataResultCharacterisationv2_0()
        xsDataResultCharacterisationv2_0.setMxv1ResultCharacterisation(
            self.xsDataResultCharacterisation)
        xsDataResultCharacterisationv2_0.setMxv1ResultCharacterisation_Reference(
            self.xsDataResultCharacterisation)
        if self.suggestedStrategy is not None:
            self.setDataOutput(self.suggestedStrategy, "SuggestedStrategy")
            xsDataResultCharacterisationv2_0.setSuggestedStrategy(
                self.suggestedStrategy)
        if self.newpossibleOrientations is not None:
            self.setDataOutput(self.newpossibleOrientations,
                               "possibleOrientations")
            xsDataResultCharacterisationv2_0.setPossibleOrientations(
                self.newpossibleOrientations)

        self.setDataOutput(xsDataResultCharacterisationv2_0)
コード例 #53
0
 def __init__ (self):
     """
     Initialisation of EDPluginControlInterfaceToMXCuBEv1_2:
     - Input data type class : XSDataInputMXCuBE
     - Name of default characterisation plugin : EDPluginControlCharacterisationv1_1
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputMXCuBE)
     self.__strPluginControlCCP4i = "EDPluginControlCCP4iv1_1"
     self.__edPluginControlCCP4i = None
     self.__strPluginControlISPyB = "EDPluginControlISPyBv1_0"
     self.__edPluginControlISPyB = None
     self.__xsDataResultMXCuBE = None
     self.__xsDataIntegerDataCollectionId = None
     self.__strPluginExecOutputHTMLName = "EDPluginExecOutputHTMLv1_0"
     self.__edPluginExecOutputHTML = None
     self.__strEDNAContactEmail = None
     self.__strEDNAEmailSender = "*****@*****.**"
コード例 #54
0
    def preProcess(self, _edObject=None):
        """
        Gets the Configuration Parameters, if found, overrides default parameters
        """
        EDPluginControl.preProcess(self, _edObject)
        EDVerbose.DEBUG(
            "EDPluginControlInducedRadiationProcessv10.preProcess...")

        # TODO, if it's Bonly no Indexation needed! Get matrix from reference
        #xsDataStringStrategyOption = self.getDataInput().getDataCollection().getDiffractionPlan().getStrategyOption()
        #pyStrStrategyOption = xsDataStringStrategyOption.getValue()
        #if ( pyStrStrategyOption != "-Bonly" ):
        #    self.__edPluginIndexing    = self.loadPlugin( self.__strPluginIndexingName   , "Indexing" )

        self.__edPluginIntegration = self.loadPlugin(
            self.__strPluginIntegrationName, "Integration")
        self.__edPluginStrategy = self.loadPlugin(self.__strPluginStrategyName,
                                                  "Strategy")
コード例 #55
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginBioSaxsProcessOneFilev1_3.process")

        xsd = XSDataInputWaitFile(expectedFile=XSDataFile(XSDataString(self.rawImage)),
                                           expectedSize=self.rawImageSize,
                                           timeOut=XSDataTime(30))
        self.__edPluginWaitFile.setDataInput(xsd)
        self.__edPluginWaitFile.connectSUCCESS(self.doSuccessWaitFile)
        self.__edPluginWaitFile.connectFAILURE(self.doFailureWaitFile)
        self.__edPluginWaitFile.executeSynchronous()
        if self.isFailure():
            return

        q, I, std = self.integrate()
        I = self.normalize(I)
        std = self.normalize(std)
        self.write3ColumnAscii(q, I, std, self.integratedCurve)
コード例 #56
0
    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        EDVerbose.DEBUG("EDPluginBioSaxsAzimutIntv1_0.preProcess")
        self.sample = self.dataInput.sample
        self.exprimentSetup = self.dataInput.experimentSetup
        # Load the execution plugins

        self.__edPluginWaitFile = self.loadPlugin(self.__strControlledPluginWaitFile)
        self.__edPluginSaxsAdd = self.loadPlugin(self.__strControlledPluginSaxsAdd)
        self.__edPluginSaxsAngle = self.loadPlugin(self.__strControlledPluginSaxsAngle)
        self.__edPluginAsciiExport = self.loadPlugin(self.__strControlledPluginAsciiExport)
        self.__edPluginSaxsGetMetadata = self.loadPlugin(self.__strControlledPluginSaxsGetMetadata)
        self.__edPluginSaxsSetMetadata = self.loadPlugin(self.__strControlledPluginSaxsSetMetadata)

        self.normalizedImage = self.dataInput.normalizedImage.getPath().value
        self.correctedImage = self.dataInput.getCorrectedImage().getPath().value
        self.integratedImage = self.dataInput.getIntegratedImage().getPath().value
        self.integratedCurve = self.dataInput.getIntegratedCurve().getPath().value
コード例 #57
0
 def preProcess(self, _edObject=None):
     """
     Prepares the execution plugin
     """
     EDPluginControl.preProcess(self, _edObject)
     EDVerbose.DEBUG(
         "EDPluginControlImageQualityIndicatorsv1_0.preProcess...")
     # List containing instances of all the exeuction plugins
     self.__listPluginExecImageQualityIndicator = []
     # Loop through all the incoming reference images
     listXSDataImage = self.getDataInput("referenceImage")
     for (iIndex, xsDataImage) in enumerate(listXSDataImage):
         edPluginPluginExecImageQualityIndicator = self.loadPlugin(self.__strPluginExecImageQualityIndicatorName, \
                                                                   "%s-%d" % (self.__strPluginExecImageQualityIndicatorName, iIndex + 1))
         edPluginPluginExecImageQualityIndicator.setDataInput(
             str(xsDataImage.marshal()), "referenceImage")
         self.__listPluginExecImageQualityIndicator.append(
             edPluginPluginExecImageQualityIndicator)
コード例 #58
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginHPLCPrimayDataISPyBv1_0.process")
        try:
            self.copy_to_pyarch()
        except Exception as error:
            strErrorMessage = "Error while copying to pyarch: %s" % error
            self.ERROR(strErrorMessage)
            self.lstError.append(strErrorMessage)

        try:
            self.measurementId = self.client.service.storeHPLCDataAnalysisResult(
                self.dataInput.experimentId.value,
                self.filename,
                self.rg,
                self.rgStdev,
                self.i0,
                self.i0Stdev,
                self.firstPointUsed,
                self.lastPointUsed,
                self.quality,
                self.isagregated,
                self.code,
                self.concentration,
                self.gnomFile,
                self.rgGuinier,
                self.rgGnom,
                self.dmax,
                self.total,
                self.volume,
                self.dataInput.startFrame.value,
                self.dataInput.endFrame.value,
                ", ".join(self.pyarchcurves),
                self.bestBuffer,
                self.pyarchgraph.get("scatterPlot", ""),
                self.pyarchgraph.get("guinierPlot", ""),
                self.pyarchgraph.get("kratkyPlot", ""),
                self.pyarchgraph.get("densityPlot", ""),
            )
        except Exception, error:
            traceback.print_exc()
            strError = "-- ISPyB error: %s" % error
            self.ERROR(strError)
            self.setFailure()
コード例 #59
0
    def preProcess(self, _edObject=None):
        EDPluginControl.preProcess(self)
        self.DEBUG("EDPluginBioSaxsNormalizev1_1.preProcess")
        self.sample = self.xsdInput.sample
        self.experimentSetup = self.xsdInput.experimentSetup
#        self.strLogFile = self.xsdInput.getLogFile().path.value
        self.strRawImage = self.xsdInput.rawImage.path.value
        self.strNormalizedImage = self.xsdInput.normalizedImage.path.value
        outDir = os.path.dirname(self.strNormalizedImage)
        if not os.path.exists(outDir):
            os.mkdir(outDir)
        self.strRawImageSize = self.xsdInput.getRawImageSize().value
        self.dictOutputHeader["DiodeCurr"] = self.experimentSetup.beamStopDiode.value
        self.dictOutputHeader["Normalization"] = self.experimentSetup.normalizationFactor.value
        self.dictOutputHeader["MachCurr"] = self.experimentSetup.machineCurrent.value
        self.dictOutputHeader["Mask"] = str(self.experimentSetup.maskFile.path.value)
        self.dictOutputHeader["SampleDistance"] = self.experimentSetup.detectorDistance.value
        self.dictOutputHeader["WaveLength"] = self.experimentSetup.wavelength.value
        self.dictOutputHeader["PSize_1"] = self.experimentSetup.pixelSize_1.value
        self.dictOutputHeader["PSize_2"] = self.experimentSetup.pixelSize_2.value
        self.dictOutputHeader["Center_1"] = self.experimentSetup.beamCenter_1.value
        self.dictOutputHeader["Center_2"] = self.experimentSetup.beamCenter_2.value
        if self.experimentSetup.storageTemperature is not None:
            self.dictOutputHeader["storageTemperature"] = self.experimentSetup.storageTemperature.value
        if self.experimentSetup.exposureTemperature is not None:
            self.dictOutputHeader["exposureTemperature"] = self.experimentSetup.exposureTemperature.value
        if self.experimentSetup.exposureTime is not None:
            self.dictOutputHeader["exposureTime"] = self.experimentSetup.exposureTime.value
        if self.experimentSetup.frameNumber is not None:
            self.dictOutputHeader["frameNumber"] = self.experimentSetup.frameNumber.value
        if self.experimentSetup.frameMax is not None:
            self.dictOutputHeader["frameMax"] = self.experimentSetup.frameMax.value

        if self.sample.comments is not None:
            self.dictOutputHeader["Comments"] = str(self.sample.comments.value)
            self.dictOutputHeader["title"] = str(self.sample.comments.value)

        if self.sample.concentration is not None:
            self.dictOutputHeader["Concentration"] = str(self.sample.concentration.value)
        if self.sample.code is not None:
            self.dictOutputHeader["Code"] = str(self.sample.code.value)

        # Load the execution plugin
        self.__edPluginExecWaitFile = self.loadPlugin(self.__strPluginNameWaitFile)
コード例 #60
0
 def preProcess(self, _edObject=None):
     EDPluginControl.preProcess(self)
     self.DEBUG("EDPluginControlGridScreeningv1_0.preProcess")
     # Load the plugins
     self.edPluginControlReadImageHeader = self.loadPlugin(self.strControlReadImageHeaderPluginName, \
                                                                "ReadImageHeader")
     self.edPluginControlIndicators = self.loadPlugin(self.strControlledIndicatorsPluginName, \
                                                                "ControlIndicators")
     self.edPluginMOSFLMIndexing = self.loadPlugin(self.strIndexingMOSFLMPluginName, \
                                                                "IndexingMOSFLM")
     self.edPluginControlIntegration = self.loadPlugin(self.strPluginControlIntegration, \
                                                         "Integration")
     self.edPluginControlStrategy = self.loadPlugin(self.strPluginControlStrategy, \
                                                      "Strategy")
     self.edPluginExecMtz2Various = self.loadPlugin(self.strPluginExecMtz2Various, \
                                                      "Mtz2Various")
     # Input data
     self.strImageFile = self.getDataInput().getImageFile().getPath(
     ).getValue()
     self.xsDataGridScreeningFileNameParameters = self.getFileNameParameters(
         self.strImageFile)
     self.xsDataDiffractionPlan = self.getDataInput().getDiffractionPlan()
     if self.xsDataDiffractionPlan is None:
         self.xsDataDiffractionPlan = XSDataDiffractionPlan()
     if self.xsDataDiffractionPlan.getMaxExposureTimePerDataCollection(
     ) is None:
         # Default max esposure time: 10000s
         self.xsDataDiffractionPlan.setMaxExposureTimePerDataCollection(
             XSDataTime(10000))
     self.xsDataDiffractionPlan.setEstimateRadiationDamage(
         XSDataBoolean(False))
     # Image quality indicators
     if self.getDataInput().getStoreImageQualityIndicatorsInISPyB():
         self.bStoreImageQualityIndicatorsInISPyB = self.getDataInput(
         ).getStoreImageQualityIndicatorsInISPyB().getValue()
     if self.getDataInput().getDoOnlyImageQualityIndicators():
         self.bDoOnlyImageQualityIndicators = self.getDataInput(
         ).getDoOnlyImageQualityIndicators().getValue()
     if self.getDataInput().getDoOnlyIntegrationWithXMLOutput():
         self.bDoOnlyIntegrationWithXMLOutput = self.getDataInput(
         ).getDoOnlyIntegrationWithXMLOutput().getValue()
     if self.bStoreImageQualityIndicatorsInISPyB:
         self.edPluginISPyBStoreImageQualityIndicators = self.loadPlugin(self.strISPyBStoreImageQualityIndicatorsPluginName, \
                                                      "ISPyBStoreImageQualityIndicators")