Skip to content
Snippets Groups Projects
Unverified Commit 0de17897 authored by Pete Peterson's avatar Pete Peterson Committed by GitHub
Browse files

Merge pull request #21145 from mantidproject/21141_remove_ornl_reflectometry_interfaces

Remove ornl reflectometry interfaces
parents ba23fe31 f55e01bf
No related branches found
No related tags found
No related merge requests found
Showing
with 6 additions and 10468 deletions
......@@ -20,7 +20,7 @@ default.instrument =
Q.convention = Inelastic
# Set of PyQt interfaces to add to the Interfaces menu, separated by a space. Interfaces are seperated from their respective categories by a "/".
mantidqt.python_interfaces = Direct/DGS_Reduction.py Direct/DGSPlanner.py Direct/PyChop.py SANS/ORNL_SANS.py Reflectometry/REFL_Reduction.py Reflectometry/REFL_SF_Calculator.py Reflectometry/REFM_Reduction.py Utility/TofConverter.py Reflectometry/ISIS_Reflectometry_Old.py Diffraction/Powder_Diffraction_Reduction.py Utility/FilterEvents.py Diffraction/HFIR_Powder_Diffraction_Reduction.py Diffraction/HFIR_4Circle_Reduction.py Utility/QECoverage.py SANS/ISIS_SANS_v2_experimental.py Muon/Frequency_Domain_Analysis.py
mantidqt.python_interfaces = Direct/DGS_Reduction.py Direct/DGSPlanner.py Direct/PyChop.py SANS/ORNL_SANS.py Utility/TofConverter.py Reflectometry/ISIS_Reflectometry_Old.py Diffraction/Powder_Diffraction_Reduction.py Utility/FilterEvents.py Diffraction/HFIR_Powder_Diffraction_Reduction.py Diffraction/HFIR_4Circle_Reduction.py Utility/QECoverage.py SANS/ISIS_SANS_v2_experimental.py Muon/Frequency_Domain_Analysis.py
mantidqt.python_interfaces_directory = @MANTID_ROOT@/scripts
......
......@@ -12,6 +12,11 @@ Low-Q Changes
Reflectometry
-------------
Features Removed
################
* The REFL Reduction, REFL SF Calculator and REFM Reduction graphical interface have been removed, they were not in active use, and were a source of bugs as well as using testing effort that is better directed elsewhere.
Small Angle Scattering
----------------------
- BeamCentreFinder has been implemented to work with the new backend in the python script window.
......
#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
from compile_util import compile_ui
# Compile resource file
try:
# Common widgets
#compile_ui("ui/reduction_main.ui")
#compile_ui("ui/hfir_output.ui")
#compile_ui("ui/instrument_dialog.ui")
# REF
compile_ui("ui/reflectometer/refm_reduction.ui")
compile_ui("ui/reflectometer/refl_stitching.ui")
except:
print("Could not compile resource file")
......@@ -6,9 +6,6 @@
from __future__ import (absolute_import, division, print_function)
from reduction_gui.instruments.hfir_interface_dev import HFIRInterface
from reduction_gui.instruments.eqsans_interface_dev import EQSANSInterface
from reduction_gui.instruments.reflectometer_l_interface_dev import REFLInterface
from reduction_gui.instruments.reflectometer_m_interface_dev import REFMInterface
from reduction_gui.instruments.reflectometer_sf_interface_dev import REFLSFInterface
from reduction_gui.instruments.dgs_interface_dev import DgsInterface
from reduction_gui.instruments.diffraction_interface_dev import DiffractionInterface
from reduction_gui.instruments.toftof_interface_dev import TOFTOFInterface
......@@ -23,9 +20,6 @@ INSTRUMENT_DICT = {"HFIR": {"BIOSANS": HFIRInterface,
"CNCS": DgsInterface,
"EQSANS": EQSANSInterface,
"HYSPEC": DgsInterface,
"REFL": REFLInterface,
"REFLSF": REFLSFInterface,
"REFM": REFMInterface,
"SEQUOIA": DgsInterface,
"PG3": DiffractionInterface,
"NOM": DiffractionInterface,
......
from __future__ import (absolute_import, division, print_function)
from reduction_gui.instruments.interface import InstrumentInterface
from reduction_gui.widgets.reflectometer.refl_reduction import DataReflWidget
from reduction_gui.reduction.reflectometer.refl_reduction import REFLReductionScripter
try:
from reduction_gui.widgets.reflectometer.stitcher import StitcherWidget
HAS_STITCHER = True
except:
HAS_STITCHER = False
class REFLInterface(InstrumentInterface):
"""
Defines the widgets for REF_L reduction
"""
def __init__(self, name, settings):
super(REFLInterface, self).__init__(name, settings)
self.ERROR_REPORT_NAME = "refl_error_report.xml"
self.LAST_REDUCTION_NAME = ".mantid_last_refl_reduction.xml"
# Scripter object to interface with Mantid
self.scripter = REFLReductionScripter(name=name)
# data REF_L tab
self.attach(DataReflWidget(settings = self._settings, name=name))
if HAS_STITCHER:
self.attach(StitcherWidget(settings = self._settings))
from __future__ import (absolute_import, division, print_function)
from reduction_gui.instruments.interface import InstrumentInterface
from reduction_gui.widgets.reflectometer.refm_reduction import DataReflWidget
from reduction_gui.widgets.output import OutputWidget
try:
from reduction_gui.widgets.reflectometer.stitcher import StitcherWidget
HAS_STITCHER = True
except:
HAS_STITCHER = False
class REFMInterface(InstrumentInterface):
"""
Defines the widgets for REF_M reduction
"""
def __init__(self, name, settings):
super(REFMInterface, self).__init__(name, settings)
self.ERROR_REPORT_NAME = "refm_error_report.xml"
self.LAST_REDUCTION_NAME = ".mantid_last_refm_reduction.xml"
# data REF_M tab
self.attach(DataReflWidget(settings = self._settings, name=name))
# Reduction output
self.attach(OutputWidget(settings = self._settings))
if HAS_STITCHER:
self.attach(StitcherWidget(settings = self._settings))
from __future__ import (absolute_import, division, print_function)
from reduction_gui.instruments.interface import InstrumentInterface
from reduction_gui.widgets.reflectometer.refl_sf_calculator import DataReflSFCalculatorWidget
from reduction_gui.reduction.reflectometer.refl_sf_calculator import REFLSFCalculatorScripter
class REFLSFInterface(InstrumentInterface):
"""
Defines the widgets for REF_L reduction
"""
def __init__(self, name, settings):
super(REFLSFInterface, self).__init__(name, settings)
self.ERROR_REPORT_NAME = "refl_error_report.xml"
self.LAST_REDUCTION_NAME = ".mantid_last_refl_reduction.xml"
# Scripter object to interface with Mantid
self.scripter = REFLSFCalculatorScripter(name=name)
# data REF_L tab
self.attach(DataReflSFCalculatorWidget(settings = self._settings, name=name))
#pylint: disable=invalid-name
"""
This algorithm reads the SNS ROI files (used in M. Reuter data reduction).
Format of file:
bank1_5_1
bank1_5_2
bank1_5_3
....
bank1_5_256
bank1_6_1
bank1_6_2
bank1_6_3
....
bank1_6_256
The range of pixel is then retrieved [5,6]
Code contributed by Jean Bilheux (SNS)
"""
from __future__ import (absolute_import, division, print_function)
class LoadSNSRoi:
x_list = []
y_list = []
mode = "" #'narrow/broad" or 'discrete'
pixel_range = []
def __init__(self, filename=None):
self.x_list = []
self.y_list = []
self.mode = ""
self.pixel_range = []
if filename:
fh = open(filename)
for line in fh:
if line.startswith("#"):
continue
self.retrieve_x_y_list(line)
fh.close()
self.x_list = list(set(self.x_list))
self.y_list = list(set(self.y_list))
self.calculatePixelRange()
def retrieve_x_y_list(self, line):
args = line.split('_')
self.x_list.append(int(args[1]))
self.y_list.append(int(args[2]))
def getXlist(self):
return self.x_list
def getYlist(self):
return self.y_list
def getMode(self):
return self.mode
def getPixelRange(self):
return self.pixel_range
def calculatePixelRange(self):
nbr_x = len(self.x_list)
if (nbr_x % 304) == 0:
_list = self.y_list #REF_L
else:
_list = self.x_list #REF_M
sz = len(_list)
Pixel_max = _list[-1]
Pixel_min = _list[0]
delta_pixel = Pixel_max - Pixel_min + 1
if delta_pixel == sz:
#narrow or broad
self.mode = 'narrow/broad'
self.pixel_range = [_list[0], _list[-1]]
else:
#discrete mode
self.mode = 'discrete'
self.retrieveDiscretePixelRange(_list)
def retrieveDiscretePixelRange(self, _list):
start_pixel = _list[0]
left_pixel = _list[0]
for right_pixel in _list[1:]:
delta_pixel = right_pixel - left_pixel
if delta_pixel != 1:
new_range = [start_pixel, left_pixel]
self.pixel_range.append(new_range)
start_pixel = right_pixel
left_pixel = right_pixel
self.pixel_range.append([start_pixel, right_pixel])
def retrieveFormatedDiscretePixelRange(self):
_list = self.pixel_range
_formated_string = ""
for i in _list:
_formated_string += " " + str(i)
return _formated_string
#pylint: disable=invalid-name
from __future__ import (absolute_import, division, print_function)
from PyQt4 import QtGui, QtCore
import math
from reduction_gui.reduction.reflectometer.refl_data_script import DataSets as REFLDataSets
from reduction_gui.reduction.reflectometer.refl_data_series import DataSeries
from reduction_gui.widgets.reflectometer.base_ref_reduction import BaseRefWidget
import ui.reflectometer.ui_data_refl_simple
class DataReflWidget(BaseRefWidget):
"""
Widget that present instrument details to the user
"""
## Widget name
name = "Data"
instrument_name = 'REF_L'
short_name = 'REFL'
peak_pixel_range = []
background_pixel_range = []
def __init__(self, parent=None, state=None, settings=None, name="REFL", data_proxy=None):
super(DataReflWidget, self).__init__(parent, state, settings, data_proxy=data_proxy)
class SummaryFrame(QtGui.QFrame, ui.reflectometer.ui_data_refl_simple.Ui_Frame):
def __init__(self, parent=None):
QtGui.QFrame.__init__(self, parent)
self.setupUi(self)
self.short_name = name
self._settings.instrument_name = name
self._summary = SummaryFrame(self)
self.initialize_content()
self._layout.addWidget(self._summary)
if state is not None:
self.set_state(state)
else:
self.set_state(DataSeries(data_class=REFLDataSets))
def initialize_content(self):
super(DataReflWidget, self).initialize_content()
self._summary.q_step_edit.setValidator(QtGui.QDoubleValidator(self._summary.q_step_edit))
self._summary.instrument_group_box.hide()
self._ref_instrument_selected()
def _ref_instrument_selected(self):
self.instrument_name = "REF_L"
self._summary.angle_offset_label.show()
self._summary.angle_offset_edit.show()
self._summary.angle_offset_pm_label.show()
self._summary.angle_offset_error_edit.show()
self._summary.q_bins_label.hide()
# Output directory
self._summary.outdir_label.hide()
self._summary.outdir_edit.hide()
self._summary.outdir_browse_button.hide()
def _tof_range_clicked(self, is_checked):
"""
This is reached by the TOF range switch
"""
self._summary.tof_min_label.setEnabled(is_checked)
self._summary.data_from_tof.setEnabled(is_checked)
self._summary.tof_min_label2.setEnabled(is_checked)
self._summary.tof_max_label.setEnabled(is_checked)
self._summary.data_to_tof.setEnabled(is_checked)
self._summary.tof_max_label2.setEnabled(is_checked)
self._edit_event(None, self._summary.tof_range_switch)
def set_state(self, state):
"""
Populate the UI elements with the data from the given state.
@param state: data object
"""
super(DataReflWidget, self).set_state(state)
if len(state.data_sets)>0:
self._summary.q_step_edit.setText(str(math.fabs(state.data_sets[0].q_step)))
self._reset_warnings()
def set_editing_state(self, state):
super(DataReflWidget, self).set_editing_state(state)
try:
self._summary.tof_range_switch.setChecked(state.TofRangeFlag)
self._tof_range_clicked(state.TofRangeFlag)
except:
self._summary.tof_range_switch.setChecked(True)
self._tof_range_clicked(True)
def get_state(self):
"""
Returns an object with the state of the interface
"""
m = self.get_editing_state()
state = DataSeries(data_class=REFLDataSets)
state_list = []
# Common Q binning
q_min = float(self._summary.q_min_edit.text())
q_step = float(self._summary.q_step_edit.text())
if self._summary.log_scale_chk.isChecked():
q_step = -q_step
# Scaling factor file
# data.scaling_factor_file_flag = self._summary.use_sf_config_switch.isChecked()
# Angle offset
if hasattr(m, "angle_offset"):
angle_offset = float(self._summary.angle_offset_edit.text())
angle_offset_error = float(self._summary.angle_offset_error_edit.text())
for i in range(self._summary.angle_list.count()):
data = self._summary.angle_list.item(i).data(QtCore.Qt.UserRole)
# Over-write Q binning with common binning
data.q_min = q_min
data.q_step = q_step
# Over-write angle offset
if hasattr(data, "angle_offset"):
data.angle_offset = angle_offset
data.angle_offset_error = angle_offset_error
state_list.append(data)
state.data_sets = state_list
return state
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
def _fourth_column_clicked(self, is_checked):
"""
This is reached by the 4th column switch
"""
self._summary.dq0_label.setEnabled(is_checked)
self._summary.dq0.setEnabled(is_checked)
self._summary.dq0_unit.setEnabled(is_checked)
self._summary.dq_over_q_label.setEnabled(is_checked)
self._summary.dq_over_q.setEnabled(is_checked)
This diff is collapsed.
include(UiToPy)
add_subdirectory(diffraction)
add_subdirectory(inelastic)
add_subdirectory(reflectometer)
add_subdirectory(sans)
add_subdirectory(sans_isis)
add_subdirectory(dataprocessorinterface)
......@@ -25,7 +24,6 @@ add_custom_target(CompileUIUI DEPENDS
CompileUIUIBase
CompileUIDiffraction
CompileUIInElastic
CompileUIReflectometer
CompileUISANS
CompileUISANSDataProcessorInterface
CompileUIDataProcessorInterface
......@@ -36,7 +34,6 @@ add_custom_target(CompileUIUI DEPENDS
set_property ( TARGET CompileUIUIBase PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUIDiffraction PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUIInElastic PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUIReflectometer PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUISANS PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUIDataProcessorInterface PROPERTY FOLDER "CompilePyUI" )
set_property ( TARGET CompileUISANSDataProcessorInterface PROPERTY FOLDER "CompilePyUI" )
......
# List of UIs to Auto convert
set( UI_FILES
refl_columns.ui
data_refl_simple.ui
refl_options_window.ui
refl_sf_calculator.ui
refl_stitching.ui
refl_window.ui
refm_reduction.ui
)
UiToPy( UI_FILES CompileUIReflectometer)
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment