示例#1
0
 def runTest(self):
     config['default.facility'] = 'ILL'
     config['default.instrument'] = 'IN4'
     DirectILLCollectData(Run='ILL/IN4/085801-085802.nxs',
                          OutputWorkspace='vanadium',
                          OutputEPPWorkspace='vanadium-epps',
                          OutputRawWorkspace='vanadium-raw',
                          MonitorPeakWidthInSigmas=3.0)
     DirectILLIntegrateVanadium(InputWorkspace='vanadium',
                                OutputWorkspace='integrated',
                                EPPWorkspace='vanadium-epps')
     DirectILLDiagnostics(
         InputWorkspace='vanadium-raw',
         OutputWorkspace='diagnostics',
         SubalgorithmLogging='Logging ON',
         EPPWorkspace='vanadium-epps',
     )
     # Samples
     DirectILLCollectData(Run='ILL/IN4/087294+087295.nxs',
                          OutputWorkspace='sample',
                          OutputIncidentEnergyWorkspace='Ei',
                          OutputElasticChannelWorkspace='Elp',
                          MonitorPeakWidthInSigmas=3.0)
     # Containers
     DirectILLCollectData(Run='ILL/IN4/087306-087309.nxs',
                          OutputWorkspace='container',
                          IncidentEnergyWorkspace='Ei',
                          ElasticChannelWorkspace='Elp',
                          MonitorPeakWidthInSigmas=3.0)
     geometry = {
         'Shape': 'HollowCylinder',
         'Height': 4.0,
         'InnerRadius': 1.9,
         'OuterRadius': 2.0,
         'Center': [0.0, 0.0, 0.0]
     }
     material = {'ChemicalFormula': 'Cd S', 'SampleNumberDensity': 0.01}
     SetSample('sample', geometry, material)
     DirectILLSelfShielding(InputWorkspace='sample',
                            OutputWorkspace='corrections',
                            EventsPerPoint=20000)
     DirectILLApplySelfShielding(
         InputWorkspace='sample',
         OutputWorkspace='corrected',
         SelfShieldingCorrectionWorkspace='corrections',
         EmptyContainerWorkspace='container')
     DirectILLReduction(InputWorkspace='corrected',
                        OutputWorkspace='SofQW',
                        IntegratedVanadiumWorkspace='integrated',
                        DiagnosticsWorkspace='diagnostics')
     CropWorkspace(InputWorkspace='SofQW',
                   OutputWorkspace='cropped',
                   XMin=1.,
                   XMax=2.75,
                   StartWorkspaceIndex=83,
                   EndWorkspaceIndex=222)
     # The 'run_title' property has been deliberately erased from the test numor.
     # We need to add it manually because Save/LoadNexus will do the same for
     # the reference file.
     mtd['cropped'].mutableRun().addProperty('run_title', '', True)
示例#2
0
 def runTest(self):
     config['default.facility'] = 'ILL'
     config['default.instrument'] = 'IN5'
     DirectILLCollectData(
         Run='ILL/IN5/095893.nxs',
         OutputWorkspace='vanadium',
         OutputEPPWorkspace='vanadium-epps',
     )
     DirectILLDiagnostics(InputWorkspace='vanadium',
                          OutputWorkspace='diagnostics',
                          MaskedComponents='tube_320')
     DirectILLTubeBackground(InputWorkspace='vanadium',
                             OutputWorkspace='bkg',
                             EPPWorkspace='vanadium-epps',
                             DiagnosticsWorkspace='diagnostics')
     Subtract(LHSWorkspace='vanadium',
              RHSWorkspace='bkg',
              OutputWorkspace='vanadium')
     DeleteWorkspace('bkg')
     DirectILLIntegrateVanadium(InputWorkspace='vanadium',
                                OutputWorkspace='integrated',
                                EPPWorkspace='vanadium-epps')
     DeleteWorkspace('vanadium')
     DeleteWorkspace('vanadium-epps')
     DirectILLCollectData(Run='ILL/IN5/096003.nxs',
                          OutputWorkspace='sample',
                          OutputEppWorkspace='epps')
     DirectILLTubeBackground(InputWorkspace='sample',
                             OutputWorkspace='bkg',
                             EPPWorkspace='epps',
                             DiagnosticsWorkspace='diagnostics')
     Subtract(LHSWorkspace='sample',
              RHSWorkspace='bkg',
              OutputWorkspace='sample')
     DirectILLReduction(InputWorkspace='sample',
                        OutputWorkspace='SofQW',
                        IntegratedVanadiumWorkspace='integrated',
                        DiagnosticsWorkspace='diagnostics')
     CropWorkspace(InputWorkspace='SofQW',
                   OutputWorkspace='cropped',
                   XMin=0.5,
                   XMax=2.1,
                   StartWorkspaceIndex=375,
                   EndWorkspaceIndex=720)
     # The 'run_title' property has been deliberately erased from the test numor.
     # We need to add it manually because Save/LoadNexus will do the same for
     # the reference file.
     mtd['cropped'].mutableRun().addProperty('run_title', '', True)
示例#3
0
 def runTest(self):
     config['default.facility'] = 'ILL'
     config['default.instrument'] = 'IN6'
     DirectILLCollectData(Run='ILL/IN6/164192.nxs',
                          OutputWorkspace='vanadium',
                          OutputEPPWorkspace='vanadium-epps',
                          OutputRawWorkspace='vanadium-raw')
     DirectILLIntegrateVanadium(InputWorkspace='vanadium',
                                OutputWorkspace='integrated',
                                EPPWorkspace='vanadium-epps')
     DirectILLDiagnostics(
         InputWorkspace='vanadium-raw',
         OutputWorkspace='diagnostics',
         EPPWorkspace='vanadium-epps',
     )
     # Simulate sample with vanadium
     DirectILLCollectData(Run='ILL/IN6/164192.nxs',
                          OutputWorkspace='sample')
     DirectILLReduction(InputWorkspace='sample',
                        OutputWorkspace='SofQW',
                        IntegratedVanadiumWorkspace='integrated',
                        EnergyRebinningParams='-100, 0.01, 4.',
                        DiagnosticsWorkspace='diagnostics')
     CropWorkspace(InputWorkspace='SofQW',
                   OutputWorkspace='cropped',
                   XMin=0.7,
                   XMax=2.1,
                   StartWorkspaceIndex=9588,
                   EndWorkspaceIndex=10280)
     # GetEiMonDet produces slightly different results on different system. We better
     # check the calibrated energy logs here and set them to fixed values to
     # enable CompareWorkspaces to do its job. This hack could be removed later if
     # CompareWorkspaces supported tolerances for sample log comparison.
     ws = mtd['cropped']
     run = ws.mutableRun()
     self.assertAlmostEqual(run.getProperty('Ei').value, 4.72233, places=4)
     run.addProperty('Ei', 4.72, True)
     self.assertAlmostEqual(run.getProperty('wavelength').value,
                            4.16207,
                            places=4)
     run.addProperty('wavelength', 4.16, True)
     # The 'run_title' property has been deliberately erased from the test numor.
     # We need to add it manually because Save/LoadNexus will do the same for
     # the reference file.
     mtd['cropped'].mutableRun().addProperty('run_title', '', True)