Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/8045_moving_cleaning_fun…
Browse files Browse the repository at this point in the history
…ction'
  • Loading branch information
keithnbrown committed Oct 3, 2013
2 parents b140e49 + 84a6149 commit 2876dd5
Show file tree
Hide file tree
Showing 8 changed files with 564 additions and 664 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class DataSets(BaseScriptElement):
scaling_factor_file_flag = True
slits_width_flag = True

#geometry correction
geometry_correction_switch = False

#incident medium list and selected value
incident_medium_list = ['H2O']
incident_medium_index_selected = 0
Expand Down Expand Up @@ -94,6 +97,7 @@ def to_script(self, for_automated_reduction=False):
_list = _incident_medium_str.split(',')

script += " IncidentMediumSelected='%s',\n" % str(_list[self.incident_medium_index_selected])
script += " GeometryCorrectionFlag=%s,\n" % str(self.geometry_correction_switch)
script += " QMin=%s,\n" % str(self.q_min)
script += " QStep=%s,\n" % str(self.q_step)

Expand Down Expand Up @@ -178,6 +182,9 @@ def to_xml(self):
xml += "<scaling_factor_file>%s</scaling_factor_file>\n" % str(self.scaling_factor_file)
xml += "<slits_width_flag>%s</slits_width_flag>\n" % str(self.slits_width_flag)

# geometry correction
xml += "<geometry_correction_switch>%s</geometry_correction_switch>\n" % str(self.geometry_correction_switch)

#incident medium
xml += "<incident_medium_list>%s</incident_medium_list>\n" % str(self.incident_medium_list[0])
xml += "<incident_medium_index_selected>%s</incident_medium_index_selected>\n" % str(self.incident_medium_index_selected)
Expand Down Expand Up @@ -291,6 +298,9 @@ def from_xml_element(self, instrument_dom):
self.slits_width_flag = BaseScriptElement.getBoolElement(instrument_dom, "slits_width_flag")
self.scaling_factor_file_flag = BaseScriptElement.getBoolElement(instrument_dom, "scaling_factor_flag")

# geometry correction switch
self.geometry_correction_switch = BaseScriptElement.getBoolElement(instrument_dom, "geometry_correction_switch")

#incident medium selected
if BaseScriptElement.getStringList(instrument_dom, "incident_medium_list") != []:
self.incident_medium_list = BaseScriptElement.getStringList(instrument_dom, "incident_medium_list")
Expand Down Expand Up @@ -344,6 +354,9 @@ def reset(self):
self.slits_width_flag = DataSets.slits_width_flag
self.scaling_factor_file_flag = DataSets.scaling_factor_file_flag

#geometry correction
self.geometry_correction_switch = DataSets.geometry_correction_switch

#incident medium selected
self.incident_medium_list = DataSets.incident_medium_list
self.incident_medium_index_selected = DataSets.incident_medium_index_selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def initialize_content(self):
call_back = partial(self._edit_event, ctrl=self._summary.slits_width_flag)
self.connect(self._summary.slits_width_flag, QtCore.SIGNAL("clicked()"), call_back)

call_back = partial(self._edit_event, ctrl=self._summary.geometry_correction_switch)
self.connect(self._summary.geometry_correction_switch, QtCore.SIGNAL("clicked()"), call_back)

call_back = partial(self._edit_event, ctrl=self._summary.q_min_edit)
self.connect(self._summary.q_min_edit, QtCore.SIGNAL("textChanged(QString)"), call_back)
call_back = partial(self._edit_event, ctrl=self._summary.q_step_edit)
Expand Down Expand Up @@ -643,6 +646,7 @@ def _reset_warnings(self):
util.set_edited(self._summary.dq_over_q, False)
util.set_edited(self._summary.fourth_column_switch, False)
util.set_edited(self._summary.slits_width_flag, False)
util.set_edited(self._summary.geometry_correction_switch, False)
util.set_edited(self._summary.angle_offset_edit, False)
util.set_edited(self._summary.angle_offset_error_edit, False)

Expand Down Expand Up @@ -1127,7 +1131,7 @@ def _plot_norm_count_vs_tof_2d(self):
"""
Will launch the 2d plot for the norm of counts vs TOF
"""
print 'inside plot_norm_count_vs_tof_2d'
return



Expand Down Expand Up @@ -1234,6 +1238,8 @@ def _add_data(self):

state.slits_width_flag = self._summary.slits_width_flag.isChecked()

state.geometry_correction_switch = self._summary.geometry_correction_switch.isChecked()

#incident medium
_incident_medium_list = [str(self._summary.incident_medium_combobox.itemText(j))
for j in range(self._summary.incident_medium_combobox.count())]
Expand All @@ -1260,6 +1266,8 @@ def _add_data(self):
else:
state.scaling_factor_file_flag = False

state.geometry_correction_switch = self._summary.geometry_correction_switch.isChecked()

#incident medium
_incident_medium_list = [str(self._summary.incident_medium_combobox.itemText(j))
for j in range(self._summary.incident_medium_combobox.count())]
Expand Down Expand Up @@ -1394,6 +1402,9 @@ def set_editing_state(self, state):
self._summary.slits_width_flag.setChecked(state.slits_width_flag)
self._use_sf_config_clicked(state.scaling_factor_file_flag)

# geomery correction
self._summary.geometry_correction_switch.setChecked(state.geometry_correction_switch)

self._reset_warnings()
self._summary.data_run_number_edit.setText(str(','.join([str(i) for i in state.data_files])))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def initialize_content(self):
self.connect(self._summary.norm_background_switch, QtCore.SIGNAL("clicked(bool)"), self._norm_background_clicked)
self.connect(self._summary.data_background_switch, QtCore.SIGNAL("clicked(bool)"), self._data_background_clicked)
self.connect(self._summary.tof_range_switch, QtCore.SIGNAL("clicked(bool)"), self._tof_range_clicked)
self.connect(self._summary.geometry_correction_switch, QtCore.SIGNAL("clicked(bool)"), self._geometry_correction_clicked)
self.connect(self._summary.plot_count_vs_y_btn, QtCore.SIGNAL("clicked()"), self._plot_count_vs_y)
self.connect(self._summary.plot_count_vs_x_btn, QtCore.SIGNAL("clicked()"), self._plot_count_vs_x)
self.connect(self._summary.plot_count_vs_y_bck_btn, QtCore.SIGNAL("clicked()"), self._plot_count_vs_y_bck)
Expand Down Expand Up @@ -278,6 +279,7 @@ def _reset_warnings(self):
util.set_edited(self._summary.norm_low_res_range_switch, False)
util.set_edited(self._summary.norm_switch, False)
util.set_edited(self._summary.tof_range_switch, False)
util.set_edited(self._summary.geometry_correction_switch, False)
util.set_edited(self._summary.q_min_edit, False)
util.set_edited(self._summary.q_step_edit, False)
util.set_edited(self._summary.det_angle_check, False)
Expand Down Expand Up @@ -631,6 +633,12 @@ def _tof_range_clicked(self, is_checked):
#self._summary.plot_tof_btn.setEnabled(is_checked)
self._edit_event(None, self._summary.tof_range_switch)

def _geometry_correction_clicked(self, is_checked):
"""
this is reached by the geometry correction switch
"""
pass

def _plot_count_vs_y(self, is_peak=True):
"""
Plot counts as a function of high-resolution pixels
Expand Down
18 changes: 16 additions & 2 deletions Code/Mantid/scripts/Interface/ui/reflectometer/data_refl_simple.ui
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1569</width>
<height>1419</height>
<width>1584</width>
<height>1469</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
Expand Down Expand Up @@ -3766,6 +3766,20 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="geometry_correction_switch">
<property name="text">
<string>Use Geometry Correction</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
Expand Down

0 comments on commit 2876dd5

Please sign in to comment.