コード例 #1
0
 def setUp(self):
     input_ws = CreateSampleWorkspace(
         Function="User Defined",
         UserDefinedFunction="name=LinearBackground, " +
         "A0=0.3;name=Gaussian, PeakCentre=5, Height=10, Sigma=0.3",
         NumBanks=2,
         BankPixelWidth=1,
         XMin=0,
         XMax=10,
         BinWidth=0.1,
         BankDistanceFromSample=4.0)
     self._input_ws = input_ws
     self._table = FindEPP(input_ws, OutputWorkspace="table")
     AddSampleLog(self._input_ws,
                  LogName='wavelength',
                  LogText='4.0',
                  LogType='Number',
                  LogUnit='Angstrom')
     for i in range(input_ws.getNumberHistograms()):
         y = input_ws.dataY(i)
         y.fill(0.)
         y[51] = 100.
         e = input_ws.dataE(i)
         e.fill(0.)
         e[51] = 10.
    def _get_workspace(data):

        workspace = CreateSampleWorkspace(NumBanks=1, BankPixelWidth=1,
                                          XMin=1, XMax=11, BinWidth=2,
                                          XUnit="Wavelength", StoreInADS=False)

        data_y = workspace.dataY(0)
        for index in range(len(data_y)):
            data_y[index] = data[index]
        return workspace
コード例 #3
0
    def _get_sample_monitor_data(self, value):
        name = "test_monitor_workspace"
        monitor_workspace = CreateSampleWorkspace(OutputWorkspace=name,
                                                  NumBanks=0,
                                                  NumMonitors=8,
                                                  XMin=self.test_tof_min,
                                                  XMax=self.test_tof_max,
                                                  BinWidth=self.test_tof_width,
                                                  StoreInADS=False)

        for hist in range(monitor_workspace.getNumberHistograms()):
            data_y = monitor_workspace.dataY(hist)
            for index in range(len(data_y)):
                data_y[index] = value
            # This will be the background bin
            data_y[0] = 0.1
        return monitor_workspace
コード例 #4
0
 def setUp(self):
     input_ws = CreateSampleWorkspace(
         Function="User Defined",
         UserDefinedFunction="name=LinearBackground, " +
         "A0=0.3;name=Gaussian, PeakCentre=5, Height=10, Sigma=0.3",
         NumBanks=2, BankPixelWidth=1, XMin=0, XMax=10, BinWidth=0.1,
         BankDistanceFromSample=4.0)
     self._input_ws = input_ws
     self._table = FindEPP(input_ws, OutputWorkspace="table")
     AddSampleLog(self._input_ws, LogName='wavelength', LogText='4.0',
                  LogType='Number', LogUnit='Angstrom')
     for i in range(input_ws.getNumberHistograms()):
         y = input_ws.dataY(i)
         y.fill(0.)
         y[51] = 100.
         e = input_ws.dataE(i)
         e.fill(0.)
         e[51] = 10.