Пример #1
0
 def start_emu(self):
     res1 = Load(r'emu00006473.nxs', OutputWorkspace='ws1')
     Load(r'emu00006475.nxs', OutputWorkspace='ws2')
     plot([res1[0]], [3, 5, 7])
     manager = GlobalFigureManager.get_active()
     self.w = manager.window
     trigger_action(find_action_with_text(self.w, 'Fit'))
     yield 0.1
     self.fit_browser = manager.fit_browser
 def start_emu(self):
     res1 = Load(r'emu00006473.nxs', OutputWorkspace='ws1')
     Load(r'emu00006475.nxs', OutputWorkspace='ws2')
     plot([res1[0]], [3, 5, 7])
     manager = GlobalFigureManager.get_active()
     self.w = manager.window
     trigger_action(find_action_with_text(self.w, 'Fit'))
     yield 0.1
     self.fit_browser = manager.fit_browser
Пример #3
0
 def test_plot_from_names_produces_overplot_for_valid_name(
         self, get_spectra_selection_mock):
     # make first plot
     plot([self._test_ws], wksp_indices=[0])
     self._do_plot_from_names_test(get_spectra_selection_mock,
                                   expected_labels=["spec 1", "spec 2"],
                                   wksp_indices=[1],
                                   errors=False,
                                   overplot=True)
Пример #4
0
 def fitting_done(self, name):
     from workbench.plotting.functions import plot
     name += '_Workspace'
     ws = mtd[name]
     self.clear_fit_result_lines()
     plot([ws], wksp_indices=[1, 2], fig=self.canvas.figure, overplot=True)
     name += ':'
     for lin in self.get_lines():
         if lin.get_label().startswith(name):
             self.fit_result_lines.append(lin)
 def start(self):
     if 'ws' not in mtd:
         ws = Load(r'irs26176_graphite002_conv_1LFixF_s0_to_9_Result.nxs', OutputWorkspace='ws')
     else:
         ws = mtd['ws']
     plot([ws], [1])
     manager = GlobalFigureManager.get_active()
     self.w = manager.window
     trigger_action(find_action_with_text(self.w, 'Fit'))
     yield 0.1
     self.fit_browser = manager.fit_browser
Пример #6
0
 def start(self):
     if 'ws' not in mtd:
         ws = Load(r'irs26176_graphite002_conv_1LFixF_s0_to_9_Result.nxs',
                   OutputWorkspace='ws')
     else:
         ws = mtd['ws']
     plot([ws], [1])
     manager = GlobalFigureManager.get_active()
     self.w = manager.window
     trigger_action(find_action_with_text(self.w, 'Fit'))
     yield 0.1
     self.fit_browser = manager.fit_browser
Пример #7
0
    def _do_plot_spectrum(self, names, errors):
        """
        Plot spectra from the selected workspaces

        :param names: A list of workspace names
        :param errors: If true then error bars will be plotted on the points
        """
        try:
            selection = get_plot_selection(_workspaces_from_names(names), self)
            if selection is not None:
                plot(selection.workspaces, spectrum_nums=selection.spectra,
                     wksp_indices=selection.wksp_indices,
                     errors=errors)
        except BaseException:
            import traceback
            traceback.print_exc()
Пример #8
0
    def _do_plot_spectrum(self, names, errors):
        """
        Plot spectra from the selected workspaces

        :param names: A list of workspace names
        :param errors: If true then error bars will be plotted on the points
        """
        try:
            selection = get_plot_selection(_workspaces_from_names(names), self)
            if selection is not None:
                plot(selection.workspaces,
                     spectrum_nums=selection.spectra,
                     wksp_indices=selection.wksp_indices,
                     errors=errors)
        except BaseException:
            import traceback
            traceback.print_exc()
Пример #9
0
 def test_plot_from_names_within_existing_figure(
         self, get_spectra_selection_mock):
     # make existing plot
     fig = plot([self._test_ws], wksp_indices=[0])
     self._do_plot_from_names_test(get_spectra_selection_mock,
                                   expected_labels=["spec 1", "spec 2"],
                                   wksp_indices=[1],
                                   errors=False,
                                   overplot=False,
                                   target_fig=fig)
Пример #10
0
 def test_plot_from_names_within_existing_figure(self, get_spectra_selection_mock):
     # make existing plot
     fig = plot([self._test_ws], wksp_indices=[0])
     self._do_plot_from_names_test(get_spectra_selection_mock, expected_labels=["spec 1", "spec 2"],
                                   wksp_indices=[1], errors=False, overplot=False,
                                   target_fig=fig)
Пример #11
0
 def test_plot_from_names_produces_overplot_for_valid_name(self, get_spectra_selection_mock):
     # make first plot
     plot([self._test_ws], wksp_indices=[0])
     self._do_plot_from_names_test(get_spectra_selection_mock, expected_labels=["spec 1", "spec 2"],
                                   wksp_indices=[1], errors=False, overplot=True)