Ejemplo n.º 1
0
    def show_all_groups(self):
        self.calculate_all_groups()
        for run in self._data_context.current_runs:
            with WorkspaceGroupDefinition():
                for group in self._group_pair_context.groups:
                    run_as_string = run_list_to_string(run)
                    group_name = group.name
                    periods = run_list_to_string(group.periods)

                    directory = get_base_data_directory(self, run_as_string)

                    name = get_group_data_workspace_name(self,
                                                         group_name,
                                                         run_as_string,
                                                         periods,
                                                         rebin=False)
                    asym_name = get_group_asymmetry_name(self,
                                                         group_name,
                                                         run_as_string,
                                                         periods,
                                                         rebin=False)
                    asym_name_unnorm = get_group_asymmetry_unnorm_name(
                        self, group_name, run_as_string, periods, rebin=False)

                    self.group_pair_context[group_name].show_raw(
                        run, directory + name, directory + asym_name,
                        asym_name_unnorm)

                    if self._do_rebin():
                        name = get_group_data_workspace_name(self,
                                                             group_name,
                                                             run_as_string,
                                                             periods,
                                                             rebin=True)
                        asym_name = get_group_asymmetry_name(self,
                                                             group_name,
                                                             run_as_string,
                                                             periods,
                                                             rebin=True)
                        asym_name_unnorm = get_group_asymmetry_unnorm_name(
                            self,
                            group_name,
                            run_as_string,
                            periods,
                            rebin=True)

                        self.group_pair_context[group_name].show_rebin(
                            run, directory + name, directory + asym_name,
                            asym_name_unnorm)
Ejemplo n.º 2
0
    def show_raw_data(self):
        self.ads_observer.observeRename(False)
        for run in self.data_context.current_runs:
            with WorkspaceGroupDefinition():
                run_string = run_list_to_string(run)
                loaded_workspace = \
                    self.data_context._loaded_data.get_data(run=run, instrument=self.data_context.instrument)['workspace'][
                        'OutputWorkspace']
                loaded_workspace_deadtime_table = self.data_context._loaded_data.get_data(
                    run=run, instrument=self.data_context.instrument
                )['workspace']['DataDeadTimeTable']
                directory = get_base_data_directory(self, run_string)

                deadtime_name = get_deadtime_data_workspace_name(
                    self.data_context.instrument,
                    str(run[0]),
                    workspace_suffix=self.workspace_suffix)
                MuonWorkspaceWrapper(loaded_workspace_deadtime_table).show(
                    directory + deadtime_name)
                self.data_context._loaded_data.get_data(
                    run=run, instrument=self.data_context.instrument
                )['workspace']['DataDeadTimeTable'] = deadtime_name

                if len(loaded_workspace) > 1:
                    # Multi-period data
                    for i, single_ws in enumerate(loaded_workspace):
                        name = directory + get_raw_data_workspace_name(
                            self.data_context.instrument,
                            run_string,
                            multi_period=True,
                            period=str(i + 1),
                            workspace_suffix=self.workspace_suffix)
                        single_ws.show(name)
                else:
                    # Single period data
                    name = directory + get_raw_data_workspace_name(
                        self.data_context.instrument,
                        run_string,
                        multi_period=False,
                        workspace_suffix=self.workspace_suffix)
                    loaded_workspace[0].show(name)

        self.ads_observer.observeRename(True)
Ejemplo n.º 3
0
    def show_all_pairs(self):
        self.calculate_all_pairs()
        for run in self._data_context.current_runs:
            with WorkspaceGroupDefinition():
                for pair_name in self._group_pair_context.pair_names:
                    run_as_string = run_list_to_string(run)
                    name = get_pair_asymmetry_name(self,
                                                   pair_name,
                                                   run_as_string,
                                                   rebin=False)
                    directory = get_base_data_directory(self, run_as_string)

                    self.group_pair_context[pair_name].show_raw(
                        run, directory + name)

                    if self._do_rebin():
                        name = get_pair_asymmetry_name(self,
                                                       pair_name,
                                                       run_as_string,
                                                       rebin=True)
                        self.group_pair_context[pair_name].show_rebin(
                            run, directory + name)