diff --git a/Framework/PythonInterface/plugins/algorithms/SaveGEMMAUDParamFile.py b/Framework/PythonInterface/plugins/algorithms/SaveGEMMAUDParamFile.py index 87e24f224fdaecc696dc66e83d31e95a360e4f6d..dc56f6cc7ee83aa15b9044d4c6bbf2d41a010bfc 100644 --- a/Framework/PythonInterface/plugins/algorithms/SaveGEMMAUDParamFile.py +++ b/Framework/PythonInterface/plugins/algorithms/SaveGEMMAUDParamFile.py @@ -85,7 +85,12 @@ class SaveGEMMAUDParamFile(PythonAlgorithm): def create_empty_param_list(default_value="0"): return "\n".join(default_value for _ in range(num_banks)) - with open(self.getProperty(self.PROP_TEMPLATE_FILE).value) as template_file: + template_file_path = self.getProperty(self.PROP_TEMPLATE_FILE).value + if len(template_file_path) == 0: + logger.error("Could not find default diffraction directory for .maud template file: " + "you'll have to find it yourself") + + with open(template_file_path) as template_file: template = template_file.read() output_params["function_types"] = create_empty_param_list("1") @@ -136,8 +141,6 @@ class SaveGEMMAUDParamFile(PythonAlgorithm): if os.path.exists(path_to_test): return path_to_test - logger.warning("Could not find default diffraction directory for .maud template file: " - "you'll have to find it yourself") return "" def _format_param_list(self, param_list): diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py index 0264b539e70ba35a53f60c52c73b4bae8561bed3..cfac6af11333b81e12211ea16bac8584b24b9430 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/ISISIndirectEnergyTransfer.py @@ -360,9 +360,6 @@ class ISISIndirectEnergyTransfer(DataProcessorAlgorithm): self._output_ws = self.getPropertyValue('OutputWorkspace') - if self._grouping_string is not None: - self._grouping_string = self._grouping_string.replace('-', ':') - # Disable sum files if there is only one file if len(self._data_files) == 1: if self._sum_files: diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py index 75a461497d5d538c539c58b07ec6148960644b90..7780bcf3ccb1c6a90d96491d9be5b68759ae940a 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSBeamCentreFinder.py @@ -187,8 +187,8 @@ class SANSBeamCentreFinder(DataProcessorAlgorithm): residueTB.append(self._calculate_residuals(sample_quartiles[MaskingQuadrant.Top], sample_quartiles[MaskingQuadrant.Bottom])) if(j == 0): - logger.notice("Itr " + str(j) + ": (" + str(self.scale_1 * centre1) + ", " + str(self.scale_2 * centre2) + ") SX=" - + str(residueLR[j]) + " SY=" + str(residueTB[j])) + logger.notice("Itr {0}: ( {1}, {2} ) SX={3:.5g} SY={4:.5g}". + format(j, self.scale_1 * centre1, self.scale_2 * centre2, residueLR[j], residueTB[j])) if mantidplot: self._plot_quartiles(output_workspaces, state.data.sample_scatter) @@ -200,8 +200,8 @@ class SANSBeamCentreFinder(DataProcessorAlgorithm): if residueTB[j] > residueTB[j-1]: position_2_step = - position_2_step / 2 - logger.notice("Itr " + str(j) + ": (" + str(self.scale_1 * centre1) + ", " + str(self.scale_2 * centre2) + ") SX=" - + str(residueLR[j]) + " SY=" + str(residueTB[j])) + logger.notice("Itr {0}: ( {1}, {2} ) SX={3:.5g} SY={4:.5g}". + format(j, self.scale_1 * centre1, self.scale_2 * centre2, residueLR[j], residueTB[j])) if (residueLR[j]+residueTB[j]) < (residueLR[j-1]+residueTB[j-1]) or state.compatibility.use_compatibility_mode: centre_1_hold = centre1 diff --git a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSSave.py b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSSave.py index a3fa9121a8378898af8d6d15dbcab46395797783..8b1691134d19d728101a872bc411b2983c78b81d 100644 --- a/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSSave.py +++ b/Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSSave.py @@ -127,7 +127,7 @@ class SANSSave(DataProcessorAlgorithm): # SaveNXcanSAS clashes with SaveNexusProcessed self.add_file_format_with_appended_name_requirement(file_formats, SaveType.NXcanSAS, file_types, - [SaveType.Nexus]) + []) # SaveNISTDAT clashes with SaveRKH, both can save to .dat self.add_file_format_with_appended_name_requirement(file_formats, SaveType.NistQxy, file_types, [SaveType.RKH]) diff --git a/Testing/SystemTests/tests/analysis/SANSSaveTest.py b/Testing/SystemTests/tests/analysis/SANSSaveTest.py index 8cfa862cac4ebd044997706f38a4a9491f404307..e553c244b8b06d9f3a8b6bec1d3be9c990fcb2f0 100644 --- a/Testing/SystemTests/tests/analysis/SANSSaveTest.py +++ b/Testing/SystemTests/tests/analysis/SANSSaveTest.py @@ -80,7 +80,7 @@ class SANSSaveTest(unittest.TestCase): # Assert expected_files = ["sample_sans_save_file.xml", "sample_sans_save_file.txt", "sample_sans_save_file_nistqxy.dat", - "sample_sans_save_file_nxcansas.nxs", "sample_sans_save_file.nxs", + "sample_sans_save_file.h5", "sample_sans_save_file.nxs", "sample_sans_save_file.csv"] expected_full_file_names = [os.path.join(mantid.config.getString('defaultsave.directory'), elem) for elem in expected_files] diff --git a/docs/source/images/ISIS_SANS_release313.png b/docs/source/images/ISIS_SANS_release313.png new file mode 100644 index 0000000000000000000000000000000000000000..542be77c3200cbbe8fb46eba3461788fca8a4cce Binary files /dev/null and b/docs/source/images/ISIS_SANS_release313.png differ diff --git a/docs/source/images/ISIS_reflectometry_release313.png b/docs/source/images/ISIS_reflectometry_release313.png new file mode 100644 index 0000000000000000000000000000000000000000..a3b84b685d3707ea1ad87353e5fea7262dbb4b7e Binary files /dev/null and b/docs/source/images/ISIS_reflectometry_release313.png differ diff --git a/docs/source/interfaces/Indirect Data Reduction.rst b/docs/source/interfaces/Indirect Data Reduction.rst index 2bde134bbc16e73aed23796b97fa604b3c94297e..11a42b5c4a58ed078b854c3ad1655fe4d4bcb7e8 100644 --- a/docs/source/interfaces/Indirect Data Reduction.rst +++ b/docs/source/interfaces/Indirect Data Reduction.rst @@ -136,7 +136,11 @@ Grouping The following options are available for grouping output data: Custom - A comma separated list can be entered to specify the groups, e.g. 1, 3-5, 6-8, 10. + Follows the same grouping patterns used in the :ref:`GroupDetectors <algm-GroupDetectors>` algorithm. + An example of the syntax is 1,2+3,4-6,7-10 + + This would produce spectra for: spectra 1, the sum of spectra 2 and 3, the sum of spectra 4-6 (4+5+6) + and individual spectra from 7 to 10 (7,8,9,10) Individual All detectors will remain on individual spectra. diff --git a/docs/source/release/v3.13.0/reflectometry.rst b/docs/source/release/v3.13.0/reflectometry.rst index 536f973c59699f4c76fb43ea2b577aa27eecd4dd..2b2b15d358d68bf9a7121eeaac06c4bde29e8df0 100644 --- a/docs/source/release/v3.13.0/reflectometry.rst +++ b/docs/source/release/v3.13.0/reflectometry.rst @@ -7,6 +7,9 @@ Reflectometry Changes ISIS Reflectometry Interface ---------------------------- +.. image:: ../../images/ISIS_reflectometry_release313.png + :align: right + :width: 800px New ### diff --git a/docs/source/release/v3.13.0/sans.rst b/docs/source/release/v3.13.0/sans.rst index 2981b0ce176b8535be28f670719e61d9f2ec30d1..b5f40975a0053fbfe36cd116896193e23913850d 100644 --- a/docs/source/release/v3.13.0/sans.rst +++ b/docs/source/release/v3.13.0/sans.rst @@ -9,6 +9,7 @@ ILL --- * :ref:`LoadILLSANS <algm-LoadILLSANS>` is upgraded to load the modern nexus files from instruments D11, D22 and D33 at the ILL. +* :ref:`SANSMask <algm-SANSMask>` is extended to have a `MaskedWorkspace` property, to copy the mask from. SNS --- @@ -17,10 +18,13 @@ SNS ISIS SANS Interface ------------------- +.. image:: ../../images/ISIS_SANS_release313.png + :align: right + :width: 800px + New ### * A string of wavelength ranges can now be specified. A reduction is then done for each wavelength range. -* :ref:`SANSMask <algm-SANSMask>` is extended to have a `MaskedWorkspace` property, to copy the mask from. Improvements ############ @@ -33,6 +37,7 @@ Improvements * Improved error messages in the new GUI to be more obvious and clearer. * Updated the naming of workspace groups in a sliced reduction. * Updated old backend to mask by detector ID rather than spectrum number, improving reliability. +* NXcanSAS is now saved out with a .h5 extension so it can be read into SASView. Bugfixes ######## @@ -43,10 +48,12 @@ Bugfixes * Fixed a bug where save_format was not being specified if a user file was entered for a row. * Use gravity now defaulting to false. * MASK/TIME and TIME/MASK now both work in new backend. +* SET Centre/HAB command is now correctly parsed into a seperate variable to SET Centre. Features Removed ################ * Removed SaveNist as an option from both GUI's +* The Q range option on the beam centre tab was producing erroneous results so has been removed until it can be improved and fixed. :ref:`Release 3.13.0 <v3.13.0>` diff --git a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp index 7a48c3b849527844d75cf79bd1202f949df1065d..10f1d75a203a5505c378e4337e15cf17f197ba32 100644 --- a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp +++ b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.cpp @@ -48,7 +48,7 @@ ISISEnergyTransfer::ISISEnergyTransfer(IndirectDataReduction *idrUI, mappingOptionSelected(m_uiForm.cbGroupingOptions->currentText()); // Add validation to custom detector grouping - QRegExp re("([0-9]+[-]?[0-9]*,[ ]?)*[0-9]+[-]?[0-9]*"); + QRegExp re("([0-9]+[-:+]?[0-9]*,[ ]?)*[0-9]+[-:+]?[0-9]*"); m_uiForm.leCustomGroups->setValidator(new QRegExpValidator(re, this)); // Validate to remove invalid markers diff --git a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.ui b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.ui index 09dbd67a51858b8dff66a090ca56671eb441771d..1585025f02389920ccca2f28dac35263e3588dc2 100644 --- a/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.ui +++ b/qt/scientific_interfaces/Indirect/ISISEnergyTransfer.ui @@ -313,6 +313,13 @@ <property name="enabled"> <bool>true</bool> </property> + <property name="toolTip"> + <string>, allows you to specify additional indices. 1,2,4 will keep indices 1, 2 and 4 only. +: indicates a continuous range of indices. For example, 1:5 is the same as 1,2,3,4,5. ++ sums two spectra together. 7+9 will produce a single spectra listing the sum of 7 and 9, ignoring any others. +- sums a range of spectra together. For example, 3-8 is the same as 3+4+5+6+7+8. + </string> + </property> <property name="maximumSize"> <size> <width>16777215</width> diff --git a/qt/widgets/common/src/MWRunFiles.cpp b/qt/widgets/common/src/MWRunFiles.cpp index a9b1975c9b40fbfca26c431d323dbb69068f8c1c..d53e222aa9806d8b2a147d224e4f8647e3eaa0ac 100644 --- a/qt/widgets/common/src/MWRunFiles.cpp +++ b/qt/widgets/common/src/MWRunFiles.cpp @@ -586,13 +586,11 @@ const QString MWRunFiles::findFilesGetSearchText(QString &searchText) { * @param searchText :: text to create search parameters from */ void MWRunFiles::runFindFiles(const QString &searchText) { - if (!searchText.isEmpty()) { - emit findingFiles(); + emit findingFiles(); - const auto parameters = - createFindFilesSearchParameters(searchText.toStdString()); - m_pool.createWorker(this, parameters); - } + const auto parameters = + createFindFilesSearchParameters(searchText.toStdString()); + m_pool.createWorker(this, parameters); } /** Calls cancel on a running instance of MonitorLiveData. diff --git a/scripts/ExternalInterfaces/CMakeLists.txt b/scripts/ExternalInterfaces/CMakeLists.txt index 6d3bfdc13c68e7b1c3e2445a13ea2cbb34b786aa..029a93077806bc5d2c5a1b57e81f1a5839364660 100644 --- a/scripts/ExternalInterfaces/CMakeLists.txt +++ b/scripts/ExternalInterfaces/CMakeLists.txt @@ -6,7 +6,7 @@ set ( _mslice_external_root ${CMAKE_CURRENT_BINARY_DIR}/mslice ) ExternalProject_Add ( mslice PREFIX ${_mslice_external_root} GIT_REPOSITORY "https://github.com/mantidproject/mslice.git" - GIT_TAG 3c6eadfe38ea9d57dcacf57f5df2c150639a2779 + GIT_TAG 82c4fae1356f770d5f8ad59edea4bd5f58206190 EXCLUDE_FROM_ALL 1 CONFIGURE_COMMAND "" diff --git a/scripts/Interface/reduction_gui/instruments/eqsans_interface_dev.py b/scripts/Interface/reduction_gui/instruments/eqsans_interface_dev.py index 60464d94335032a2b78adc08b0d5496e75c68ce0..98c163dde5373ee0a02bd3497f95062d0330c0ad 100644 --- a/scripts/Interface/reduction_gui/instruments/eqsans_interface_dev.py +++ b/scripts/Interface/reduction_gui/instruments/eqsans_interface_dev.py @@ -31,7 +31,7 @@ class EQSANSInterface(InstrumentInterface): """ Defines the widgets for EQSANS reduction """ - data_type = "Data files *.nxs *.dat (*.nxs *.dat)" + data_type = "Data files *.nxs *.dat *.h5 (*.nxs *.dat *.h5)" def __init__(self, name, settings): super(EQSANSInterface, self).__init__(name, settings) diff --git a/scripts/Interface/ui/sans_isis/beam_centre.py b/scripts/Interface/ui/sans_isis/beam_centre.py index b2cbaaebc11c1e5f758687731755bebb2635370d..4ca38ece1ad97fe99e806d8827f195c6282c7f44 100644 --- a/scripts/Interface/ui/sans_isis/beam_centre.py +++ b/scripts/Interface/ui/sans_isis/beam_centre.py @@ -38,6 +38,13 @@ class BeamCentre(QtGui.QWidget, ui_beam_centre.Ui_BeamCentre): # Attach validators self._attach_validators() + # This feature is currently broken and not strictly needed so I am hiding this part of the GUI. + self.Q_limits.hide() + self.Q_from.hide() + self.q_min_line_edit.hide() + self.q_max_line_edit.hide() + self.Q_to.hide() + def _setup_log_widget(self): self.log_widget = MantidQt.MantidWidgets.MessageDisplay(self.groupBox_2) self.log_widget.setMinimumSize(QtCore.QSize(491, 371)) diff --git a/scripts/Interface/ui/sans_isis/beam_centre.ui b/scripts/Interface/ui/sans_isis/beam_centre.ui index c38ae4ba5be4b5d1d3e677973bff66d9605d943d..bf6f24652d62053605200b8da688ed02e68206a3 100644 --- a/scripts/Interface/ui/sans_isis/beam_centre.ui +++ b/scripts/Interface/ui/sans_isis/beam_centre.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>1015</width> - <height>649</height> + <height>709</height> </rect> </property> <property name="windowTitle"> @@ -130,7 +130,7 @@ </widget> </item> <item row="5" column="3"> - <widget class="QLabel" name="label"> + <widget class="QLabel" name="Q_to"> <property name="text"> <string>to</string> </property> @@ -151,7 +151,7 @@ </widget> </item> <item row="5" column="0"> - <widget class="QLabel" name="label_3"> + <widget class="QLabel" name="Q_from"> <property name="text"> <string>from</string> </property> @@ -161,7 +161,7 @@ <widget class="QLineEdit" name="r_max_line_edit"/> </item> <item row="3" column="2"> - <widget class="QLabel" name="label_2"> + <widget class="QLabel" name="Q_limits"> <property name="toolTip"> <string><html><head/><body><p>The Q range which will be considered when finding the beam centre.</p></body></html></string> </property> @@ -310,6 +310,26 @@ </item> </layout> </widget> + <tabstops> + <tabstop>lab_pos_1_line_edit</tabstop> + <tabstop>lab_pos_2_line_edit</tabstop> + <tabstop>hab_pos_1_line_edit</tabstop> + <tabstop>hab_pos_2_line_edit</tabstop> + <tabstop>component_combo_box</tabstop> + <tabstop>update_lab_check_box</tabstop> + <tabstop>update_hab_check_box</tabstop> + <tabstop>r_min_line_edit</tabstop> + <tabstop>r_max_line_edit</tabstop> + <tabstop>q_min_line_edit</tabstop> + <tabstop>q_max_line_edit</tabstop> + <tabstop>max_iterations_line_edit</tabstop> + <tabstop>tolerance_line_edit</tabstop> + <tabstop>verbose_check_box</tabstop> + <tabstop>COM_check_box</tabstop> + <tabstop>left_right_check_box</tabstop> + <tabstop>up_down_check_box</tabstop> + <tabstop>run_button</tabstop> + </tabstops> <resources/> <connections/> </ui> diff --git a/scripts/Interface/ui/sans_isis/diagnostics_page.ui b/scripts/Interface/ui/sans_isis/diagnostics_page.ui index 4dac19dd279a70d916152ff52eaef463e52fca5e..d99f39cab1d5e92bc71f014b0730f464eb115341 100644 --- a/scripts/Interface/ui/sans_isis/diagnostics_page.ui +++ b/scripts/Interface/ui/sans_isis/diagnostics_page.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>695</width> - <height>252</height> + <height>297</height> </rect> </property> <property name="windowTitle"> @@ -58,6 +58,9 @@ </item> <item row="0" column="2"> <widget class="QPushButton" name="browse_button"> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> <property name="text"> <string>Browse</string> </property> @@ -133,6 +136,9 @@ </item> <item row="2" column="0"> <widget class="QPushButton" name="time_button"> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> <property name="text"> <string>Time Integral</string> </property> @@ -146,6 +152,9 @@ </item> <item row="0" column="0"> <widget class="QPushButton" name="horizontal_button"> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> <property name="text"> <string>Horizontal Integral</string> </property> @@ -160,6 +169,9 @@ </item> <item row="1" column="0"> <widget class="QPushButton" name="vertical_button"> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> <property name="text"> <string>Vertical Integral</string> </property> @@ -239,6 +251,21 @@ </item> </layout> </widget> + <tabstops> + <tabstop>run_input_line_edit</tabstop> + <tabstop>browse_button</tabstop> + <tabstop>detector_combo_box</tabstop> + <tabstop>period_line_edit</tabstop> + <tabstop>horizontal_button</tabstop> + <tabstop>horizontal_range_line_edit</tabstop> + <tabstop>horizontal_mask_check_box</tabstop> + <tabstop>vertical_button</tabstop> + <tabstop>vertical_range_line_edit</tabstop> + <tabstop>vertical_mask_check_box</tabstop> + <tabstop>time_button</tabstop> + <tabstop>time_range_line_edit</tabstop> + <tabstop>time_mask_checkbox</tabstop> + </tabstops> <resources/> <connections/> </ui> diff --git a/scripts/Interface/ui/sans_isis/sans_data_processor_window.ui b/scripts/Interface/ui/sans_isis/sans_data_processor_window.ui index cf23f0c13b51d3afdfd115cc463fa649135f7f6f..39d87d57b2e467e80af34b80b926f5428086092d 100644 --- a/scripts/Interface/ui/sans_isis/sans_data_processor_window.ui +++ b/scripts/Interface/ui/sans_isis/sans_data_processor_window.ui @@ -95,7 +95,7 @@ QGroupBox::title { <item> <widget class="QStackedWidget" name="main_stacked_widget"> <property name="currentIndex"> - <number>0</number> + <number>1</number> </property> <widget class="QWidget" name="run_page"> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -291,7 +291,7 @@ QGroupBox::title { <string>Memor&y</string> </property> <property name="checked"> - <bool>true</bool> + <bool>false</bool> </property> </widget> </item> @@ -313,6 +313,9 @@ QGroupBox::title { <property name="text"> <string>Both</string> </property> + <property name="checked"> + <bool>true</bool> + </property> </widget> </item> </layout> @@ -626,7 +629,7 @@ QGroupBox::title { <item> <widget class="QGroupBox" name="slice_event_group_box"> <property name="toolTip"> - <string><html><head/><body><p>In the case of data which was measured in event-mode, it is possible to perform time-of-flight slices of the data and reduce these separately.</p><p>Input can be:</p><p>-<span style=" font-style:italic;"> start:step:stop</span> specifies time slices from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop </span>value in steps of <span style=" font-style:italic;">step</span></p><p>- <span style=" font-style:italic;">start-stop </span>which specifies a time slice from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop</span> value</p><p>- <span style=" font-style:italic;">&gt;start</span> specifies a slice from the <span style=" font-style:italic;">start </span>value to the end of the data set</p><p>- <span style=" font-style:italic;">&lt;stop</span> specifes a slcie from teh start of the data set to the <span style=" font-style:italic;">stop </span>value</p><p>In addition it is possible to concatenate these specifications useing comma-separation. An example is:</p><p><span style=" font-style:italic;">5-10,12:2:16,20-30</span></p></body></html></string> + <string><html><head/><body><p>In the case of data which was measured in event-mode, it is possible to perform time-of-flight slices of the data and reduce these separately.</p><p>Input can be:</p><p>-<span style=" font-style:italic;"> start:step:stop</span> specifies time slices from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop </span>value in steps of <span style=" font-style:italic;">step</span></p><p>- <span style=" font-style:italic;">start-stop </span>which specifies a time slice from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop</span> value</p><p>- <span style=" font-style:italic;">&gt;start</span> specifies a slice from the <span style=" font-style:italic;">start </span>value to the end of the data set</p><p>- <span style=" font-style:italic;">&lt;stop</span> specifes a slice from the start of the data set to the <span style=" font-style:italic;">stop </span>value</p><p>In addition it is possible to concatenate these specifications useing comma-separation. An example is:</p><p><span style=" font-style:italic;">5-10,12:2:16,20-30</span></p></body></html></string> </property> <property name="title"> <string>Event Slice</string> @@ -912,7 +915,7 @@ QGroupBox::title { <string><html><head/><body><p>Spectrum number of the incident monitor which is used for monitor normalization.</p></body></html></string> </property> <property name="text"> - <string>Incidient monitor</string> + <string>Incident monitor</string> </property> </widget> </item> @@ -1054,7 +1057,7 @@ QGroupBox::title { <item row="4" column="2"> <widget class="QLineEdit" name="transmission_mn_shift_line_edit"> <property name="toolTip"> - <string><html><head/><body><p>An option shift of the M4 monitor.</p></body></html></string> + <string><html><head/><body><p>Distance between beamstop monitor and detector.</p></body></html></string> </property> </widget> </item> @@ -1568,7 +1571,7 @@ QGroupBox::title { </sizepolicy> </property> <property name="toolTip"> - <string><html><head/><body><p>Settings concerning the wavelength binning when dat a is transformed from time-of-flight to wavlength units.</p></body></html></string> + <string><html><head/><body><p>Settings concerning the wavelength binning when data is transformed from time-of-flight to wavelength units.</p></body></html></string> </property> <property name="title"> <string>Wavelength</string> @@ -1626,7 +1629,7 @@ QGroupBox::title { <item row="1" column="0"> <widget class="QLabel" name="label_7"> <property name="toolTip"> - <string><html><head/><body><p>It is possible to perform wavelength slices of the data and reduce these separately.</p><p>Input can be:</p><p>-<span style=" font-style:italic;"> start:step:stop</span> specifies time slices from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop </span>value in steps of <span style=" font-style:italic;">step</span></p><p>- <span style=" font-style:italic;">start-stop </span>which specifies a time slice from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop</span> value</p><p>- <span style=" font-style:italic;">&gt;start</span> specifies a slice from the <span style=" font-style:italic;">start </span>value to the end of the data set</p><p>- <span style=" font-style:italic;">&lt;stop</span> specifes a slcie from teh start of the data set to the <span style=" font-style:italic;">stop </span>value</p><p>In addition it is possible to concatenate these specifications useing comma-separation. An example is:</p><p><span style=" font-style:italic;">5-10,12:2:16,20-30</span></p><p>A reduction will always be done between the maximum and minimum wavelengths of a given set.</p></body></html></string> + <string><html><head/><body><p>It is possible to perform wavelength slices of the data and reduce these separately.</p><p>Input can be:</p><p>-<span style=" font-style:italic;"> start:step:stop</span> specifies wavelength slices from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop </span>value in steps of <span style=" font-style:italic;">step</span></p><p>- <span style=" font-style:italic;">start-stop </span>which specifies a wavelength slice from the <span style=" font-style:italic;">start</span> value to the <span style=" font-style:italic;">stop</span> value</p><p>- <span style=" font-style:italic;">&gt;start</span> specifies a slice from the <span style=" font-style:italic;">start </span>value to the end of the data set</p><p>- <span style=" font-style:italic;">&lt;stop</span> specifes a slice from the start of the data set to the <span style=" font-style:italic;">stop </span>value</p><p>In addition it is possible to concatenate these specifications useing comma-separation. An example is:</p><p><span style=" font-style:italic;">5-10,12:2:16,20-30</span></p><p>A reduction will always be done between the maximum and minimum wavelengths of a given set.</p></body></html></string> </property> <property name="text"> <string>Ranges [Ã…]</string> @@ -1879,12 +1882,12 @@ QGroupBox::title { </property> <item> <property name="text"> - <string>Circular</string> + <string>Pinhole</string> </property> </item> <item> <property name="text"> - <string>Rectangular</string> + <string>Slit</string> </property> </item> </widget> @@ -1899,7 +1902,7 @@ QGroupBox::title { </property> </widget> </item> - <item row="3" column="4"> + <item row="3" column="2"> <widget class="QLabel" name="q_resolution_sample_a_label"> <property name="toolTip"> <string><html><head/><body><p>Diameter of a circular sample aperature.</p></body></html></string> @@ -1916,7 +1919,7 @@ QGroupBox::title { </property> </widget> </item> - <item row="2" column="4"> + <item row="2" column="2"> <widget class="QLabel" name="q_resolution_sample_w_label"> <property name="toolTip"> <string><html><head/><body><p>Width of a rectangular sample aperature.</p></body></html></string> @@ -1926,14 +1929,14 @@ QGroupBox::title { </property> </widget> </item> - <item row="2" column="5"> + <item row="2" column="3"> <widget class="QLineEdit" name="q_resolution_sample_w_line_edit"> <property name="toolTip"> <string><html><head/><body><p>Width of a rectangular sample aperature.</p></body></html></string> </property> </widget> </item> - <item row="6" column="0"> + <item row="5" column="0"> <widget class="QLabel" name="q_resolution_collimation_length_label"> <property name="toolTip"> <string><html><head/><body><p>The collimation length.</p></body></html></string> @@ -1943,7 +1946,7 @@ QGroupBox::title { </property> </widget> </item> - <item row="6" column="4"> + <item row="5" column="2"> <widget class="QLabel" name="q_resolution_delta_r_label"> <property name="toolTip"> <string><html><head/><body><p>Delta r.</p></body></html></string> @@ -1953,21 +1956,21 @@ QGroupBox::title { </property> </widget> </item> - <item row="7" column="1" colspan="4"> + <item row="6" column="1" colspan="2"> <widget class="QLineEdit" name="q_resolution_moderator_file_line_edit"> <property name="toolTip"> <string><html><head/><body><p>Path to the moderator file.</p></body></html></string> </property> </widget> </item> - <item row="7" column="5"> + <item row="6" column="3"> <widget class="QPushButton" name="q_resolution_moderator_file_push_button"> <property name="text"> <string>Browse</string> </property> </widget> </item> - <item row="7" column="0"> + <item row="6" column="0"> <widget class="QLabel" name="q_resolution_moderator_file_label"> <property name="toolTip"> <string><html><head/><body><p>Path to the moderator file.</p></body></html></string> @@ -1977,24 +1980,24 @@ QGroupBox::title { </property> </widget> </item> - <item row="6" column="1"> + <item row="5" column="1"> <widget class="QLineEdit" name="q_resolution_collimation_length_line_edit"> <property name="toolTip"> <string><html><head/><body><p>The collimation length.</p></body></html></string> </property> </widget> </item> - <item row="6" column="5"> + <item row="5" column="3"> <widget class="QLineEdit" name="q_resolution_delta_r_line_edit"> <property name="toolTip"> <string><html><head/><body><p>Delta r.</p></body></html></string> </property> </widget> </item> - <item row="5" column="0" colspan="6"> - <widget class="Line" name="line_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <item row="3" column="3"> + <widget class="QLineEdit" name="q_resolution_sample_a_line_edit"> + <property name="toolTip"> + <string><html><head/><body><p>Diameter of a circular sample aperature.</p></body></html></string> </property> </widget> </item> @@ -2005,10 +2008,10 @@ QGroupBox::title { </property> </widget> </item> - <item row="3" column="5"> - <widget class="QLineEdit" name="q_resolution_sample_a_line_edit"> + <item row="2" column="1"> + <widget class="QLineEdit" name="q_resolution_source_w_line_edit"> <property name="toolTip"> - <string><html><head/><body><p>Diameter of a circular sample aperature.</p></body></html></string> + <string><html><head/><body><p>Width of a rectangular source aperature.</p></body></html></string> </property> </widget> </item> @@ -2022,10 +2025,10 @@ QGroupBox::title { </property> </widget> </item> - <item row="2" column="1"> - <widget class="QLineEdit" name="q_resolution_source_w_line_edit"> + <item row="1" column="3"> + <widget class="QLineEdit" name="q_resolution_sample_h_line_edit"> <property name="toolTip"> - <string><html><head/><body><p>Width of a rectangular source aperature.</p></body></html></string> + <string><html><head/><body><p>Height of a rectangular sample aperature.</p></body></html></string> </property> </widget> </item> @@ -2039,14 +2042,7 @@ QGroupBox::title { </property> </widget> </item> - <item row="1" column="5"> - <widget class="QLineEdit" name="q_resolution_sample_h_line_edit"> - <property name="toolTip"> - <string><html><head/><body><p>Height of a rectangular sample aperature.</p></body></html></string> - </property> - </widget> - </item> - <item row="1" column="4"> + <item row="1" column="2"> <widget class="QLabel" name="q_resolution_sample_h_label"> <property name="toolTip"> <string><html><head/><body><p>Height of a rectangular sample aperature.</p></body></html></string> @@ -2056,13 +2052,6 @@ QGroupBox::title { </property> </widget> </item> - <item row="1" column="2" rowspan="3"> - <widget class="Line" name="line_7"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> </layout> </widget> </item> @@ -2158,11 +2147,12 @@ QGroupBox::title { </customwidget> </customwidgets> <tabstops> - <tabstop>tab_choice_list</tabstop> - <tabstop>batch_button</tabstop> + <tabstop>instrument_combo_box</tabstop> + <tabstop>manage_directories_button</tabstop> <tabstop>user_file_button</tabstop> - <tabstop>batch_line_edit</tabstop> - <tabstop>user_file_line_edit</tabstop> + <tabstop>batch_button</tabstop> + <tabstop>process_button</tabstop> + <tabstop>multi_period_check_box</tabstop> <tabstop>reduction_dimensionality_1D</tabstop> <tabstop>reduction_dimensionality_2D</tabstop> <tabstop>output_mode_memory_radio_button</tabstop> @@ -2173,7 +2163,8 @@ QGroupBox::title { <tabstop>rkh_checkbox</tabstop> <tabstop>save_zero_error_free</tabstop> <tabstop>use_optimizations_checkbox</tabstop> - <tabstop>settings_tab_widget</tabstop> + <tabstop>plot_results_checkbox</tabstop> + <tabstop>help_button</tabstop> <tabstop>reduction_mode_combo_box</tabstop> <tabstop>merged_scale_line_edit</tabstop> <tabstop>merged_shift_line_edit</tabstop> @@ -2187,19 +2178,12 @@ QGroupBox::title { <tabstop>slice_event_line_edit</tabstop> <tabstop>event_binning_group_box</tabstop> <tabstop>event_binning_line_edit</tabstop> - <tabstop>wavelength_min_line_edit</tabstop> - <tabstop>wavelength_max_line_edit</tabstop> <tabstop>absolute_scale_line_edit</tabstop> <tabstop>geometry_combo_box</tabstop> <tabstop>height_line_edit</tabstop> <tabstop>width_line_edit</tabstop> <tabstop>thickness_line_edit</tabstop> <tabstop>z_offset_line_edit</tabstop> - <tabstop>phi_limit_min_line_edit</tabstop> - <tabstop>phi_limit_max_line_edit</tabstop> - <tabstop>phi_limit_use_mirror_check_box</tabstop> - <tabstop>radius_limit_min_line_edit</tabstop> - <tabstop>radius_limit_max_line_edit</tabstop> <tabstop>mask_file_input_line_edit</tabstop> <tabstop>mask_file_browse_push_button</tabstop> <tabstop>mask_file_add_push_button</tabstop> @@ -2222,6 +2206,7 @@ QGroupBox::title { <tabstop>fit_sample_wavelength_combo_box</tabstop> <tabstop>fit_sample_wavelength_min_line_edit</tabstop> <tabstop>fit_sample_wavelength_max_line_edit</tabstop> + <tabstop>show_transmission_view</tabstop> <tabstop>fit_can_use_fit_check_box</tabstop> <tabstop>fit_can_fit_type_combo_box</tabstop> <tabstop>fit_can_polynomial_order_spin_box</tabstop> @@ -2229,13 +2214,25 @@ QGroupBox::title { <tabstop>fit_can_wavelength_min_line_edit</tabstop> <tabstop>fit_can_wavelength_max_line_edit</tabstop> <tabstop>pixel_adjustment_det_1_line_edit</tabstop> - <tabstop>pixel_adjustment_det_2_line_edit</tabstop> <tabstop>pixel_adjustment_det_1_push_button</tabstop> + <tabstop>pixel_adjustment_det_2_line_edit</tabstop> <tabstop>pixel_adjustment_det_2_push_button</tabstop> <tabstop>wavelength_adjustment_det_1_line_edit</tabstop> - <tabstop>wavelength_adjustment_det_2_line_edit</tabstop> <tabstop>wavelength_adjustment_det_1_push_button</tabstop> + <tabstop>wavelength_adjustment_det_2_line_edit</tabstop> <tabstop>wavelength_adjustment_det_2_push_button</tabstop> + <tabstop>radius_limit_min_line_edit</tabstop> + <tabstop>radius_limit_max_line_edit</tabstop> + <tabstop>phi_limit_min_line_edit</tabstop> + <tabstop>phi_limit_max_line_edit</tabstop> + <tabstop>phi_limit_use_mirror_check_box</tabstop> + <tabstop>wavelength_min_line_edit</tabstop> + <tabstop>wavelength_max_line_edit</tabstop> + <tabstop>wavelength_slices_line_edit</tabstop> + <tabstop>wavelength_step_line_edit</tabstop> + <tabstop>wavelength_step_type_combo_box</tabstop> + <tabstop>r_cut_line_edit</tabstop> + <tabstop>w_cut_line_edit</tabstop> <tabstop>q_1d_min_line_edit</tabstop> <tabstop>q_1d_max_line_edit</tabstop> <tabstop>q_1d_step_line_edit</tabstop> @@ -2245,8 +2242,8 @@ QGroupBox::title { <tabstop>q_xy_step_type_combo_box</tabstop> <tabstop>gravity_group_box</tabstop> <tabstop>gravity_extra_length_line_edit</tabstop> - <tabstop>q_resolution_shape_combo_box</tabstop> <tabstop>q_resolution_group_box</tabstop> + <tabstop>q_resolution_shape_combo_box</tabstop> <tabstop>q_resolution_source_h_line_edit</tabstop> <tabstop>q_resolution_source_w_line_edit</tabstop> <tabstop>q_resolution_source_a_line_edit</tabstop> @@ -2257,6 +2254,10 @@ QGroupBox::title { <tabstop>q_resolution_delta_r_line_edit</tabstop> <tabstop>q_resolution_moderator_file_line_edit</tabstop> <tabstop>q_resolution_moderator_file_push_button</tabstop> + <tabstop>settings_tab_widget</tabstop> + <tabstop>user_file_line_edit</tabstop> + <tabstop>tab_choice_list</tabstop> + <tabstop>batch_line_edit</tabstop> </tabstops> <resources/> <connections/> diff --git a/scripts/SANS/sans/algorithm_detail/save_workspace.py b/scripts/SANS/sans/algorithm_detail/save_workspace.py index 121df937ea1356df9c9a4d60ca5ad208e1930477..530462b3478776a1c03f84b8489213c6f666a455 100644 --- a/scripts/SANS/sans/algorithm_detail/save_workspace.py +++ b/scripts/SANS/sans/algorithm_detail/save_workspace.py @@ -43,7 +43,7 @@ def get_save_strategy(file_format_bundle, file_name, save_options): file_name = get_file_name(file_format_bundle, file_name, "", ".xml") save_name = "SaveCanSAS1D" elif file_format is SaveType.NXcanSAS: - file_name = get_file_name(file_format_bundle, file_name, "_nxcansas", ".nxs") + file_name = get_file_name(file_format_bundle, file_name, "_nxcansas", ".h5") save_name = "SaveNXcanSAS" elif file_format is SaveType.NistQxy: file_name = get_file_name(file_format_bundle, file_name, "_nistqxy", ".dat") diff --git a/scripts/SANS/sans/gui_logic/models/beam_centre_model.py b/scripts/SANS/sans/gui_logic/models/beam_centre_model.py index 1c42eec1f3639ea1825d551a0bbb31ae108c12e7..e885c80ad5ad502cbc4cbbefd8e7510f701cca33 100644 --- a/scripts/SANS/sans/gui_logic/models/beam_centre_model.py +++ b/scripts/SANS/sans/gui_logic/models/beam_centre_model.py @@ -28,7 +28,7 @@ class BeamCentreModel(object): self._r_max = r_range["beam_centre_radius_max"] if "beam_centre_radius_max" in r_range else 280 self._left_right = True self._up_down = True - self._tolerance = 0.000125 + self._tolerance = 0.0001251 self._lab_pos_1 = '' self._lab_pos_2 = '' self._hab_pos_2 = '' @@ -73,11 +73,6 @@ class BeamCentreModel(object): logger.notice("Have chosen no find direction exiting early") return {"pos1": self.lab_pos_1, "pos2": self.lab_pos_2} - if self.q_min: - state.convert_to_q.q_min = self.q_min - if self.q_max: - state.convert_to_q.q_max = self.q_max - if self.COM: centre = centre_finder(state, r_min=self.r_min, r_max=self.r_max, max_iter=self.max_iterations, diff --git a/scripts/SANS/sans/gui_logic/models/state_gui_model.py b/scripts/SANS/sans/gui_logic/models/state_gui_model.py index 3d631702dd9b6b850c821dfa71e9f6f6b2d12913..aa760cbe58ad3e1de8202ee1e54bb47a63767039 100644 --- a/scripts/SANS/sans/gui_logic/models/state_gui_model.py +++ b/scripts/SANS/sans/gui_logic/models/state_gui_model.py @@ -110,7 +110,7 @@ class StateGuiModel(object): @property def hab_pos_1(self): - return self.get_simple_element_with_attribute(element_id=SetId.centre, default_value='', attribute="pos1") + return self.get_simple_element_with_attribute(element_id=SetId.centre_HAB, default_value='', attribute="pos1") @hab_pos_1.setter def hab_pos_1(self, value): @@ -118,7 +118,7 @@ class StateGuiModel(object): @property def hab_pos_2(self): - return self.get_simple_element_with_attribute(element_id=SetId.centre, default_value='', attribute="pos2") + return self.get_simple_element_with_attribute(element_id=SetId.centre_HAB, default_value='', attribute="pos2") @hab_pos_2.setter def hab_pos_2(self, value): diff --git a/scripts/SANS/sans/gui_logic/presenter/beam_centre_presenter.py b/scripts/SANS/sans/gui_logic/presenter/beam_centre_presenter.py index 75ab0491dd792d4e92fe4fc9d4c55686cd0586d6..62a210c6f4ec5a625c2ac7b7cbc970626663ff8f 100644 --- a/scripts/SANS/sans/gui_logic/presenter/beam_centre_presenter.py +++ b/scripts/SANS/sans/gui_logic/presenter/beam_centre_presenter.py @@ -117,6 +117,19 @@ class BeamCentrePresenter(object): self._beam_centre_model.update_hab = self._view.update_hab self._beam_centre_model.update_lab = self._view.update_lab + def update_centre_positions(self, state_model): + lab_pos_1 = getattr(state_model, 'lab_pos_1') + lab_pos_2 = getattr(state_model, 'lab_pos_2') + + hab_pos_1 = getattr(state_model, 'hab_pos_1') if getattr(state_model, 'hab_pos_1') else lab_pos_1 + hab_pos_2 = getattr(state_model, 'hab_pos_2') if getattr(state_model, 'hab_pos_2') else lab_pos_2 + + self._view.lab_pos_1 = lab_pos_1 + self._view.lab_pos_2 = lab_pos_2 + + self._view.hab_pos_1 = hab_pos_1 + self._view.hab_pos_2 = hab_pos_2 + def set_on_state_model(self, attribute_name, state_model): attribute = getattr(self._view, attribute_name) if attribute or isinstance(attribute, bool): diff --git a/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py b/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py index 4348ccb345233ea6aeecc88a667b50ef1af790bd..db7891cdb74e1bebaf38bcf296456f0312bce587 100644 --- a/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py +++ b/scripts/SANS/sans/gui_logic/presenter/run_tab_presenter.py @@ -215,6 +215,7 @@ class RunTabPresenter(object): self._state_model = StateGuiModel(user_file_items) # 5. Update the views. self._update_view_from_state_model() + self._beam_centre_presenter.update_centre_positions(self._state_model) # 6. Perform calls on child presenters self._masking_table_presenter.on_update_rows() @@ -588,12 +589,6 @@ class RunTabPresenter(object): self._set_on_view("radius_limit_min") self._set_on_view("radius_limit_max") - # Beam Centre - self._beam_centre_presenter.set_on_view('lab_pos_1', self._state_model) - self._beam_centre_presenter.set_on_view('lab_pos_2', self._state_model) - self._beam_centre_presenter.set_on_view('hab_pos_1', self._state_model) - self._beam_centre_presenter.set_on_view('hab_pos_2', self._state_model) - def _set_on_view_transmission_fit_sample_settings(self): # Set transmission_sample_use_fit fit_type = self._state_model.transmission_sample_fit_type diff --git a/scripts/SANS/sans/user_file/settings_tags.py b/scripts/SANS/sans/user_file/settings_tags.py index 1341b2efb5d61db33be532f71f475f2565e191a4..445caf2c8b4b24703fad3e875c57f67bd58178ea 100644 --- a/scripts/SANS/sans/user_file/settings_tags.py +++ b/scripts/SANS/sans/user_file/settings_tags.py @@ -80,7 +80,7 @@ class SampleId(object): # --- SET -@serializable_enum("scales", "centre") +@serializable_enum("scales", "centre", "centre_HAB") class SetId(object): pass diff --git a/scripts/SANS/sans/user_file/user_file_parser.py b/scripts/SANS/sans/user_file/user_file_parser.py index 7365bc41db2cb07b7541ac9bcb8c701f10cba861..3d3ea0523185cb988ebc770ab72ac13f6ac31bed 100644 --- a/scripts/SANS/sans/user_file/user_file_parser.py +++ b/scripts/SANS/sans/user_file/user_file_parser.py @@ -1145,10 +1145,14 @@ class SetParser(UserFileComponentParser): self._hab = "\\s*(HAB|FRONT)\\s*" self._lab = "\\s*(LAB|REAR|MAIN)\\s*" self._hab_or_lab = "\\s*(/" + self._hab + "|/" + self._lab + ")\\s*" - self._centre_pattern = re.compile(start_string + self._centre + "\\s*(" + self._hab_or_lab + space_string + + self._centre_pattern = re.compile(start_string + self._centre + "\\s*(/" + self._lab + space_string + ")?\\s*" + float_number + space_string + float_number + "\\s*(" + space_string + float_number + space_string + float_number + ")?\\s*" + end_string) + self._centre_pattern_HAB = re.compile(start_string + self._centre + "\\s*(/" + self._hab + space_string + + ")?\\s*" + float_number + space_string + float_number + + "\\s*(" + space_string + float_number + space_string + float_number + + ")?\\s*" + end_string) def parse_line(self, line): # Get the settings, ie remove command @@ -1159,6 +1163,8 @@ class SetParser(UserFileComponentParser): output = self._extract_scales(setting) elif self._is_centre(setting): output = self._extract_centre(setting) + elif self._is_centre_HAB(setting): + output = self._extract_centre_HAB(setting) else: raise RuntimeError("SetParser: Unknown command for SET: {0}".format(line)) return output @@ -1169,6 +1175,9 @@ class SetParser(UserFileComponentParser): def _is_centre(self, line): return does_pattern_match(self._centre_pattern, line) + def _is_centre_HAB(self, line): + return does_pattern_match(self._centre_pattern_HAB, line) + def _extract_scales(self, line): scales_string = re.sub(self._scales, "", line) scales = extract_float_list(scales_string, separator=" ") @@ -1179,11 +1188,19 @@ class SetParser(UserFileComponentParser): def _extract_centre(self, line): detector_type = DetectorType.HAB if re.search(self._hab, line) is not None else DetectorType.LAB centre_string = re.sub(self._centre, "", line) - centre_string = re.sub(self._hab_or_lab, "", centre_string) + centre_string = re.sub("/" + self._lab, "", centre_string) centre_string = ' '.join(centre_string.split()) centre = extract_float_list(centre_string, separator=" ") return {SetId.centre: position_entry(pos1=centre[0], pos2=centre[1], detector_type=detector_type)} + def _extract_centre_HAB(self, line): + detector_type = DetectorType.HAB if re.search(self._hab, line) is not None else DetectorType.LAB + centre_string = re.sub(self._centre, "", line) + centre_string = re.sub("/" + self._hab, "", centre_string) + centre_string = ' '.join(centre_string.split()) + centre = extract_float_list(centre_string, separator=" ") + return {SetId.centre_HAB: position_entry(pos1=centre[0], pos2=centre[1], detector_type=detector_type)} + @staticmethod def get_type(): return SetParser.Type diff --git a/scripts/test/SANS/gui_logic/beam_centre_model_test.py b/scripts/test/SANS/gui_logic/beam_centre_model_test.py index 558a2127fa31cd897d8d12e6ffb1270c2bace9ce..0c4bceb9a26b8737cae1d0ee8cfb6b1727da8a1e 100644 --- a/scripts/test/SANS/gui_logic/beam_centre_model_test.py +++ b/scripts/test/SANS/gui_logic/beam_centre_model_test.py @@ -29,7 +29,7 @@ class BeamCentreModelTest(unittest.TestCase): self.assertEqual(self.beam_centre_model.r_max, 280) self.assertEqual(self.beam_centre_model.left_right, True) self.assertEqual(self.beam_centre_model.up_down, True) - self.assertEqual(self.beam_centre_model.tolerance, 0.000125) + self.assertEqual(self.beam_centre_model.tolerance, 0.0001251) self.assertEqual(self.beam_centre_model.lab_pos_1, '') self.assertEqual(self.beam_centre_model.lab_pos_2, '') self.assertEqual(self.beam_centre_model.hab_pos_2, '') @@ -88,9 +88,6 @@ class BeamCentreModelTest(unittest.TestCase): reduction_method=True, verbose=False, component=DetectorType.LAB) - self.assertEqual(state.convert_to_q.q_min, self.beam_centre_model.q_min) - self.assertEqual(state.convert_to_q.q_max, self.beam_centre_model.q_max) - def test_that_find_beam_centre_calls_centre_finder_twice_when_COM_is_TRUE(self): state = mock.MagicMock() self.beam_centre_model.COM = True diff --git a/scripts/test/SANS/user_file/user_file_parser_test.py b/scripts/test/SANS/user_file/user_file_parser_test.py index 18d8ec015d110cb7f3eea8028401afa35f7ed917..fe0c381717cdd84c609e740cecfb1b2c646f8a44 100644 --- a/scripts/test/SANS/user_file/user_file_parser_test.py +++ b/scripts/test/SANS/user_file/user_file_parser_test.py @@ -514,11 +514,11 @@ class SetParserTest(unittest.TestCase): detector_type=DetectorType.LAB)}, "SET centre / lAb 23 45": {SetId.centre: position_entry(pos1=23, pos2=45, detector_type=DetectorType.LAB)}, - "SET centre / hAb 23 45": {SetId.centre: position_entry(pos1=23, pos2=45, + "SET centre / hAb 23 45": {SetId.centre_HAB: position_entry(pos1=23, pos2=45, detector_type=DetectorType.HAB)}, - "SET centre /FRONT 23 45": {SetId.centre: position_entry(pos1=23, pos2=45, + "SET centre /FRONT 23 45": {SetId.centre_HAB: position_entry(pos1=23, pos2=45, detector_type=DetectorType.HAB)}, - "SET centre /FRONT 23 45 55 67": {SetId.centre: position_entry(pos1=23, pos2=45, + "SET centre /FRONT 23 45 55 67": {SetId.centre_HAB: position_entry(pos1=23, pos2=45, detector_type=DetectorType.HAB)}, }