예제 #1
0
 def calculate_pair(self, pair_name, run, rebin=False):
     run_as_string = run_list_to_string(run)
     name = get_pair_data_workspace_name(self,
                                         pair_name,
                                         run_as_string,
                                         rebin=rebin)
     return calculate_pair_data(self, pair_name, run, rebin, name)
예제 #2
0
    def calculate_pair(self,
                       pair: MuonPair,
                       run: List[int],
                       rebin: bool = False):
        try:
            forward_group_workspace_name = self._group_pair_context[
                pair.forward_group].get_counts_workspace_for_run(run, rebin)
            backward_group_workspace_name = self._group_pair_context[
                pair.backward_group].get_counts_workspace_for_run(run, rebin)
        except KeyError:
            # A key error here means the requested workspace does not exist so return None
            return None

        run_as_string = run_list_to_string(run)
        output_workspace_name = get_pair_asymmetry_name(self,
                                                        pair.name,
                                                        run_as_string,
                                                        rebin=rebin)
        return calculate_pair_data(pair, forward_group_workspace_name,
                                   backward_group_workspace_name,
                                   output_workspace_name)
예제 #3
0
    def show_pair_data(self, pair_name, show=True, rebin=False):
        for run in self.current_runs:
            run_as_string = run_list_to_string(run)
            name = get_pair_data_workspace_name(self, pair_name, run_as_string,
                                                rebin)
            directory = get_base_data_directory(
                self, run_as_string) + get_pair_data_directory(
                    self, run_as_string)
            pair_workspace = calculate_pair_data(self, pair_name, run, rebin)

            if not rebin:
                self._pairs[pair_name].workspace[str(
                    run)] = MuonWorkspaceWrapper(pair_workspace)
                if show:
                    self._pairs[pair_name].workspace[str(run)].show(directory +
                                                                    name)
            else:
                self._pairs[pair_name].workspace_rebin[str(
                    run)] = MuonWorkspaceWrapper(pair_workspace)
                if show:
                    self._pairs[pair_name].workspace_rebin[str(run)].show(
                        directory + name)
예제 #4
0
파일: muon_context.py 프로젝트: dpaj/mantid
 def calculate_pair(self, pair_name, run, rebin=False):
     return calculate_pair_data(self, pair_name, run, rebin)
예제 #5
0
 def calculate_pair(self, pair_name, run, rebin=False):
     return calculate_pair_data(self, pair_name, run, rebin)