def runTest(self):
        testws_e = mantid.CreateWorkspace([1.0, 2.0, 3.0], [4.0, 4.0, 4.0],
                                          UnitX="Wavelength")
        mantid.EditInstrumentGeometry(Workspace=testws_e,
                                      PrimaryFlightPath=10.0,
                                      L2=1.0,
                                      Polar=1.0)
        mantid.SetSample(testws_e,
                         ContainerGeometry={
                             'Shape': 'FlatPlate',
                             'Height': 4.0,
                             'Width': 2.0,
                             'Thick': 1.0,
                             'Center': [0., 0., 0.]
                         },
                         ContainerMaterial={
                             'ChemicalFormula': 'Al',
                             'NumberDensity': 0.01
                         })
        mantid.SetBeam(InputWorkspace=testws_e,
                       Geometry={
                           'Shape': 'Slit',
                           'Width': 3.0,
                           'Height': 6.75
                       })
        self.abs_e = mantid.MonteCarloAbsorption(InputWorkspace=testws_e,
                                                 OutputWorkspace="abs_e",
                                                 EventsPerPoint=100)

        testws_s = mantid.CreateWorkspace([1.0, 2.0, 3.0], [4.0, 4.0, 4.0],
                                          UnitX="Wavelength")
        mantid.EditInstrumentGeometry(Workspace=testws_s,
                                      PrimaryFlightPath=10.0,
                                      L2=1.0,
                                      Polar=1.0)
        mantid.SetSample(testws_s,
                         Geometry={
                             'Shape': 'FlatPlate',
                             'Height': 4.0,
                             'Width': 2.0,
                             'Thick': 1.0,
                             'Center': [0., 0., 0.]
                         },
                         Material={
                             'ChemicalFormula': 'Al',
                             'NumberDensity': 0.01
                         })
        mantid.SetBeam(InputWorkspace=testws_s,
                       Geometry={
                           'Shape': 'Slit',
                           'Width': 3.0,
                           'Height': 6.75
                       })
        self.abs_s = mantid.MonteCarloAbsorption(InputWorkspace=testws_s,
                                                 OutputWorkspace="abs_s",
                                                 EventsPerPoint=100)
Example #2
0
 def runTest(self):
     self.setup()
     mantid.LoadSampleShape(InputWorkspace="ws", OutputWorkspace="ws",
                            Filename=os.path.join(data_dir, "cylinder.stl"), scale="mm")
     mantid.SetSampleMaterial(InputWorkspace="ws", ChemicalFormula="V", SampleNumberDensity=0.1)
     self.handleEnvironment()
     mantid.MonteCarloAbsorption(InputWorkspace="ws", OutputWorkspace="ws", EventsPerPoint=5000)
 def runTest(self):
     self.setup()
     mantid.LoadSampleShape(InputWorkspace="ws",
                            OutputWorkspace="ws",
                            Filename=os.path.join(data_dir, "cylinder.stl"))
     mantid.SetSampleMaterial(InputWorkspace="ws",
                              ChemicalFormula="V",
                              SampleNumberDensity=0.1)
     mantid.MonteCarloAbsorption(InputWorkspace="ws",
                                 OutputWorkspace="ws",
                                 NumberOfWavelengthPoints=50)
 def runTest(self):
     self.setup()
     mantid.LoadSampleShape(InputWorkspace="ws",
                            OutputWorkspace="ws",
                            Filename="cylinder.stl",
                            scale="mm")
     mantid.SetSampleMaterial(InputWorkspace="ws",
                              ChemicalFormula="V",
                              SampleNumberDensity=0.1)
     self.handleEnvironment()
     mantid.MonteCarloAbsorption(InputWorkspace="ws",
                                 OutputWorkspace="ws",
                                 NumberOfWavelengthPoints=50)