def calculate_background(self, fit_function: IFunction) -> None:
        """Calculates the background in the counts workspace."""
        params = self._get_parameters_for_background_fit(fit_function,
                                                         create_output=False)
        function, fit_status, chi_squared = run_Fit(
            params, AlgorithmManager.create("Fit"))

        self._handle_background_fit_output(function, fit_status, chi_squared)
 def create_background_output_workspaces(self,
                                         fit_function: IFunction) -> tuple:
     """Creates the output workspaces for the currently stored background data."""
     params = self._get_parameters_for_background_fit(fit_function,
                                                      create_output=True,
                                                      max_iterations=0)
     _, parameter_table_name, _, _, _, covariance_matrix_name = run_Fit(
         params, AlgorithmManager.create("Fit"))
     return parameter_table_name, covariance_matrix_name
Esempio n. 3
0
 def do_single_fit_and_return_workspace_parameters_and_fit_function(
         self, parameters_dict):
     alg = mantid.AlgorithmManager.create("Fit")
     output_workspace, output_parameters, function_object, output_status, output_chi, covariance_matrix = run_Fit(
         parameters_dict, alg)
     CopyLogs(InputWorkspace=parameters_dict['InputWorkspace'],
              OutputWorkspace=output_workspace,
              StoreInADS=False)
     return output_workspace, output_parameters, function_object, output_status, output_chi, covariance_matrix
Esempio n. 4
0
    def do_single_fit_and_return_workspace_parameters_and_fit_function(
            self, parameters_dict):
        if 'DoublePulseEnabled' in self.context.gui_context and self.context.gui_context[
                'DoublePulseEnabled']:
            alg = self._create_double_pulse_alg()
        else:
            alg = mantid.AlgorithmManager.create("Fit")

        output_workspace, output_parameters, function_object, output_status, output_chi, covariance_matrix = run_Fit(
            parameters_dict, alg)
        CopyLogs(InputWorkspace=parameters_dict['InputWorkspace'],
                 OutputWorkspace=output_workspace,
                 StoreInADS=False)
        return output_workspace, output_parameters, function_object, output_status, output_chi, covariance_matrix
Esempio n. 5
0
 def do_single_fit_and_return_workspace_parameters_and_fit_function(self, parameters_dict):
     alg = mantid.AlgorithmManager.create("Fit")
     return run_Fit(parameters_dict, alg)