示例#1
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'options':
         obj_ = XSDataString()
         obj_.build(child_)
         self.setOptions(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'source':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setSource(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
      nodeName_ == 'destination':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setDestination(obj_)
     XSDataInput.buildChildren(self, child_, nodeName_)
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'diffractionImage':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.diffractionImage.append(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'forcedOutputDirectory':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setForcedOutputDirectory(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'waitForFileTimeOut':
         obj_ = XSDataTime()
         obj_.build(child_)
         self.setWaitForFileTimeOut(obj_)
     XSDataInput.buildChildren(self, child_, nodeName_)
示例#3
0
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     self.DEBUG("EDPluginXOalignv1_0.postProcess")
     strPathLogFile = os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName())
     if os.path.exists(strPathLogFile):
         xsDataResultXOalign = self.parseLogFile(strPathLogFile)
         xsDataResultXOalign.logFile = XSDataFile(XSDataString(strPathLogFile))
         self.dataOutput = xsDataResultXOalign
 def postProcess(self, _edObject=None):
     EDPluginXDSv1_0.postProcess(self, _edObject)
     self.DEBUG("EDPluginXDSGenerateBackgroundImagev1_0.postProcess")
     xsDataResultXDSGenerateBackgroundImage = XSDataResultXDSGenerateBackgroundImage()
     strPathToXdsBackgroundImage = os.path.join(self.getWorkingDirectory(), "BKGINIT.cbf")
     if os.path.exists(strPathToXdsBackgroundImage):
         xsDataResultXDSGenerateBackgroundImage.setXdsBackgroundImage(XSDataFile(XSDataString(strPathToXdsBackgroundImage)))
     self.setDataOutput(xsDataResultXDSGenerateBackgroundImage)
示例#5
0
    def postProcess(self, _edObject=None):
        EDPluginControl.postProcess(self)
        self.DEBUG("EDPluginAutoSubv1_0.postProcess")
        # Create some output data

        self.xsDataResult.status = XSDataStatus(executiveSummary=XSDataString(os.linesep.join(self.lstProcessLog)))
        self.xsDataResult.subtractedCurve = XSDataFile(XSDataString(self.subtractedCurve))        
        self.dataOutput = self.xsDataResult
 def testCheckParameters(self):
     xsDataInput = XSDataInputHDF5StackImages(
         HDF5File=XSDataFile(),
         internalHDF5Path=XSDataString(),
         inputImageFile=[XSDataImage()])
     edPluginExecHDF5StackImages = self.createPlugin()
     edPluginExecHDF5StackImages.setDataInput(xsDataInput)
     edPluginExecHDF5StackImages.checkParameters()
示例#7
0
 def finallyProcess(self, _edObject=None):
     EDPluginExecProcessScript.finallyProcess(self)
     self.DEBUG("EDPluginExecMtz2Variousv1_0.finallyProcess")
     xsDataResult = self.getOutputDataFromDNATableFile("rdfit.xml")
     strScaleIntensityPlotPath = os.path.join(self.getWorkingDirectory(),
                                              self.strScaleIntensityPlot)
     if os.path.exists(strScaleIntensityPlotPath):
         xsDataResult.scaleIntensityPlot = XSDataFile(
             XSDataString(strScaleIntensityPlotPath))
     if os.path.exists(self.strBFactorPlot):
         xsDataResult.bFactorPlot = XSDataFile(
             XSDataString(self.strBFactorPlot))
     strHtmlPath = os.path.join(self.getWorkingDirectory(),
                                self.strHtmlPath)
     if os.path.exists(strHtmlPath):
         xsDataResult.htmlPage = XSDataFile(XSDataString(strHtmlPath))
     self.setDataOutput(xsDataResult)
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'pathToHTMLFile':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setPathToHTMLFile(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'pathToHTMLDirectory':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setPathToHTMLDirectory(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'pathToJsonFile':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setPathToJsonFile(obj_)
     XSDataResult.buildChildren(self, child_, nodeName_)
示例#9
0
 def testCreateDataMOSFLMOutputIntegration(self):
     pluginIntegration = self.createPlugin()
     pluginIntegration.setScriptExecutable("cat")
     pluginIntegration.configure()
     strBaseName = pluginIntegration.getBaseName()
     shutil.copyfile(
         os.path.join(self.strUnitTestDataHome,
                      "EDPluginMOSFLMIntegrationv10_bestfileDat_ok.txt"),
         os.path.join(pluginIntegration.getWorkingDirectory(),
                      "bestfile.dat"))
     shutil.copyfile(
         os.path.join(self.strUnitTestDataHome,
                      "EDPluginMOSFLMIntegrationv10_bestfilePar_ok.txt"),
         os.path.join(pluginIntegration.getWorkingDirectory(),
                      "bestfile.par"))
     shutil.copyfile(
         os.path.join(self.strUnitTestDataHome,
                      "EDPluginMOSFLMIntegrationv10_bestfileHKL_ok.txt"),
         os.path.join(pluginIntegration.getWorkingDirectory(),
                      "bestfile.hkl"))
     shutil.copyfile(
         os.path.join(
             self.strUnitTestDataHome,
             "EDPluginMOSFLMIntegrationv10_outputDnaTables_ok.xml"),
         os.path.join(pluginIntegration.getWorkingDirectory(),
                      strBaseName + "_dnaTables.xml"))
     strMatrixFile = os.path.join(self.strUnitTestDataHome,
                                  "EDPluginMOSFLMv10_autoindexMat_ok.txt")
     pluginIntegration.setMatrixFileName(strMatrixFile)
     xsDataMOSFLMIntegrationOutput = pluginIntegration.createDataMOSFLMOutputIntegration(
     )
     # Fix problem with absolute path by replacing it with a fixed one
     xsDataFile = XSDataFile()
     xsDataFile.setPath(
         XSDataString("/tmp/EDPluginMOSFLMIntegrationv10_process_1_1.mtz"))
     xsDataMOSFLMIntegrationOutput.setGeneratedMTZFile(xsDataFile)
     strReferenceXML = self.readAndParseFile(
         self.strReferenceDataOutputFile)
     xsDataMOSFLMIntegrationOutputReference = XSDataMOSFLMOutputIntegration.parseString(
         strReferenceXML)
     # Replace path to log file since it cannot be determined by the unit test
     xsDataMOSFLMIntegrationOutput.setPathToLogFile(
         XSDataFile(XSDataString("MOSFLMIntegrationv10.log")))
     EDAssert.equal(xsDataMOSFLMIntegrationOutputReference.marshal(),
                    xsDataMOSFLMIntegrationOutput.marshal())
示例#10
0
 def createInputCharacterisationFromImageHeaders(self, _edPlugin):
     self.DEBUG("EDPluginControlInterfacev1_2.createInputCharacterisationFromImageHeaders")
     xsDataInputSubWedgeAssemble = XSDataInputSubWedgeAssemble()
     for xsDataStringImagePath in self.listImagePaths:
         xsDataFile = XSDataFile()
         xsDataFile.setPath(xsDataStringImagePath)
         xsDataInputSubWedgeAssemble.addFile(xsDataFile)
     _edPlugin.setDataInput(xsDataInputSubWedgeAssemble)
     _edPlugin.executeSynchronous()
示例#11
0
    def postProcess(self, _edObject=None):
        EDPluginControl.postProcess(self)
        self.DEBUG("EDPluginBioSaxsToSASv1_0.postProcess")
        # Create some output data
        xsDataResult = XSDataResultBioSaxsToSASv1_0()
        if self.outFile:
            xsDataResult.htmlPage = XSDataFile(XSDataString(self.outFile))

        self.setDataOutput(xsDataResult)
示例#12
0
 def process(self, _edObject=None):
     EDPluginControl.process(self)
     self.DEBUG("EDPluginControlGridScreeningv1_0.process")
     xsDataInputReadImageHeader = XSDataInputReadImageHeader()
     xsDataInputReadImageHeader.setImage(image=XSDataFile(path=XSDataString(self.strImageFile)))
     self.edPluginControlReadImageHeader.setDataInput(xsDataInputReadImageHeader)
     self.edPluginControlReadImageHeader.connectSUCCESS(self.doSuccessReadImageHeader)
     self.edPluginControlReadImageHeader.connectFAILURE(self.doFailureReadImageHeader)
     self.executePluginSynchronous(self.edPluginControlReadImageHeader)
示例#13
0
 def finallyProcess(self, _edPlugin=None):
     EDPluginExec.finallyProcess(self, _edPlugin)
     self.DEBUG("EDPluginExecSimpleHTMLPagev1_0.finallyProcess...")
     # Render the page
     strHTML = str(self.page)
     EDUtilsFile.writeFile(self.strPath, strHTML)
     xsDataResultSimpleHTMLPage = XSDataResultSimpleHTMLPage()
     xsDataResultSimpleHTMLPage.setPathToHTMLFile(XSDataFile(XSDataString(self.strPath)))
     xsDataResultSimpleHTMLPage.setPathToHTMLDirectory(XSDataFile(XSDataString(os.path.dirname(self.strPath))))
     self.setDataOutput(xsDataResultSimpleHTMLPage)
     # Store in Pyarch
     strPyarchPath = None
     if self.xsDataResultCharacterisation is not None:
         strPyarchPath = EDHandlerESRFPyarchv1_0.createPyarchHtmlDirectoryPath(self.xsDataResultCharacterisation.getDataCollection())
     if strPyarchPath is None:
         # For debugging purposes
         strPyarchPath = EDUtilsPath.getEdnaUserTempFolder()
     EDHandlerESRFPyarchv1_0.copyHTMLDir(_strPathToHTMLDir=os.path.dirname(self.strPath), _strPathToPyarchDirectory=strPyarchPath)
示例#14
0
 def doSuccessExecRsync(self, _edPlugin=None):
     self.DEBUG("EDPluginBioSaxsSmartMergev1_7.doSuccessExecRsync")
     self.retrieveSuccessMessages(
         _edPlugin, "EDPluginBioSaxsSmartMergev1_7.doSuccessExecRsync")
     self.retrieveMessages(_edPlugin)
     self.gnom.gnomFile = XSDataFile(
         XSDataString(
             os.path.join(self.outdir,
                          os.path.split(self.gnom.gnomFile.path.value)[1])))
示例#15
0
 def doSuccessAccumulator(self, _edPlugin=None):
     with self.locked():
         self.DEBUG("EDPluginWaitMultiFile.doSuccessAccumulator")
         self.retrieveSuccessMessages(_edPlugin, "EDPluginWaitMultiFile.doSuccessAccumulator")
         xsdQueries = _edPlugin.dataOutput.getQuery()
         if xsdQueries is not None and len(xsdQueries) == 1 :
             xsdQuery = xsdQueries[0]
             if (xsdQuery is not None) and (len(xsdQuery.getItem()) == len(self.listXsdFiles)):
                 self.xsdDataOut.setActualFile([XSDataFile(xsd) for xsd in xsdQuery.getItem() ])
    def testExecute(self):
        """
        """
        plugin = self.getPlugin()
        plugin.__class__.lastBuffer = XSDataFile(XSDataString(os.path.join(EDUtilsPath.EDNA_TESTIMAGES, "buffer_before.dat")))
        plugin.__class__.lastSample = XSDataFile(XSDataString(os.path.join(EDUtilsPath.EDNA_TESTIMAGES, "bioSaxsAveraged.dat")))
        self.run()
        plugin = self.getPlugin()
        xsdRef = XSDataResultBioSaxsSmartMergev1_0.parseString(self.readAndParseFile(self.getReferenceDataOutputFile()))
        xsdRef.autoRg = None
        xsdObt = plugin.getDataOutput()
        xsdObt.status = None #Executive summary is too complicated to test
        EDAssert.strAlmostEqual(xsdRef.marshal(), xsdObt.marshal(), "XML output structures are the same", _fAbsError=0.1)
#        ref = " ".join([" ".join(i.split()) for i in open(self.destFile)])
#        obt = " ".join([" ".join(i.split()) for i in open(xsdObt.mergedCurve.path.value)])
#        EDAssert.strAlmostEqual(ref, obt, "Files are the same", _fAbsError=0.1)
        print plugin.__class__.lastBuffer.path.value
        print plugin.__class__.lastSample.path.value
    def postProcess(self, _edObject=None):
        EDPluginControl.postProcess(self)
        self.DEBUG("EDPluginBioSaxsProcessOneFilev1_4.postProcess")
        # Create some output data
        if os.path.exists(self.integratedCurve):
            self.xsDataResult.integratedCurve = XSDataFile(XSDataString(self.integratedCurve))

        self.xsDataResult.status = XSDataStatus(executiveSummary=XSDataString(os.linesep.join(self.lstExecutiveSummary)))
        self.setDataOutput(self.xsDataResult)
 def process(self, _edObject=None):
     EDPluginExec.process(self)
     self.DEBUG("EDPluginExec.process")
     aimlessLogPath = self.dataInput.aimlessLogPath.path.value
     aimlessCsvPath = os.path.join(self.getWorkingDirectory(),
                                   "aimless.csv")
     self.createAimlessCsvFile(aimlessLogPath, aimlessCsvPath)
     if os.path.exists(aimlessCsvPath):
         self.dataOutput.csvPath = XSDataFile(XSDataString(aimlessCsvPath))
示例#19
0
    def parseSupcombOutputFile(self):

        logFile = self.readProcessLogFile()
        logLines = logFile.splitlines()
        line = -1
        for l, ln in enumerate( logLines):
            if "Transformation matrix" in ln:
                line = l
        if line>=0:
            xsRot = self.returnRotation(logLines[line+1:line+4], 1)
            xsTrns = self.returnTranslation(logLines[line+1:line+4])
            xsNSD = None
        else:
            xsRot = self.returnRotation(logLines[-3:])
            xsTrns = self.returnTranslation(logLines[-6:-3])
            xsNSD = XSDataDouble(float(logLines[-8].split()[-1]))
        pdb = os.path.join(self.getWorkingDirectory(), self.__strOutputFileName)
                           
        try:
            res = parse_atsas.parsePDB(pdb, pdb)
        except Exception as error:
            self.ERROR("in parsePDB: %s" % error)
        if "NSD" in res:
            xsNSD = XSDataDouble(res["NSD"])
        model = XSDataSaxsModel(name=XSDataString(self.name),
                                logFile=XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.getScriptLogFileName()))))
                                
        if "Rfactor" in res:
            model.rfactor = XSDataDouble(res["Rfactor"])
        if "volume" in res:
            model.volume = XSDataDouble(res["volume"])
        if "Rg" in res:
            model.rg = XSDataDouble(res["Rg"])
        if "Dmax" in res :
            model.dmax = XSDataDouble(res["Dmax"])

        xsDataResult = XSDataResultSupcomb(NSD=xsNSD,
                                           rot=xsRot,
                                           trns=xsTrns,
                                           model=model)
        xsDataResult.outputFilename = model.pdbFile = XSDataFile(XSDataString(pdb))
        xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(),
                                          executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines())))
        return xsDataResult
示例#20
0
    def process(self, _edObject = None):
        EDPluginExec.process(self)
        self.DEBUG("EDPluginExecWriteNexusFilev1_0.process")
        xsDataInput = self.getDataInput()
#        print xsDataInput.marshal()
        fileName = str(xsDataInput.outputFileName.value)
        if xsDataInput.outputFileDirectory is None:
            fileDir = self.getWorkingDirectory()
        else:
            fileDir = str(xsDataInput.outputFileDirectory.value)
#        timestamp = "2010-10-18T17:17:04-0500"
        timestamp = datetime.datetime.now().isoformat()
        instrument = str(xsDataInput.instrument.value)
        # Create nexus file
        nexusFile = self.makeFile(os.path.join(fileDir, fileName), file_name=fileName,
            file_time=timestamp,
            instrument=instrument,
            creator="EDPluginExecWriteNexusFilev1_0",
            NeXus_version="4.3.0",
            HDF5_Version=h5py.version.hdf5_version,
            h5py_version=h5py.version.version) 
        # Write main data
        nxentry = self.makeGroup(nexusFile, "Result", "NXEntry")
        for nexusGroup in xsDataInput.nexusGroup:
            groupTitle = str(nexusGroup.title.value)
            long_name = str(nexusGroup.long_name.value)
            nxdata = self.makeGroup(nxentry, groupTitle, "NXdata", long_name=long_name, interpretation="spectrum")
            # First add the axes - if any...
            listAxisNames = []
            for xsDataNexusAxis in nexusGroup.axis:
                numpyAxisArray = EDUtilsArray.xsDataToArray(xsDataNexusAxis.axisData)
                self.makeDataset(nxdata, 
                                 str(xsDataNexusAxis.title.value), 
                                 numpyAxisArray, 
                                 axis=xsDataNexusAxis.axis.value,
                                 primary=xsDataNexusAxis.primary.value, 
                                 units=str(xsDataNexusAxis.units.value), 
                                 long_name=str(xsDataNexusAxis.long_name.value))
                listAxisNames.append(str(xsDataNexusAxis.title.value))
            numpyDataArray = EDUtilsArray.xsDataToArray(nexusGroup.data)
            strAxisNames = ""
            bFirst = True
            for strAxisName in listAxisNames:
                if bFirst:
                    strAxisNames += strAxisName
                    bFirst = False
                else:
                    strAxisNames += ":"+strAxisName
            self.makeDataset(nxdata, groupTitle, numpyDataArray.transpose(), 
                signal='1', # Y axis of default plot
                axes=strAxisNames, # name of X and Y axes
                long_name=long_name)
            pass
        xsDataResult = XSDataResultWriteNexusFile()
        xsDataResult.outputFilePath = XSDataFile(XSDataString(os.path.join(fileDir, fileName)))
        self.setDataOutput(xsDataResult)
示例#21
0
 def buildChildren(self, child_, nodeName_):
     if child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'image':
         obj_ = XSDataFile()
         obj_.build(child_)
         self.setImage(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'number':
         obj_ = XSDataInteger()
         obj_.build(child_)
         self.setNumber(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'spots_num_of':
         obj_ = XSDataInteger()
         obj_.build(child_)
         self.setSpots_num_of(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'spots_int_aver':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setSpots_int_aver(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'spots_resolution':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setSpots_resolution(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'powder_wilson_scale':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setPowder_wilson_scale(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'powder_wilson_bfactor':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setPowder_wilson_bfactor(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'powder_wilson_resolution':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setPowder_wilson_resolution(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'powder_wilson_correlation':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setPowder_wilson_correlation(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'powder_wilson_rfactor':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setPowder_wilson_rfactor(obj_)
     elif child_.nodeType == Node.ELEMENT_NODE and \
         nodeName_ == 'score':
         obj_ = XSDataDouble()
         obj_.build(child_)
         self.setScore(obj_)
示例#22
0
    def outputDamaverPdbFiles(self):
        cwd = self.getWorkingDirectory()
        damaverPDB = os.path.join(cwd, "damaver.pdb")
        if os.path.exists(damaverPDB):
            self.__xsDataResult.model = XSDataSaxsModel(
                name=XSDataString("damaver"))
            self.__xsDataResult.damaverPdbFile = self.__xsDataResult.model.pdbFile = XSDataFile(
                XSDataString(damaverPDB))

        if self.__bAutomatic:
            damfilterFile = os.path.join(cwd, "damfilt.pdb")
            if os.path.exists(damfilterFile):
                self.__xsDataResult.damfilterPdbFile = XSDataFile(
                    XSDataString(damfilterFile))

            damstartFile = os.path.join(cwd, "damstart.pdb")
            if os.path.exists(damstartFile):
                self.__xsDataResult.damstartPdbFile = XSDataFile(
                    XSDataString(damstartFile))
示例#23
0
 def processRun(self, run):
     # first rempoe unndunpable data from run
     for idx in run.frames:
         run.frames[idx].purge_memory()
     run.dump_json()
     hdf5 = run.save_hdf5()
     self.json = os.path.splitext(hdf5)[0] + ".json"
     self.xsDataResult.hplcFile = XSDataFile(XSDataString(hdf5))
     self.xsDataResult.hplcImage = XSDataFile(XSDataString(run.make_plot()))
     try:
         peaks = run.analyse()
         for group in peaks:
             self.lstExecutiveSummary.append(
                 "Merging frames from %s to %s" % (group[0], group[-1]))
             xsdFrames = [
                 XSDataFile(XSDataString(run.frames[i].subtracted))
                 for i in group
             ]
             outname = os.path.splitext(run.frames[
                 group[0]].subtracted)[0] + "_aver_%s.dat" % group[-1]
             edpugin = self.loadPlugin(self.strControlledPluginDatAver)
             edpugin.dataInput = XSDataInputDataver(outputCurve=XSDataFile(
                 XSDataString(outname)),
                                                    inputCurve=xsdFrames)
             edpugin.connectSUCCESS(self.doSuccessDatAver)
             edpugin.connectFAILURE(self.doFailureDatAver)
             edpugin.execute()
             run.merge_curves.append(outname)
             run.merge_analysis[outname] = None
             run.merge_Rg[outname] = None
             run.merge_framesDIC[outname] = [group[0], group[-1]]
     except ValueError:
         traceback.print_stack()
         self.ERROR(
             "EDPluginBioSaxsFlushHPLCv1_4: ValueError Error in analysing run"
         )
     except Exception as error:
         traceback.print_stack()
         self.ERROR(
             "EDPluginBioSaxsFlushHPLCv1_4:  Error in analysing run" %
             error)
     # Append to hdf5
     run.append_hdf5()
示例#24
0
 def finallyProcess(self, _edObject=None):
     EDPluginExecProcessScript.finallyProcess(self)
     self.DEBUG("EDPluginH5ToCBFv1_0.finallyProcess")
     if self.tmpCBFFile is not None:
         if os.path.exists(self.tmpCBFFile):
             os.remove(self.tmpCBFFile)
     if self.CBFFile is not None:
         if os.path.exists(self.CBFFile):
             self.dataOutput.outputCBFFile = XSDataFile(
                 XSDataString(self.CBFFile))
示例#25
0
    def outputDamaverPdbFiles(self):
        pathDamaverFile = XSDataString(
            os.path.join(self.getWorkingDirectory(), "damaver.pdb"))
        xsDamaverFile = XSDataFile(pathDamaverFile)
        if os.path.exists(pathDamaverFile.getValue()):
            self.__xsDataResult.setDamaverPdbFile(xsDamaverFile)

        if self.__bAutomatic:
            pathDamfilterFile = XSDataString(
                os.path.join(self.getWorkingDirectory(), "damfilt.pdb"))
            pathDamstartFile = XSDataString(
                os.path.join(self.getWorkingDirectory(), "damstart.pdb"))
            xsDamfilterFile = XSDataFile(pathDamfilterFile)
            xsDamstartFile = XSDataFile(pathDamstartFile)

            if os.path.exists(pathDamfilterFile.getValue()):
                self.__xsDataResult.setDamfilterPdbFile(xsDamfilterFile)
            if os.path.exists(pathDamstartFile.getValue()):
                self.__xsDataResult.setDamstartPdbFile(xsDamstartFile)
示例#26
0
    def process(self, _edObject=None):
        EDPluginControl.process(self)
        self.DEBUG("EDPluginBioSaxsReduceFileSeriev1_0.process")

        if self.bSkipProcess:
            return

        for oneRaw, oneCor, oneInt, oneCrv, oneLog in zip(
                self.lstRawImg, self.lstCorImg, self.lstIntImg, self.lstIntCrv,
                self.lstLogFil):
            pluginProcessOneFile = self.loadPlugin(
                self.__strControlledPluginProcessOneFile)
            xsd = XSDataInputBioSaxsProcessOneFilev1_0(
                integratedCurve=oneCrv,
                integratedImage=oneInt,
                normalizedImage=oneCor,
                rawImageSize=self.rawImageSize,
                experimentSetup=self.experimentSetup,
                sample=self.sample,
                rawImage=oneRaw,
                logFile=oneLog)
            pluginProcessOneFile.dataInput = xsd
            pluginProcessOneFile.connectSUCCESS(
                self.doSuccessExecProcessOneFile)
            pluginProcessOneFile.connectFAILURE(
                self.doFailureExecProcessOneFile)
            pluginProcessOneFile.execute()

        self.synchronizePlugins()
        self.lstCurves.sort()
        xsdMerge = XSDataInputBioSaxsSmartMergev1_0()
        xsdMerge.absoluteFidelity = self.dataInput.absoluteFidelity
        xsdMerge.relativeFidelity = self.dataInput.relativeFidelity
        xsdMerge.inputCurves = [
            XSDataFile(XSDataString(i)) for i in self.lstCurves
        ]
        xsdMerge.mergedCurve = XSDataFile(XSDataString(self.strMergedCurve))
        edPluginExecSmartMerge = self.loadPlugin(
            self.__strControlledPluginSmartMerge)
        edPluginExecSmartMerge.dataInput = xsdMerge
        edPluginExecSmartMerge.connectSUCCESS(self.doSuccessExecSmartMerge)
        edPluginExecSmartMerge.connectFAILURE(self.doFailureExecSmartMerge)
        edPluginExecSmartMerge.executeSynchronous()
示例#27
0
    def postProcess(self, _edObject=None):
        EDPluginExecProcessScript.postProcess(self)
        self.DEBUG("EDPluginExecDamstartv0_2.postProcess")
        model = XSDataSaxsModel(name=XSDataString("damstart"))
        xsDataResult = XSDataResultDamstart(model=model)

        xsDataResult.outputPdbFile = model.pdbFile = XSDataFile(XSDataString(os.path.join(self.getWorkingDirectory(), self.__strOutputPdbFileName)))
        xsDataResult.status = XSDataStatus(message=self.getXSDataMessage(),
                                          executiveSummary=XSDataString(os.linesep.join(self.getListExecutiveSummaryLines())))
        self.setDataOutput(xsDataResult)
示例#28
0
 def postProcess(self, _edObject = None):
     EDPluginExec.postProcess(self)
     self.DEBUG("EDPluginExecPlotGlev1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResultPlotGle()
     for strPath in self.listPlot:
         strPathJpg = strPath + ".jpg"
         if os.path.exists(strPathJpg):
             xsDataResult.addFileGraph(XSDataFile(XSDataString(strPathJpg)))
     self.setDataOutput(xsDataResult)
示例#29
0
 def postProcess(self, _edObject=None):
     EDPluginExecProcessScript.postProcess(self)
     self.DEBUG("EDPluginExecSiftDescriptorv1_0.postProcess")
     # Create some output data
     xsDataResult = XSDataResultSiftDescriptor()
     if os.path.isfile(self.strKeys):
         xsdFile = XSDataFile()
         xsdFile.setPath(XSDataString(self.strKeys))
         xsDataResult.setDescriptorFile(xsdFile)
     self.setDataOutput(xsDataResult)
示例#30
0
 def postProcess(self, _edObject=None):
     EDPluginExec.postProcess(self)
     self.DEBUG("EDPluginExecPlotGlev1_1.postProcess")
     # Create some output data
     xsDataResult = XSDataResultPlotGle()
     for dictPlot in self.listPlot:
         strPathJpg = os.path.join(self.getWorkingDirectory(), os.path.basename(dictPlot["script"])[:-4] + ".jpg")
         if os.path.exists(strPathJpg):
             xsDataResult.addFileGraph(XSDataFile(XSDataString(strPathJpg)))
     self.setDataOutput(xsDataResult)