def add_phase_table_to_ADS(self, base_name): run = get_run_numbers_as_string_from_workspace_name( base_name, self.context.data_context.instrument) directory = get_base_data_directory(self.context, run) muon_workspace_wrapper = MuonWorkspaceWrapper(directory + base_name) muon_workspace_wrapper.show() self.context.phase_context.add_phase_table(muon_workspace_wrapper)
def _get_selected_runs_from_workspace(self) -> list: """Extract runs from the output workspace of the data context.""" instrument = self.context.data_context.instrument workspace_list = self.context.data_context.current_data[ "OutputWorkspace"] return [ get_run_numbers_as_string_from_workspace_name( workspace.workspace_name, instrument) for workspace in workspace_list ]
def _create_workspace_label(self, workspace_name, index): group = str(get_group_or_pair_from_name(workspace_name)) run = str( get_run_numbers_as_string_from_workspace_name( workspace_name, self.context.data_context.instrument)) instrument = self.context.data_context.instrument rebin_label = self._get_rebin_label(workspace_name) if not self.context.plot_panes_context[self.name].settings._is_tiled: return f"{instrument}{run};{group}{rebin_label}" if self.context.plot_panes_context[ self.name].settings.is_tiled_by == "Group/Pair": return f"{run}{rebin_label}" else: return f"{group}{rebin_label}"
def _create_workspace_label(self, workspace_name, index): group = str(get_group_or_pair_from_name(workspace_name)) run = str( get_run_numbers_as_string_from_workspace_name( workspace_name, self.context.data_context.instrument)) instrument = self.context.data_context.instrument fit_label = self._get_fit_label(workspace_name, index) rebin_label = self._get_rebin_label(workspace_name) if not self.context.plot_panes_context[self.name].settings._is_tiled: return "".join( [instrument, run, ';', group, fit_label, rebin_label]) if self.context.plot_panes_context[ self.name].settings.is_tiled_by == "Group/Pair": return "".join([run, fit_label, rebin_label]) else: return "".join([group, fit_label, rebin_label])
def _get_runs_groups_and_pairs_for_simultaneous_fit_by_groups_and_pairs( self, display_type: str): """Returns the runs and group/pairs for the selected data in simultaneous fit by group/pairs mode.""" runs = [ get_run_numbers_as_string_from_workspace_name( name, self.context.data_context.instrument) for name in self.fitting_context.dataset_names ] groups_and_pairs = self._get_selected_groups_and_pairs() workspace_names = [ "/".join( self.get_fit_workspace_names_from_groups_and_runs( runs, [group_and_pair])) for group_and_pair in groups_and_pairs ] return self._get_datasets_containing_string( display_type, workspace_names, [";".join(runs)] * len(groups_and_pairs), groups_and_pairs)
def _create_workspace_label(self, workspace_name, index): run = str( get_run_numbers_as_string_from_workspace_name( workspace_name, self.context.data_context.instrument)) # maxent if MAXENT_STR in workspace_name: freq_label = self._get_freq_label(workspace_name) if RECONSTRUCTED_SPECTRA in workspace_name and self._is_groups: group = self.reconstructed_data[index] return f"{run} {group} {freq_label}" + RECONSTRUCTED_SPECTRA elif RECONSTRUCTED_SPECTRA in workspace_name: return self._raw_model._create_workspace_label( workspace_name, index) + RECONSTRUCTED_SPECTRA else: return f"{run} Frequency {freq_label}" #actual data if self._is_groups and self.reconstructed_data: group = self.reconstructed_data[index] return f"{run} {group}" elif "raw" in workspace_name: return self._raw_model._create_workspace_label( workspace_name, index) return ""
def set_run_from_name(self, name): self._run = str( get_run_numbers_as_string_from_workspace_name( name, self.context.data_context.instrument))