def _calculate_asymmetry(self, run, group, periods, run_as_string, periods_as_string, rebin): """Calculates the asymmetry workspaces for the given run and group.""" output_name = get_group_asymmetry_name(self, group.name, run_as_string, periods_as_string, rebin=rebin) output_name_unnormalised = get_group_asymmetry_unnorm_name( self, group.name, run_as_string, periods_as_string, rebin=rebin) group_asymmetry, group_asymmetry_unnormalised = estimate_group_asymmetry_data( self, group, run, output_name, output_name_unnormalised, periods) return group_asymmetry, group_asymmetry_unnormalised
def calculate_group(self, group_name, run, rebin=False): run_as_string = run_list_to_string(run) name = get_group_data_workspace_name(self, group_name, run_as_string, rebin=rebin) asym_name = get_group_asymmetry_name(self, group_name, run_as_string, rebin=rebin) asym_name_unnorm = get_group_asymmetry_unnorm_name(self, group_name, run_as_string, rebin=rebin) group_workspace = calculate_group_data(self, group_name, run, rebin, name) group_asymmetry, group_asymmetry_unnormalised = estimate_group_asymmetry_data( self, group_name, run, rebin, asym_name, asym_name_unnorm) return group_workspace, group_asymmetry, group_asymmetry_unnormalised
def calculate_group(self, group, run, rebin=False): run_as_string = run_list_to_string(run) periods_as_string = run_list_to_string(group.periods) # A user requirement is that processing can continue if a period is missing from some # of the runs. This filters out periods which are not in a given run. periods = [ period for period in group.periods if period <= self.num_periods(run) ] # If not periods match return nothing here. The caller then needs to handle this gracefully. if not periods: return None, None, None name = get_group_data_workspace_name(self, group.name, run_as_string, periods_as_string, rebin=rebin) asym_name = get_group_asymmetry_name(self, group.name, run_as_string, periods_as_string, rebin=rebin) asym_name_unnorm = get_group_asymmetry_unnorm_name(self, group.name, run_as_string, periods_as_string, rebin=rebin) group_workspace = calculate_group_data(self, group, run, rebin, name, periods) group_asymmetry, group_asymmetry_unnormalised = estimate_group_asymmetry_data( self, group, run, rebin, asym_name, asym_name_unnorm, periods) return group_workspace, group_asymmetry, group_asymmetry_unnormalised
def show_group_data(self, group_name, show=True, rebin=False): for run in self.current_runs: run_as_string = run_list_to_string(run) group_workspace = calculate_group_data(self, group_name, run, rebin) group_asymmetry = estimate_group_asymmetry_data( self, group_name, run, rebin) directory = get_base_data_directory( self, run_as_string) + get_group_data_directory( self, run_as_string) name = get_group_data_workspace_name(self, group_name, run_as_string, rebin) asym_name = get_group_asymmetry_name(self, group_name, run_as_string, rebin) if not rebin: self._groups[group_name]._workspace[str( run)] = MuonWorkspaceWrapper(group_workspace) self._groups[group_name]._asymmetry_estimate[str( run)] = MuonWorkspaceWrapper(group_asymmetry) if show: self._groups[group_name].workspace[str(run)].show( directory + name) self._groups[group_name]._asymmetry_estimate[str( run)].show(directory + asym_name) else: self._groups[group_name]._workspace_rebin[str( run)] = MuonWorkspaceWrapper(group_workspace) self._groups[group_name]._asymmetry_estimate_rebin[str( run)] = MuonWorkspaceWrapper(group_asymmetry) if show: self._groups[group_name]._workspace_rebin[str(run)].show( directory + name) self._groups[group_name]._asymmetry_estimate_rebin[str( run)].show(directory + asym_name)
def calculate_group(self, group_name, run, rebin=False): group_workspace = calculate_group_data(self, group_name, run, rebin) group_asymmetry, group_asymmetry_unnormalised = estimate_group_asymmetry_data( self, group_name, run, rebin) return group_workspace, group_asymmetry, group_asymmetry_unnormalised
def calculate_group(self, group_name, run, rebin=False): group_workspace = calculate_group_data(self, group_name, run, rebin) group_asymmetry = estimate_group_asymmetry_data(self, group_name, run, rebin) return group_workspace, group_asymmetry