def _run_focus(focus_mode): # code to run the script starts here pearl_routines.PEARL_startup(usern="Mantid_Tester", thiscycle="15_4") # setting files directory here # DIRS[0] is the system test directory # setting raw files directory raw_path = os.path.join(DIRS[0], "PEARL/Focus_Test/RawFiles/") pearl_routines.pearl_set_currentdatadir(raw_path) pearl_routines.PEARL_setdatadir(raw_path) # setting calibration files directory cali_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Calibration/") pearl_routines.pearl_initial_dir(cali_path) atten_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Attentuation/PRL112_DC25_10MM_FF.OUT") pearl_routines.PEARL_setattenfile(atten_path) # setting data output folder data_out_path = os.path.join(DIRS[0], "PEARL/Focus_Test/DataOut/") pearl_routines.pearl_set_userdataoutput_dir(data_out_path) # run the script by calling PEARL_focus function ws_list = pearl_routines.PEARL_focus('92476_92479', 'raw', fmode=focus_mode, ttmode='TT70', atten=True, van_norm=True, debug=True) # We want to be sure that the nxs file loaded back in is the one used for reference for ws in ws_list: mantid.DeleteWorkspace(Workspace=ws) del ws
def runTest(self): self._success = False self._existing_config = config["datasearch.directories"] pearl_routines.PEARL_startup("Calib", "15_3") # setting raw files directory DataDir = os.path.join(DIRS[0], "PEARL/Calibration_Test/RawFiles/") pearl_routines.pearl_set_currentdatadir(DataDir) pearl_routines.PEARL_setdatadir(DataDir) # create calibration folder to process calibration files too CalibDir = os.path.join(DIRS[0] + "/PEARL/Calibration_Test/Calibration/") # setting calibration files directory pearl_routines.pearl_initial_dir(CalibDir) # creating group cal file ngrpfile = os.path.join(CalibDir, "test_cal_group_15_3.cal") pearl_routines.PEARL_creategroup("91560_91561", ngroupfile=ngrpfile) # create offset files offsetfile = os.path.join(CalibDir, "pearl_offset_15_3.cal") pearl_routines.PEARL_createcal("91560_91561", noffsetfile=offsetfile, groupfile=ngrpfile) # Creates the vanadium file for a cycle, where the first set of runs are the vanadium and # the second are the background in each case. vanFile35 = os.path.join(CalibDir, "van_spline_TT35_cycle_15_3.nxs") pearl_routines.PEARL_createvan( "91530_91531", "91550_91551", ttmode="TT35", nvanfile=vanFile35, nspline=40, absorb=True, debug=True ) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt35") vanFile70 = os.path.join(CalibDir, "van_spline_TT70_cycle_15_3.nxs") pearl_routines.PEARL_createvan( "91530_91531", "91550_91551", ttmode="TT70", nvanfile=vanFile70, nspline=40, absorb=True, debug=True ) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt70") vanFile88 = os.path.join(CalibDir, "van_spline_TT88_cycle_15_3.nxs") pearl_routines.PEARL_createvan( "91530_91531", "91550_91551", ttmode="TT88", nvanfile=vanFile88, nspline=40, absorb=True, debug=True ) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt88") # Custom code to create and run this single test suite # and then mark as success or a failure suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(LoadCalibTests, "test")) runner = unittest.TextTestRunner() # Run using either runner res = runner.run(suite) if res.wasSuccessful(): self._success = True else: self._success = False
def runTest(self): self._success = False # code to run the script starts here pearl_routines.PEARL_startup(usern="Mantid_Tester", thiscycle="15_4") # setting files directory here # DIRS[0] is the system test directory # setting raw files directory raw_path = os.path.join(DIRS[0], "PEARL/Focus_Test/RawFiles/") pearl_routines.pearl_set_currentdatadir(raw_path) pearl_routines.PEARL_setdatadir(raw_path) # setting calibration files directory cali_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Calibration/") pearl_routines.pearl_initial_dir(cali_path) atten_path = os.path.join( DIRS[0], "PEARL/Focus_Test/Attentuation/PRL112_DC25_10MM_FF.OUT") pearl_routines.PEARL_setattenfile(atten_path) # setting data output folder data_out_path = os.path.join(DIRS[0], "PEARL/Focus_Test/DataOut/") pearl_routines.pearl_set_userdataoutput_dir(data_out_path) # run the script by calling PEARL_focus function pearl_routines.PEARL_focus('92476_92479', 'raw', fmode='trans', ttmode='TT70', atten=True, van_norm=True, debug=True) # Custom code to create and run this single test suite # and then mark as success or a failure suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(LoadTests, "test")) runner = unittest.TextTestRunner() # Run using either runner res = runner.run(suite) if res.wasSuccessful(): self._success = True else: self._success = False
def runTest(self): self._success = False # code to run the script starts here pearl_routines.PEARL_startup(usern="Mantid_Tester", thiscycle="15_4") # setting files directory here # DIRS[0] is the system test directory # setting raw files directory raw_path = os.path.join(DIRS[0], "PEARL/Focus_Test/RawFiles/") pearl_routines.pearl_set_currentdatadir(raw_path) pearl_routines.PEARL_setdatadir(raw_path) # setting calibration files directory cali_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Calibration/") pearl_routines.pearl_initial_dir(cali_path) atten_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Attentuation/PRL112_DC25_10MM_FF.OUT") pearl_routines.PEARL_setattenfile(atten_path) # setting data output folder data_out_path = os.path.join(DIRS[0], "PEARL/Focus_Test/DataOut/") pearl_routines.pearl_set_userdataoutput_dir(data_out_path) # run the script by calling PEARL_focus function pearl_routines.PEARL_focus('92476_92479', 'raw', fmode='trans', ttmode='TT70', atten=True, van_norm=True, debug=True) # Custom code to create and run this single test suite # and then mark as success or a failure suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(LoadTests, "test")) runner = unittest.TextTestRunner() # Run using either runner res = runner.run(suite) if res.wasSuccessful(): self._success = True else: self._success = False
def _run_focus(focus_mode): # code to run the script starts here pearl_routines.PEARL_startup(usern="Mantid_Tester", thiscycle="15_4") # setting files directory here # DIRS[0] is the system test directory # setting raw files directory raw_path = os.path.join(DIRS[0], "PEARL/Focus_Test/RawFiles/") pearl_routines.pearl_set_currentdatadir(raw_path) pearl_routines.PEARL_setdatadir(raw_path) # setting calibration files directory cali_path = os.path.join(DIRS[0], "PEARL/Focus_Test/Calibration/") pearl_routines.pearl_initial_dir(cali_path) atten_path = os.path.join( DIRS[0], "PEARL/Focus_Test/Attentuation/PRL112_DC25_10MM_FF.OUT") pearl_routines.PEARL_setattenfile(atten_path) # setting data output folder data_out_path = os.path.join(DIRS[0], "PEARL/Focus_Test/DataOut/") pearl_routines.pearl_set_userdataoutput_dir(data_out_path) # run the script by calling PEARL_focus function ws_list = pearl_routines.PEARL_focus('92476_92479', 'raw', fmode=focus_mode, ttmode='TT70', atten=True, van_norm=True, debug=True) # We want to be sure that the nxs file loaded back in is the one used for reference for ws in ws_list: mantid.DeleteWorkspace(Workspace=ws) del ws
def runTest(self): self._success = False pearl_routines.PEARL_startup("Calib", "15_3") # setting raw files directory DataDir = os.path.join(DIRS[0], 'PEARL/Calibration_Test/RawFiles/') pearl_routines.pearl_set_currentdatadir(DataDir) pearl_routines.PEARL_setdatadir(DataDir) # create calibration folder to process calibration files too CalibDir = os.path.join(DIRS[0] + '/PEARL/Calibration_Test/Calibration/') # setting calibration files directory pearl_routines.pearl_initial_dir(CalibDir) # creating group cal file ngrpfile = os.path.join(CalibDir, 'test_cal_group_15_3.cal') pearl_routines.PEARL_creategroup("91560_91561", ngroupfile=ngrpfile) # create offset files offsetfile = os.path.join(CalibDir, 'pearl_offset_15_3.cal') pearl_routines.PEARL_createcal("91560_91561", noffsetfile=offsetfile, groupfile=ngrpfile) # Creates the vanadium file for a cycle, where the first set of runs are the vanadium and # the second are the background in each case. vanFile35 = os.path.join(CalibDir, 'van_spline_TT35_cycle_15_3.nxs') pearl_routines.PEARL_createvan("91530_91531", "91550_91551", ttmode="TT35", nvanfile=vanFile35, nspline=40, absorb=True, debug=True) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt35") vanFile70 = os.path.join(CalibDir, 'van_spline_TT70_cycle_15_3.nxs') pearl_routines.PEARL_createvan("91530_91531", "91550_91551", ttmode="TT70", nvanfile=vanFile70, nspline=40, absorb=True, debug=True) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt70") vanFile88 = os.path.join(CalibDir, 'van_spline_TT88_cycle_15_3.nxs') pearl_routines.PEARL_createvan("91530_91531", "91550_91551", ttmode="TT88", nvanfile=vanFile88, nspline=40, absorb=True, debug=True) CloneWorkspace(InputWorkspace="Van_data", OutputWorkspace="van_tt88") # Custom code to create and run this single test suite # and then mark as success or a failure suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(LoadCalibTests, "test")) runner = unittest.TextTestRunner() # Run using either runner res = runner.run(suite) if res.wasSuccessful(): self._success = True else: self._success = False