示例#1
0
    def show_pair(self, run: list, pair: MuonPair):
        pair_name = pair.name
        # Do not want to rename phasequad parts here
        if "_Re_" in pair_name or "_Im_" in pair_name:
            return

        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)
示例#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)