def add_fft_workspace_to_ADS(self, input_workspace, imaginary_input_workspace, fft_workspace_label): run = re.search('[0-9]+', input_workspace).group() fft_workspace = mantid.AnalysisDataService.retrieve(fft_workspace_label) Im_run = "" if imaginary_input_workspace != "": Im_run = re.search('[0-9]+', imaginary_input_workspace).group() fft_workspace_name = get_fft_workspace_name(input_workspace, imaginary_input_workspace) directory = get_fft_workspace_group_name(fft_workspace_name, self.load.data_context.instrument, self.load.workspace_suffix) Re = get_group_or_pair_from_name(input_workspace) Im = get_group_or_pair_from_name(imaginary_input_workspace) shift = 3 if fft_workspace.getNumberHistograms() == 6 else 0 spectra = {"_" + FREQUENCY_EXTENSIONS["RE"]: 0 + shift, "_" + FREQUENCY_EXTENSIONS["IM"]: 1 + shift, "_" + FREQUENCY_EXTENSIONS["MOD"]: 2 + shift} for spec_type in list(spectra.keys()): extracted_ws = extract_single_spec(fft_workspace, spectra[spec_type], fft_workspace_name + spec_type) if 'PhaseQuad' in self.view.workspace: self.load._frequency_context.add_FFT(fft_workspace_name + spec_type, run, Re, Im_run, Im, phasequad=True) else: self.load._frequency_context.add_FFT(fft_workspace_name + spec_type, run, Re, Im_run, Im) muon_workspace_wrapper = MuonWorkspaceWrapper(extracted_ws) muon_workspace_wrapper.show(directory + fft_workspace_name + spec_type)
def add_fft_workspace_to_ADS(self, input_workspace, imaginary_input_workspace, fft_workspace): run = re.search('[0-9]+', input_workspace).group() fft_workspace_name = get_fft_workspace_name(input_workspace, imaginary_input_workspace) group = get_fft_workspace_group_name(fft_workspace_name, self.load.data_context.instrument) directory = get_base_data_directory(self.load, run) + group muon_workspace_wrapper = MuonWorkspaceWrapper(fft_workspace, directory + fft_workspace_name) muon_workspace_wrapper.show()
def add_fft_workspace_to_ADS(self, input_workspace, imaginary_input_workspace, fft_workspace): run = re.search('[0-9]+', input_workspace).group() fft_workspace_name = get_fft_workspace_name(input_workspace, imaginary_input_workspace) group = get_fft_workspace_group_name(fft_workspace_name, self.load.data_context.instrument) directory = get_base_data_directory(self.load, run) + group muon_workspace_wrapper = MuonWorkspaceWrapper( fft_workspace, directory + fft_workspace_name) muon_workspace_wrapper.show()
def add_fft_workspace_to_ADS(self, input_workspace, imaginary_input_workspace, fft_workspace_label): run = re.search('[0-9]+', input_workspace).group() fft_workspace = mantid.AnalysisDataService.retrieve( fft_workspace_label) Im_run = "" if imaginary_input_workspace != "": Im_run = re.search('[0-9]+', imaginary_input_workspace).group() fft_workspace_name = get_fft_workspace_name(input_workspace, imaginary_input_workspace) directory = get_fft_workspace_group_name( fft_workspace_name, self.load.data_context.instrument, self.load.workspace_suffix) Re = get_group_or_pair_from_name(input_workspace) Im = get_group_or_pair_from_name(imaginary_input_workspace) shift = 3 if fft_workspace.getNumberHistograms() == 6 else 0 spectra = { "_" + FREQUENCY_EXTENSIONS["RE"]: 0 + shift, "_" + FREQUENCY_EXTENSIONS["IM"]: 1 + shift, "_" + FREQUENCY_EXTENSIONS["MOD"]: 2 + shift } for spec_type in list(spectra.keys()): extracted_ws = extract_single_spec(fft_workspace, spectra[spec_type], fft_workspace_name + spec_type) self.load._frequency_context.add_FFT( fft_workspace_name + spec_type, run, Re, Im_run, Im) muon_workspace_wrapper = MuonWorkspaceWrapper(extracted_ws) muon_workspace_wrapper.show(directory + fft_workspace_name + spec_type) # This is a small hack to get the output name to a location where it can be part of the calculation finished # signal. self._output_workspace_name = fft_workspace_name + '_mod'