Beispiel #1
0
 def test_wsreport(self):
     testhelpers.assertRaisesNothing(self, directtools.wsreport,
                                     **{'workspace': self._sqw})
     in5WS = LoadILLTOF('ILL/IN5/104007.nxs', StoreInADS=False)
     testhelpers.assertRaisesNothing(self, directtools.wsreport,
                                     **{'workspace': in5WS})
     in6WS = LoadILLTOF('ILL/IN6/164192.nxs', StoreInADS=False)
     testhelpers.assertRaisesNothing(self, directtools.wsreport,
                                     **{'workspace': in6WS})
Beispiel #2
0
 def test_plotconstQ_loglog(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {
         'workspaces': ws,
         'Q': 523.,
         'dQ': 17.,
         'xscale': 'log',
         'yscale': 'log'
     }
     figure, axes, cuts = testhelpers.assertRaisesNothing(
         self, directtools.plotconstQ, **kwargs)
     self.assertEquals(axes.get_xscale(), 'log')
     self.assertEquals(axes.get_yscale(), 'log')
Beispiel #3
0
def _loadFiles(inputFilenames, wsNames, wsCleanup, algorithmLogging):
    """Load files specified by inputFilenames, merging them into a single workspace."""
    filename = inputFilenames.pop(0)
    runNumber = os.path.basename(filename).split('.')[0]
    firstWSName = wsNames.withSuffix('raw-' + runNumber)
    mergedWS = LoadILLTOF(Filename=filename,
                          OutputWorkspace=firstWSName,
                          EnableLogging=algorithmLogging)
    mergedWSName = wsNames.withSuffix('merged')
    for i, filename in enumerate(inputFilenames):
        runNumber = os.path.basename(filename).split('.')[0]
        rawWSName = wsNames.withSuffix('raw-' + runNumber)
        rawWS = LoadILLTOF(Filename=filename,
                           OutputWorkspace=rawWSName,
                           EnableLogging=algorithmLogging)
        mergedWS = MergeRuns(InputWorkspaces=[mergedWS, rawWS],
                             OutputWorkspace=mergedWSName,
                             EnableLogging=algorithmLogging)
        if i == 0:
            wsCleanup.cleanup(firstWSName)
        wsCleanup.cleanup(rawWS)
    return mergedWS
Beispiel #4
0
 def test_plotcuts_doNotKeepCutWorkspaces(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs', StoreInADS=False)
     kwargs = {
         'direction': 'Vertical',
         'workspaces': ws,
         'cuts': 500.,
         'widths': 10.,
         'quantity': 'TOF',
         'unit': 'microseconds',
         'keepCutWorkspaces': False
     }
     self.assertEquals(mtd.size(), 0)
     figure, axes, cuts = testhelpers.assertRaisesNothing(
         self, directtools.plotcuts, **kwargs)
     self.assertEquals(len(cuts), 0)
     self.assertEquals(mtd.size(), 0)
Beispiel #5
0
 def test_plotcuts_loglog(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs', StoreInADS=False)
     kwargs = {
         'direction': 'Vertical',
         'workspaces': ws,
         'cuts': 500.,
         'widths': 10.,
         'quantity': 'TOF',
         'unit': 'microseconds',
         'xscale': 'log',
         'yscale': 'log'
     }
     self.assertEquals(mtd.size(), 0)
     figure, axes, cuts = testhelpers.assertRaisesNothing(
         self, directtools.plotcuts, **kwargs)
     self.assertEquals(axes.get_xscale(), 'log')
     self.assertEquals(axes.get_yscale(), 'log')
Beispiel #6
0
 def test_wsreport(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {'workspace': ws}
     testhelpers.assertRaisesNothing(self, directtools.wsreport, **kwargs)
Beispiel #7
0
 def test_plotSofQW(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {'workspace': 'ws'}
     testhelpers.assertRaisesNothing(self, directtools.plotSofQW, **kwargs)
     kwargs = {'workspace': ws}
     testhelpers.assertRaisesNothing(self, directtools.plotSofQW, **kwargs)
Beispiel #8
0
 def test_plotconstQ_dQListExecutes(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {'workspaces': ws, 'Q': 523., 'dQ': [17., 2.], 'style': 'ml'}
     testhelpers.assertRaisesNothing(self, directtools.plotconstQ, **kwargs)
Beispiel #9
0
 def test_plotconstQ_nonListArgsExecutes(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {'workspaces': ws, 'Q': 523., 'dQ': 42.}
     testhelpers.assertRaisesNothing(self, directtools.plotconstQ, **kwargs)
Beispiel #10
0
 def test_plotconstE_dEListExecutes(self):
     ws = LoadILLTOF('ILL/IN4/084446.nxs')
     kwargs = {'workspaces': ws, 'E': 13., 'dE': [1.5, 15.], 'style': 'lm'}
     testhelpers.assertRaisesNothing(self, directtools.plotconstE, **kwargs)