def postProcess(self, _edObject=None): EDPluginControl.postProcess(self) self.DEBUG("EDPluginControlSaxsAnalysisv1_0.postProcess") # Create some output data strLog = """Rg = %.2f +/- %2f I(0) = %.2e +/- %.2e Points %i to %i Quality: %4.2f%% Aggregated: %s""" % ( self.autoRg.rg.value, self.autoRg.rgStdev.value, self.autoRg.i0.value, self.autoRg.i0Stdev.value, self.autoRg.firstPointUsed.value, self.autoRg.lastPointUsed.value, self.autoRg.quality.value * 100., self.autoRg.isagregated.value) if self.gnom is None: strLog += """ datGnom failed""" else: strLog += """ Dmax = %12.2f Total = %12.2f Guinier = %12.2f Gnom = %12.2f""" % ( self.gnom.dmax.value, self.gnom.total.value, self.gnom.rgGuinier.value, self.gnom.rgGnom.value) if self.xVolume is None: strLog += """ datPorod failed""" else: strLog += """ Volume = %12.2f""" % (self.xVolume.value) xsDataResult = XSDataResultSaxsAnalysis( autoRg=self.autoRg, gnom=self.gnom, volume=self.xVolume, status=XSDataStatus(executiveSummary=XSDataString(strLog))) self.setDataOutput(xsDataResult)
def __init__(self): """ """ EDPluginControl.__init__(self) self.setXSDataInputClass(XSDataInputSaxsAnalysis) self.edPluginAutoRg = None self.edPluginDatPorod = None self.edPluginDatGnom = None self.scatterFile = None self.gnomFile = None self.autoRg = None self.gnom = None self.xVolume = None self.xsDataResult = XSDataResultSaxsAnalysis()
def testExecute(self): """ """ self.run() plugin = self.getPlugin() ################################################################################ # Compare XSDataResults ################################################################################ strExpectedOutput = self.readAndParseFile(self.getReferenceDataOutputFile()) EDVerbose.DEBUG("Checking obtained result...") xsDataResultReference = XSDataResult.parseString(strExpectedOutput) xsDataResultObtained = plugin.getDataOutput() EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same", _strExcluded="bioSaxs")