Пример #1
0
        def _new_data_set():
            d = DataSets()
            d.NormFlag = True
            d.DataBackgroundFlag = True
            d.data_x_range_flag = True
            d.norm_x_range_flag = True
            d.DataTofRange = tof_range
            d.NormBackgroundFlag = True
            d.slits_width_flag = True
            d.incident_medium_list = [incident_medium]
            d.incident_medium_index_selected = 0
            d.angle_offset = angle_offset
            d.angle_offset_error = angle_offset_err

            d.q_min = q_min
            d.q_step = q_step
            d.fourth_column_dq0 = dQ_constant
            d.fourth_column_dq_over_q = dQ_slope
            d.scaling_factor_file = sf_file
            return d
Пример #2
0
        def _new_data_set():
            d = DataSets()
            d.NormFlag = True
            d.DataBackgroundFlag = True
            d.data_x_range_flag = True
            d.norm_x_range_flag = True
            d.DataTofRange = tof_range
            d.NormBackgroundFlag = True
            d.slits_width_flag = True
            d.incident_medium_list = [incident_medium]
            d.incident_medium_index_selected = 0
            d.angle_offset = angle_offset
            d.angle_offset_error = angle_offset_err

            d.q_min = q_min
            d.q_step = q_step
            d.fourth_column_dq0 = dQ_constant
            d.fourth_column_dq_over_q = dQ_slope
            d.scaling_factor_file = sf_file
            return d
Пример #3
0
    def get_editing_state(self):

        m = REFLDataSets()

        #Peak from/to pixels
        m.DataPeakPixels = [
            int(self._summary.data_peak_from_pixel.text()),
            int(self._summary.data_peak_to_pixel.text())
        ]

        #incident medium
        m.incident_medium_list = [
            self._summary.incident_medium_combobox.itemText(i)
            for i in range(self._summary.incident_medium_combobox.count())
        ]
        m.incident_medium_index_selected = self._summary.incident_medium_combobox.currentIndex(
        )

        m.data_x_range = [
            int(self._summary.x_min_edit.text()),
            int(self._summary.x_max_edit.text())
        ]
        m.data_x_range_flag = self._summary.data_low_res_range_switch.isChecked(
        )

        m.norm_x_range = [
            int(self._summary.norm_x_min_edit.text()),
            int(self._summary.norm_x_max_edit.text())
        ]
        m.norm_x_range_flag = self._summary.norm_low_res_range_switch.isChecked(
        )

        #Background flag
        m.DataBackgroundFlag = self._summary.data_background_switch.isChecked()

        #Background from/to pixels
        roi1_from = int(self._summary.data_background_from_pixel1.text())
        roi1_to = int(self._summary.data_background_to_pixel1.text())
        m.DataBackgroundRoi = [roi1_from, roi1_to, 0, 0]

        #data metadata
        m.tthd_value = str(self._summary.tthd_value.text())
        m.ths_value = str(self._summary.ths_value.text())

        #from TOF and to TOF
        from_tof = float(self._summary.data_from_tof.text())
        to_tof = float(self._summary.data_to_tof.text())
        m.DataTofRange = [from_tof, to_tof]
        m.TofRangeFlag = self._summary.tof_range_switch.isChecked()

        datafiles = str(self._summary.data_run_number_edit.text()).split(',')
        m.data_files = [int(i) for i in datafiles]

        # Normalization flag
        m.NormFlag = self._summary.norm_switch.isChecked()

        # Normalization options
        m.norm_file = int(self._summary.norm_run_number_edit.text())
        m.NormPeakPixels = [
            int(self._summary.norm_peak_from_pixel.text()),
            int(self._summary.norm_peak_to_pixel.text())
        ]

        #Background flag
        m.NormBackgroundFlag = self._summary.norm_background_switch.isChecked()

        #Background from/to pixels
        roi1_from = int(self._summary.norm_background_from_pixel1.text())
        roi1_to = int(self._summary.norm_background_to_pixel1.text())
        m.NormBackgroundRoi = [roi1_from, roi1_to]

        #4th column (precision)
        m.fourth_column_flag = self._summary.fourth_column_switch.isChecked()
        m.fourth_column_dq0 = float(self._summary.dq0.text())
        m.fourth_column_dq_over_q = float(self._summary.dq_over_q.text())
        #        self._fourth_column_clicked(m.fourth_column_flag)

        return m
Пример #4
0
    def get_editing_state(self):
        
        m = REFLDataSets()
        
        #Peak from/to pixels
        m.DataPeakPixels = [int(self._summary.data_peak_from_pixel.text()),
                            int(self._summary.data_peak_to_pixel.text())] 
        
        #incident medium
        m.incident_medium_list = [self._summary.incident_medium_combobox.itemText(i) 
                                  for i in range(self._summary.incident_medium_combobox.count())]
        m.incident_medium_index_selected = self._summary.incident_medium_combobox.currentIndex()
        
        
        m.data_x_range = [int(self._summary.x_min_edit.text()),
                     int(self._summary.x_max_edit.text())]
        m.data_x_range_flag = self._summary.data_low_res_range_switch.isChecked()
        
        m.norm_x_range = [int(self._summary.norm_x_min_edit.text()),
                          int(self._summary.norm_x_max_edit.text())]
        m.norm_x_range_flag = self._summary.norm_low_res_range_switch.isChecked()
        
        #Background flag
        m.DataBackgroundFlag = self._summary.data_background_switch.isChecked()

        #Background from/to pixels
        roi1_from = int(self._summary.data_background_from_pixel1.text())
        roi1_to = int(self._summary.data_background_to_pixel1.text())
        m.DataBackgroundRoi = [roi1_from, roi1_to, 0, 0]

        #data metadata
        m.tthd_value = str(self._summary.tthd_value.text())
        m.ths_value = str(self._summary.ths_value.text())

        #from TOF and to TOF
        from_tof = float(self._summary.data_from_tof.text())
        to_tof = float(self._summary.data_to_tof.text())
        m.DataTofRange = [from_tof, to_tof]
        m.TofRangeFlag = self._summary.tof_range_switch.isChecked()
    
        datafiles = str(self._summary.data_run_number_edit.text()).split(',')
        m.data_files = [int(i) for i in datafiles]
    
        # Normalization flag
        m.NormFlag = self._summary.norm_switch.isChecked()

        # Normalization options
        m.norm_file = int(self._summary.norm_run_number_edit.text())
        m.NormPeakPixels = [int(self._summary.norm_peak_from_pixel.text()),
                            int(self._summary.norm_peak_to_pixel.text())]   
        
        #Background flag
        m.NormBackgroundFlag = self._summary.norm_background_switch.isChecked()

        #Background from/to pixels
        roi1_from = int(self._summary.norm_background_from_pixel1.text())
        roi1_to = int(self._summary.norm_background_to_pixel1.text())
        m.NormBackgroundRoi = [roi1_from, roi1_to]
        
        #4th column (precision)
        m.fourth_column_flag = self._summary.fourth_column_switch.isChecked()
        m.fourth_column_dq0 = float(self._summary.dq0.text())
        m.fourth_column_dq_over_q = float(self._summary.dq_over_q.text())
#        self._fourth_column_clicked(m.fourth_column_flag)

        return m