def setUp(self): self.test_folder = tempfile.mkdtemp(suffix='template_test/') self.tif_folder = os.path.join(self.test_folder, 'tiffs/') os.mkdir(self.tif_folder) # copy across the process list to the working directory self.process_list_path = os.path.join(self.test_folder, 'xrd_template_test.nxs') shutil.copyfile(tu.get_test_process_path('xrd_template_test.nxs'), self.process_list_path) utils.populate_plugins() self.process_list = Content() self.process_list.fopen(self.process_list_path, update=False) for idx in self.process_list.get_positions(): self.process_list.refresh(idx) self.detX_axis_label = {'dim': '$idx_detx', 'name': 'detector_x', 'value': None, 'units': 'pixels'} self.detY_axis_label = {'dim': '$idx_dety', 'name': 'detector_y', 'value': None, 'units': 'pixels'} self.yaml = OrderedDict() # now make some standard modifications self.yaml['inherit'] = [tu.get_test_data_path(os.path.join('i18_templates', 'xrd_calibration.yml'))] self.yaml['xrd'] = OrderedDict() self.yaml['xrd']['params'] = {} self.yaml['xrd']['data'] = {} self.yaml['xrd']['data']['folder'] = self.tif_folder self.yaml['xrd']['params']['cfile'] = \ "$h5py.File('%s', 'r')" % tu.get_test_data_path('LaB6_calibration_new.nxs') self.yaml['xrd']['patterns'] = {} self.yaml['xrd']['patterns']['DIFFRACTION'] = {'core_dims': '$(idx_detx, idx_dety)', 'slice_dims': '$tuple([d for d in dims if d not in [idx_detx, idx_dety]])'} self.yaml['xrd']['axis_labels'] = {} self.yaml['xrd']['metadata'] = {} self.data_file_path = 'test_data.nxs' self.data_file = h5.File(self.data_file_path, 'w') # this will have the axes in.
def test_process(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('xrd_test.nxs'), "process_file": tu.get_test_data_path('PyFAI_azimuth_test.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_process(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('stxm.nxs'), "process_file": tu.get_test_data_path('basic_stxm_process.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_FastXrf(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('fluo.nxs'), "process_file": tu.get_test_data_path('basic_fastxrf_process.nxs'), "out_path": tempfile.mkdtemp() } PluginRunner(options)
def test_i18_stxm(self): # data_file = '/dls/i18/data/2016/sp12601-1/processing/Savu_Test_Data/70214_Cat2_RT_1.nxs' data_file = tu.get_test_data_path('i18_test_data.nxs') process_file = tu.get_test_process_path('basic_stxm_process_i18.nxs') # process_file = tu.get_process_list_path('stxm_tomo_i18.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_diffraction_correction(self): data_file = tu.get_test_data_path('i18_test_data.nxs') # data_file = '/dls/i18/data/2016/sp13939-1/Experiment_1/nexus/75996_alphanitrateRT_1.nxs' process_file = tu.get_test_process_path('diffraction_absorption_correction_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_simple_fit_runs(self): # data_file = '/dls/i13-1/data/2016/mt14190-1/raw/91318.nxs'# data_file = tu.get_test_data_path('i18_test_data.nxs') process_file = tu.get_test_process_path('pymca_test.nxs') # process_file = '/dls/i13-1/data/2016/mt14190-1/processing/savu/process_lists/pymca_process.nxs' options = tu.set_options(data_file, process_file=process_file) self.datapath = options['out_path'] run_protected_plugin_runner(options)
def test_monitor_correction(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('mm.nxs'), "process_file": tu.get_test_process_path('monitor_correction_test.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_fbp(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('24737.nxs'), "process_file": tu.get_test_process_path('miro_test.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_process(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path("mm.nxs"), "process_file": tu.get_process_list_path("I18_pipeline_just_xrd.nxs"), "out_path": tempfile.mkdtemp(), } run_protected_plugin_runner(options)
def test_reload(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('savu_nexus_loader_test1.nxs') exp = run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file)) data_file = exp.meta_data.get('nxs_filename') process_file = tu.get_test_process_path('savu_nexus_loader_test2.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_stxm_tomo_astra(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('mm.nxs'), "process_file": tu.get_test_process_path('simple_stxm_tomo_test_astra.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_cgls_astra(self): process = 'basic_tomo_iterative_process.nxs' options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('24737.nxs'), "process_file": tu.get_test_process_path(process), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_mm(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('mm.nxs'), "process_file": tu.get_test_process_path( 'multiple_mm_inputs_test.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_multi_params_tomo(self): process = 'basic_tomo_process_preview_params_test.nxs' options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('24737.nxs'), "process_file": tu.get_test_process_path(process), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_process(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path('mm.nxs'), # "process_file": tu.get_test_process_path('simplefitreconstest.nxs'), "process_file": tu.get_test_process_path( 'testing_mm_sart_recon.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_multi_params_i12tomo(self): process = 'i12_tomo_pipeline_test.nxs' options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path( 'i12_test_data/i12_test_data.nxs'), "process_file": tu.get_test_process_path(process), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_process_preview(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": tu.get_test_data_path( '/i12_test_data/i12_test_data.nxs'), "process_file": tu.get_test_process_path( 'i12_tomo_pipeline_preview_test.nxs'), "out_path": tempfile.mkdtemp() } run_protected_plugin_runner(options)
def test_Pyfai(self): options = { "transport": "hdf5", "process_names": "CPU0", "data_file": '/media/My Passport/Steve_data/xrd_tester2.nxs', "process_file": tu.get_test_data_path('PyFAI_azimuth_test.nxs'), "out_path": tempfile.mkdtemp() } try: PluginRunner(options) except ImportError as e: print("Failed to run test as libraries not available (%s)," % (e) + " passing test") pass
def test_ccpi_denoise_gpu(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('ccpi_denoising_gpu_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('i18_test_data.nxs') process_file = tu.get_process_list_path('multimodal_tomo_i18.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_chunking(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('pyfai_tomo_chunking_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_binary_quantisation_filter(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('threshold_filter_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_cgls_recon(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('ccpi_cgls_recon_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_ring_removal_regularization(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path( 'ring_removal_regularization_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_simple_fit_XRD(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('findpeakstest.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def get_conf_path(self): path = self.parameters['config'] if path.split(os.sep)[0] == 'Savu': path = tu.get_test_data_path(path.split('/test_data/data')[1]) return path
def test_process(self): data_file = tu.get_test_data_path('mm.nxs') process_file = \ tu.get_test_process_path('simple_stxm_tomo_test_astra.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_chunking(self): data_file = tu.get_test_data_path('xrd_single_sino.nxs') process_file = tu.get_test_process_path( 'pyfai_tomo_chunking_single_sino_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_ring_removal(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('ccpi_ring_artefact_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def set_data_options(self): options = tu.set_options(tu.get_test_data_path('24737.nxs')) options['process_file'] = \ tu.get_test_process_path('checkpoint_process2.nxs') return options
def test_mm(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('multiple_mm_inputs_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_nx_fluo(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('basic_fluo_process.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('/i12_test_data/i12_test_data.nxs') process_file = tu.get_test_process_path('i12_tomo_pipeline_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_median_filter(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('median_filter_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_mcnear(self): data_file = tu.get_test_data_path('i18_test_data.nxs') process_file = tu.get_test_process_path( 'mcnear_absorption_correction.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def get_dummyhdf_path(self): return tu.get_test_data_path('i18_test_data.nxs')
def test_process(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('mm_template_processing.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def get_cal_path(self): path = self.parameters['calibration_path'] if path.split(os.sep)[0] == 'Savu': path = tu.get_test_data_path(path.split('/test_data/data')[1]) return path
def test_histogram(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('histogramtest.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_nx_multimodal(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('MMtest.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_pyfai_filtered(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('PyFAI_azimuth_test_bragg.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_simple_fit_XRF(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('simple_fit_test_XRF.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path( 'I18_pipeline_just_xrd_from_raw_filtered_adp_mod2.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
logging.info("Starting the test process") logging.debug("Rank : %i - Size : %i", RANK, SIZE) IP = socket.gethostbyname(socket.gethostname()) logging.debug("ip address is : %s", IP) call_mpi_barrier() import os logging.debug(os.getenv('LD_LIBRARY_PATH')) call_mpi_barrier() process_filename = tu.get_test_data_path(options.process_filename) process_list = ProcessList() process_list.populate_process_list(process_filename) first_plugin = pu.load_plugin(process_list.process_list[0]['id']) input_data = tu.get_appropriate_input_data(first_plugin)[0] process.run_process_list(input_data, process_list, options.directory, mpi=True, processes=ALL_PROCESSES, process=RANK) call_mpi_barrier()
def test_basic_operations(self): data_file = tu.get_test_data_path('image_test/tiffs') process_file = tu.get_test_process_path('tiff_loader_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('mm_template_processing.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('24737.nxs') process_file = \ tu.get_test_process_path('simple_recon_test_process.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('fluo_single_sino.nxs') process_file = tu.get_test_process_path('simple_fit_test_XRF_tomo.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_monitor_correction(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('monitor_correction_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_multi_params_tomo(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path( 'basic_tomo_process_preview_params_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_sinogram_alignment(self): data_file = tu.get_test_data_path('24737.nxs') process_file = tu.get_test_process_path('sino_alignment_test.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_process_preview(self): data_file = tu.get_test_data_path('24737.nxs') process_file = \ tu.get_test_process_path('tomo_pipeline_preview_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_process(self): data_file = tu.get_test_data_path('mm.nxs') process_file = \ tu.get_test_process_path('simple_stxm_tomo_test_astra.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_distortion_correction(self): data_file = tu.get_test_data_path('24737.nxs') process_file = \ tu.get_test_process_path('distortion_correction_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def get_path(self,field): path = self.parameters[field] if path.split(os.sep)[0] == 'Savu': path = tu.get_test_data_path(path.split('/test_data/data')[1]) return path
def test_nx_stxm(self): data_file = tu.get_test_data_path('mm.nxs') process_file = tu.get_test_process_path('basic_stxm_process.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_correction2(self): data_file = tu.get_test_data_path('24737.nxs') process_file = \ tu.get_test_process_path('time_based_correction_test2.nxs') run_protected_plugin_runner( tu.set_options(data_file, process_file=process_file))
def test_pyfai(self): data_file = tu.get_test_data_path('i18_test_data.nxs')#'/dls/i18/data/2016/sp12601-1/processing/Savu_Test_Data/70214_Cat2_RT_1.nxs'# process_file = tu.get_test_process_path('PyFAI_azimuth_new_calib_i18_test.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))
def test_nx_xrd(self): data_file = tu.get_test_data_path('i18_test_data.nxs') process_file = tu.get_test_process_path('basic_xrd_process_i18.nxs') run_protected_plugin_runner(tu.set_options(data_file, process_file=process_file))