Skip to content
Snippets Groups Projects
Commit 89838060 authored by David Fairbrother's avatar David Fairbrother
Browse files

Re #18666 Move POLARIS to crop Van on a bank by bank basis

parent 968f7f4e
No related branches found
No related tags found
No related merge requests found
......@@ -113,8 +113,8 @@ class Polaris(AbstractInst):
return cropped_ws
def _crop_van_to_expected_tof_range(self, van_ws_to_crop):
cropped_ws = common.crop_in_tof(ws_to_crop=van_ws_to_crop, x_min=self._inst_settings.van_crop_values[0],
x_max=self._inst_settings.van_crop_values[-1])
cropped_ws = common.crop_banks_in_tof(bank_list=van_ws_to_crop,
crop_values_list=self._inst_settings.van_crop_values)
return cropped_ws
def _crop_banks_to_user_tof(self, focused_banks):
......
# Note all changes in this file require a restart of Mantid
# additionally any long term changes should be sent back to the development team so any changes can be merged
# into future versions of Mantid.
absorption_correction_params = {
# These are read directly by the generate absorb corrections functions instead of being parsed.
# Therefore they cannot be overridden using basic config files or keyword arguments.
"cylinder_sample_height": 4.0,
"cylinder_sample_radius": 0.4,
"cylinder_position": [0., 0., 0.],
"chemical_formula": "V",
}
file_names = {
"masking_file_name": "VanaPeaks.dat",
"grouping_file_name": "Master_copy_of_grouping_file_with_essential_masks.cal"
......@@ -6,7 +20,6 @@ file_names = {
script_params = {
"raw_data_cropping_values": (750, 20000),
"spline_coefficient": 100,
"vanadium_cropping_values": (800, 19995)
}
tof_cropping_ranges = [
......@@ -17,18 +30,13 @@ tof_cropping_ranges = [
(1500, 19900), # Bank 5
]
absorption_correction_params = {
# These are read directly by the generate absorb corrections functions instead of being parsed.
# Therefore they cannot be overridden using basic config files or keyword arguments.
# For documentation on their behaviour please see:
# http://docs.mantidproject.org/nightly/algorithms/CylinderAbsorption-v1.html
"cylinder_sample_height": 4.0,
"cylinder_sample_radius": 0.4,
"cylinder_position": [0., 0., 0.],
"chemical_formula": "V",
}
vanadium_cropping_values = [
(800, 19995), # Bank 1
(800, 19995), # Bank 2
(800, 19995), # Bank 3
(800, 19995), # Bank 4
(800, 19995), # Bank 5
]
variable_help = {
"file_names": {
......@@ -53,5 +61,6 @@ variables = {
# Used by the script to find the dictionaries in advanced config.
"file_names_dict": file_names,
"script_params": script_params,
"tof_cropping_ranges": tof_cropping_ranges
"tof_cropping_ranges": tof_cropping_ranges,
"vanadium_cropping_values": vanadium_cropping_values
}
......@@ -11,8 +11,11 @@ def create_calibration_by_names(calibration_runs, startup_objects, grouping_file
def crop_banks_in_tof(bank_list, crop_values_list):
if not isinstance(crop_values_list, list):
raise ValueError("The cropping values were not in a list type")
if len(bank_list) != len(crop_values_list):
raise RuntimeError("The number of TOF cropping values does not match the number of banks for this instrument")
output_list = []
for spectra, cropping_values in zip(bank_list, crop_values_list):
output_list.append(crop_in_tof(ws_to_crop=spectra, x_min=cropping_values[0], x_max=cropping_values[-1]))
......
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