def preProcess(self):
     """
     PreProcess of the execution test: download a set of images  from http://www.edna-site.org
     and remove any existing output file 
     """
     EDTestCasePluginExecute.preProcess(self)
     self.loadTestImage([
         "bioSaxsRaw.edf", "bioSaxsMask.edf", "bioSaxsCorrected.edf",
         "bioSaxsProcessNormalized.edf", "bioSaxsProcessIntegrated.edf",
         "bioSaxsProcessIntegrated1_2.dat", "averbuffer.dat"
     ])
     strExpectedOutput = self.readAndParseFile(
         self.getReferenceDataOutputFile())
     EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput)
     xsDataResultReference = XSDataResultBioSaxsHPLCv1_0.parseString(
         strExpectedOutput)
     self.refNormImg = xsDataResultReference.normalizedImage.path.value
     self.refIntCrv = xsDataResultReference.integratedCurve.path.value
     if not os.path.isdir(os.path.dirname(self.refNormImg)):
         os.makedirs(os.path.dirname(self.refNormImg))
     if os.path.isfile(self.refNormImg):
         os.remove(self.refNormImg)
     if os.path.isfile(self.refIntCrv):
         os.remove(self.refIntCrv)
     EDUtilsParallel.initializeNbThread()
    def testExecute(self):
        """
        """
        plugin = self.getPlugin()
        plugin.__class__.dictHPLC = {}
        self.run()

################################################################################
# Compare XSDataResults
################################################################################

        strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile())
        EDVerbose.DEBUG("Checking obtained result...")
        xsDataResultReference = XSDataResultBioSaxsHPLCv1_0.parseString(strExpectedOutput)
        xsDataResultObtained = plugin.getDataOutput()
        EDAssert.strAlmostEqual(xsDataResultReference.marshal(), xsDataResultObtained.marshal(), "XSDataResult output are the same", _strExcluded="bioSaxs")


################################################################################
# Compare Ascii files
################################################################################
        asciiObt = os.linesep.join([i.strip() for i in  open(xsDataResultObtained.integratedCurve.path.value) if "Raster" not in i])
        asciiRef = os.linesep.join([i.strip() for i in  open(os.path.join(self.getTestsDataImagesHome(), "bioSaxsProcessIntegrated1_2.dat")) if "Raster" not in i])

        EDAssert.strAlmostEqual(asciiRef, asciiObt, _strComment="3 column ascii files are the same", _fRelError=0.1, _strExcluded=os.environ["USER"])
        EDVerbose.screen("Execution time for %s: %.3fs" % (plugin.getClassName(), plugin.getRunTime()))
예제 #3
0
 def __init__(self):
     """
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputBioSaxsHPLCv1_0)
     self.xsDataResult = XSDataResultBioSaxsHPLCv1_0()
     self.runId = None
     self.FrameId = None
     self.hplc_run = None
     self.curve = None
     self.subtracted = None
     self.lstExecutiveSummary = []
예제 #4
0
파일: curves.py 프로젝트: t20100/sandbox
 def push_event(self, event):
     if event.attr_value is not None:
         if event.attr_value.name.endswith("jobSuccess"):
             print('jobSuccess')
             # Get curve
             jobid = event.attr_value.value  # from event
             print('jobid', jobid)
             x = self._device.getJobOutput(jobid)
             xsd = XSDataResultBioSaxsHPLCv1_0.parseString(x)
             if not self._init and xsd.dataQ is not None:
                 q = xsDataToArray(xsd.dataQ)
                 w.setXData(q)
                 self._init = True
             if xsd.dataI is not None:
                 i = xsDataToArray(xsd.dataI)
                 i[i <= 1] = 1  # Hack
                 w.appendCurves(i)
예제 #5
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
 def preProcess(self):
     """
     PreProcess of the execution test: download a set of images  from http://www.edna-site.org
     and remove any existing output file 
     """
     EDTestCasePluginExecute.preProcess(self)
     self.loadTestImage(["bioSaxsRaw.edf", "bioSaxsMask.edf",
                         "bioSaxsCorrected.edf", "bioSaxsProcessNormalized.edf",
                         "bioSaxsProcessIntegrated.edf", "bioSaxsProcessIntegrated1_2.dat"])
     strExpectedOutput = self.readAndParseFile (self.getReferenceDataOutputFile())
     EDVerbose.DEBUG("strExpectedOutput:" + strExpectedOutput)
     xsDataResultReference = XSDataResultBioSaxsHPLCv1_0.parseString(strExpectedOutput)
     self.refNormImg = xsDataResultReference.normalizedImage.path.value
     self.refIntCrv = xsDataResultReference.integratedCurve.path.value
     if not os.path.isdir(os.path.dirname(self.refNormImg)):
         os.makedirs(os.path.dirname(self.refNormImg))
     if os.path.isfile(self.refNormImg):
         os.remove(self.refNormImg)
     if os.path.isfile(self.refIntCrv):
         os.remove(self.refIntCrv)
     EDUtilsParallel.initializeNbThread()
예제 #7
0
 def __init__(self):
     """
     """
     EDPluginControl.__init__(self)
     self.setXSDataInputClass(XSDataInputBioSaxsHPLCv1_0)
     self.edPluginProcessOneFile = None
     self.edPluginSubtract = None
     self.edPluginAutoRg = 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
     self.intensity = None
     self.stdError = None
     self.ATSASRg = False