def refresh_plot(self):
     DisplayPlots(parent=self.parent,
                  row=self.row,
                  is_data=self.is_data,
                  plot_yt=True,
                  plot_yi=True,
                  plot_it=True,
                  plot_ix=False,
                  refresh_reduction_table=False)
 def launch_update_of_plot(self):
     _row_selected = self.row_selected
     _is_data_selected = self.is_data_tab_selected()
     if self.is_row_selected_checked(_row_selected):
         DisplayPlots(parent=self.parent,
                      row=self.row_selected,
                      is_data=self.is_data_tab_selected())
     else:
         update_obj = UpdatePlotWidgetStatus(parent=self.parent)
         update_obj.disable_all()
         ClearPlots(self.parent,
                    is_data=_is_data_selected,
                    is_norm=not (_is_data_selected),
                    all_plots=True)
示例#3
0
	def closeEvent(self, event=None):
		peak1 = self.ui.jim_peak1.value()
		peak2 = self.ui.jim_peak2.value()
		back1 = self.ui.jim_back1.value()
		back2 = self.ui.jim_back2.value()
		backFlag = self.ui.jim_back_flag.isChecked()

		big_table_data = self.parent.big_table_data
		
		_data = big_table_data[self.row, self.col]
		_data.peak = [str(peak1), str(peak2)]
		_data.back = [str(back1), str(back2)]
		_data.back_flag = backFlag
		
		big_table_data[self.row, self.col] = _data

		if self.is_row_with_highest_q:
			_clock1 = self.ui.jim_clock1.value()
			_clock2 = self.ui.jim_clock2.value()
			_clocking = [str(_clock1), str(_clock2)]
			_data = big_table_data[0, 0]
			index = 0
			while (_data is not None):
				_data.clocking = _clocking
				big_table_data[index, 0] = _data
				_data = big_table_data[index+1, 0]
				index += 1
			self.parent.ui.dataPrimFromValue.setValue(_clock1)
			self.parent.ui.dataPrimToValue.setValue(_clock2)
			

		self.parent.big_table_data = big_table_data
		
		if self.data_type == 'data':
			self.parent.ui.dataPeakFromValue.setValue(peak1)
			self.parent.ui.dataPeakToValue.setValue(peak2)
			self.parent.ui.dataBackFromValue.setValue(back1)
			self.parent.ui.dataBackToValue.setValue(back2)
			self.parent.ui.dataBackgroundFlag.setChecked(backFlag)
#			self.parent.data_peak_and_back_validation(False)
			self.parent.ui.dataBackFromLabel.setEnabled(backFlag)
			self.parent.ui.dataBackFromValue.setEnabled(backFlag)
			self.parent.ui.dataBackToLabel.setEnabled(backFlag)
			self.parent.ui.dataBackToValue.setEnabled(backFlag)
			
		else:
			self.parent.ui.normPeakFromValue.setValue(peak1)
			self.parent.ui.normPeakToValue.setValue(peak2)
			self.parent.ui.normBackFromValue.setValue(back1)
			self.parent.ui.normBackToValue.setValue(back2)
			self.parent.ui.normBackgroundFlag.setChecked(backFlag)
#			self.parent.norm_peak_and_back_validation(False)
			self.parent.ui.normBackFromLabel.setEnabled(backFlag)
			self.parent.ui.normBackFromValue.setEnabled(backFlag)
			self.parent.ui.normBackToLabel.setEnabled(backFlag)
			self.parent.ui.normBackToValue.setEnabled(backFlag)

		DisplayPlots(parent = self.parent,
		             row = self.row,
		             is_data = self.is_data,
		             plot_yt = True,
		             plot_yi = True,
		             plot_it = False,
		             plot_ix = False,
		             refresh_reduction_table = True)
示例#4
0
    def closeEvent(self, event=None):
        [lowres1, lowres2, lowresFlag] = self.retrieveLowRes()
        [tof1, tof2, peak1, peak2, back1, back2,
         backFlag] = self.retrieveTofPeakBack()
        tof_auto_switch = self.ui.tof_auto_flag.isChecked()

        big_table_data = self.parent.big_table_data

        _data = big_table_data[self.row, self.col]
        _data.peak = [str(peak1), str(peak2)]
        _data.back = [str(back1), str(back2)]
        _data.back_flag = backFlag

        _data.tof_range_auto = [
            self.auto_min_tof * 1000, self.auto_max_tof * 1000
        ]
        _data.tof_range = [
            self.manual_min_tof * 1000, self.manual_max_tof * 1000
        ]
        _data.tof_range_manual = _data.tof_range
        _data.tof_range_auto_flag = tof_auto_switch
        _data.tof_auto_flag = tof_auto_switch

        _data.low_res = [str(lowres1), str(lowres2)]
        _data.low_res_flag = lowresFlag

        big_table_data[self.row, self.col] = _data
        if self.is_row_with_highest_q:
            _clock1 = self.ui.clock1.value()
            _clock2 = self.ui.clock2.value()
            _clocking = [str(_clock1), str(_clock2)]
            _data = big_table_data[0, 0]
            index = 0
            while (_data is not None):
                _data.clocking = _clocking
                big_table_data[index, 0] = _data
                _data = big_table_data[index + 1, 0]
                index += 1
            self.parent.ui.dataPrimFromValue.setValue(_clock1)
            self.parent.ui.dataPrimToValue.setValue(_clock2)

        self.parent.big_table_data = big_table_data

        # tof
        o_gui_utility = GuiUtility(parent=self.parent)
        o_gui_utility.set_auto_tof_range_radio_button(status=tof_auto_switch)
        self.parent.ui.TOFmanualFromValue.setText("%.2f" % tof1)
        self.parent.ui.TOFmanualToValue.setText("%.2f" % tof2)

        if self.data_type == 'data':
            self.parent.ui.dataPeakFromValue.setValue(peak1)
            self.parent.ui.dataPeakToValue.setValue(peak2)
            self.parent.ui.dataBackFromValue.setValue(back1)
            self.parent.ui.dataBackToValue.setValue(back2)
            self.parent.ui.dataBackgroundFlag.setChecked(backFlag)
            #self.parent.data_peak_and_back_validation(False)
            self.parent.ui.dataBackFromLabel.setEnabled(backFlag)
            self.parent.ui.dataBackFromValue.setEnabled(backFlag)
            self.parent.ui.dataBackToLabel.setEnabled(backFlag)
            self.parent.ui.dataBackToValue.setEnabled(backFlag)
            self.parent.ui.dataLowResFromValue.setValue(lowres1)
            self.parent.ui.dataLowResToValue.setValue(lowres2)
            self.parent.ui.dataLowResFromLabel.setEnabled(lowresFlag)
            self.parent.ui.dataLowResFromValue.setEnabled(lowresFlag)
            self.parent.ui.dataLowResToLabel.setEnabled(lowresFlag)
            self.parent.ui.dataLowResToValue.setEnabled(lowresFlag)
        else:
            self.parent.ui.normPeakFromValue.setValue(peak1)
            self.parent.ui.normPeakToValue.setValue(peak2)
            self.parent.ui.normBackFromValue.setValue(back1)
            self.parent.ui.normBackToValue.setValue(back2)
            self.parent.ui.normBackgroundFlag.setChecked(backFlag)
            #self.parent.norm_peak_and_back_validation(False)
            self.parent.ui.normBackFromLabel.setEnabled(backFlag)
            self.parent.ui.normBackFromValue.setEnabled(backFlag)
            self.parent.ui.normBackToLabel.setEnabled(backFlag)
            self.parent.ui.normBackToValue.setEnabled(backFlag)
            self.parent.ui.normLowResFromValue.setValue(lowres1)
            self.parent.ui.normLowResToValue.setValue(lowres2)
            self.parent.ui.normLowResFromLabel.setEnabled(lowresFlag)
            self.parent.ui.normLowResFromValue.setEnabled(lowresFlag)
            self.parent.ui.normLowResToLabel.setEnabled(lowresFlag)
            self.parent.ui.normLowResToValue.setEnabled(lowresFlag)

        DisplayPlots(parent=self.parent,
                     row=self.row,
                     is_data=self.is_data,
                     plot_yt=True,
                     plot_yi=True,
                     plot_it=True,
                     plot_ix=True,
                     refresh_reduction_table=False)

        if not tof_auto_switch:
            o_auto_tof_range = AutoTofRangeRadioButtonHandler(
                parent=self.parent)
            o_auto_tof_range.setup()
            o_auto_tof_range.line_edit_validation()
示例#5
0
    def __init__(self,
                 parent=None,
                 is_data=True,
                 entry_type='peak',
                 value_min=-1,
                 value_max=-1,
                 flag=True):
        self.parent = parent
        big_table_data = parent.big_table_data
        gui_utility = GuiUtility(self.parent)
        row = gui_utility.get_current_table_reduction_check_box_checked()
        if row == -1:
            return

        if entry_type == 'clocking':
            all_rows = gui_utility.get_all_rows()
        else:
            all_rows = gui_utility.get_other_row_with_same_run_number_as_row(
                row=row, is_data=is_data)
        for _row in all_rows:

            if is_data:
                index = 0
            else:
                index = 1
            data = big_table_data[_row, index]

            val1 = value_min
            val2 = value_max

            if (val1 > val2):
                val_min = val2
                val_max = val1
            else:
                val_min = val1
                val_max = val2

            is_plot_yt = True
            is_plot_yi = True
            is_plot_it = False
            is_plot_ix = False
            if entry_type == 'peak':
                data.peak = [str(val_min), str(val_max)]
            elif entry_type == 'back':
                data.back = [str(val_min), str(val_max)]
                data.back_flag = flag
            elif entry_type == 'low_res':
                is_plot_yt = False
                is_plot_yi = False
                is_plot_ix = True
                data.low_res = [str(val_min), str(val_max)]
                data.low_res_flag = flag
            else:
                data.clocking = [str(val_min), str(val_max)]

            big_table_data[_row, index] = data
            self.parent.big_table_data = big_table_data

            if row == _row:
                DisplayPlots(parent=self.parent,
                             row=row,
                             is_data=is_data,
                             plot_yt=is_plot_yt,
                             plot_yi=is_plot_yi,
                             plot_it=is_plot_it,
                             plot_ix=is_plot_ix,
                             refresh_reduction_table=False)
 def display_plots(self):
     DisplayPlots(parent=self.parent,
                  row=self.row,
                  is_data=self.is_working_with_data_column)
示例#7
0
    def display_plots(self, row=0):
        o_gui_utility = GuiUtility(parent=self.parent)
        is_data = o_gui_utility.is_data_tab_selected()

        DisplayPlots(parent=self.parent, row=row, is_data=is_data)