Exemple #1
0
    def update_dict_profile_to_fit(self):
        [left_range, right_range] = self.bragg_edge_range

        o_selection = BraggEdgeSelectionTab(parent=self)
        [x0, y0, x1, y1] = o_selection.get_shrinking_roi_dimension()
        o_get = Get(parent=self)
        profile = o_get.profile_of_roi(x0=x0, y0=y0,
                                       x1=x1, y1=y1)

        yaxis = profile[left_range: right_range]

        all_x_axis = o_get.all_x_axis()
        index_array = all_x_axis['index'][0]
        tof_array = all_x_axis['tof'][0]
        lambda_array = all_x_axis['lambda'][0]

        index_selected = index_array[left_range: right_range]
        tof_selected = tof_array[left_range: right_range]
        lambda_selected = lambda_array[left_range: right_range]

        profile_to_fit = {'yaxis': yaxis,
                          'xaxis': {'index': index_selected,
                                    'tof': tof_selected,
                                    'lambda': lambda_selected},
                          }
        self.dict_profile_to_fit = profile_to_fit
Exemple #2
0
    def fit_that_selection_pushed_by_program(self, initialize_region=True):
        o_get = Get(parent=self)
        x_axis = o_get.all_x_axis()
        dict_regions = o_get.all_russian_doll_region_full_infos()

        o_init = PeakFittingInitialization(parent=self)
        fitting_input_dictionary = o_init.fitting_input_dictionary(nbr_rois=len(dict_regions))
        o_init.set_top_keys_values(fitting_input_dictionary,
                                   {'xaxis': x_axis,
                                    'bragg_edge_range': self.bragg_edge_range})
        self.append_dict_regions_to_fitting_input_dictionary(dict_regions, fitting_input_dictionary)

        # fitting_input_dictionary['xaxis'] = x_axis
        # fitting_input_dictionary['bragg_edge_range'] = self.bragg_edge_range

        self.fitting_input_dictionary = fitting_input_dictionary

        o_kropff = Kropff(parent=self)
        o_kropff.reset_all_table()

        o_march = MarchDollase(parent=self)
        o_march.reset_table()

        if initialize_region:
            self.initialize_default_peak_regions()
        else:
            if self.fitting_procedure_started['kropff']:
                o_kropff.fill_table_with_fitting_information()
        o_march.fill_tables_with_fitting_information()

        if initialize_region:
            o_march_fitting = MarchDollaseFittingJobHandler(parent=self)
            o_march_fitting.initialize_fitting_input_dictionary()

        self.ui.tabWidget.setTabEnabled(1, True)
        self.ui.actionExport.setEnabled(True)
        self.select_first_row_of_all_fitting_table()