Commit 4c76124f authored by McDonnell, Marshall's avatar McDonnell, Marshall
Browse files

Re #28791 - put common input into dict for LRAutoReduction

parent 28f5c37f
......@@ -653,68 +653,45 @@ class LRAutoReduction(PythonAlgorithm):
# Write template before we start the computation
self._write_template(data_set, run_number, first_run_of_set, sequence_number)
# Execute the reduction
# input args for both reduction
kwargs = {
"InputWorkspace": self.event_data,
"NormalizationRunNumber": str(data_set.norm_file),
"SignalPeakPixelRange": data_set.DataPeakPixels,
"SubtractSignalBackground": data_set.DataBackgroundFlag,
"SignalBackgroundPixelRange": data_set.DataBackgroundRoi[:2],
"NormFlag": data_set.NormFlag,
"NormPeakPixelRange": data_set.NormPeakPixels,
"NormBackgroundPixelRange": data_set.NormBackgroundRoi,
"SubtractNormBackground": data_set.NormBackgroundFlag,
"LowResDataAxisPixelRangeFlag": data_set.data_x_range_flag,
"LowResDataAxisPixelRange": data_set.data_x_range,
"LowResNormAxisPixelRangeFlag": data_set.norm_x_range_flag,
"LowResNormAxisPixelRange": data_set.norm_x_range,
"TOFRange": data_set.DataTofRange,
"IncidentMediumSelected": incident_medium,
"GeometryCorrectionFlag": False,
"QMin": data_set.q_min,
"QStep": data_set.q_step,
"AngleOffset": data_set.angle_offset,
"AngleOffsetError": data_set.angle_offset_error,
"ScalingFactorFile": str(data_set.scaling_factor_file),
"SlitsWidthFlag": data_set.slits_width_flag,
"ApplyPrimaryFraction": True,
"SlitTolerance": slit_tolerance,
"PrimaryFractionRange": [data_set.clocking_from, data_set.clocking_to],
"OutputWorkspace": 'reflectivity_%s_%s_%s' % (first_run_of_set, sequence_number, run_number)
}
# Execute the reduction for the selected normalization type
norm_type = self.getProperty("NormalizationType").value
if norm_type == "DirectBeam":
LiquidsReflectometryReduction(
#RunNumbers=[int(run_number)],
InputWorkspace=self.event_data,
NormalizationRunNumber=str(data_set.norm_file),
SignalPeakPixelRange=data_set.DataPeakPixels,
SubtractSignalBackground=data_set.DataBackgroundFlag,
SignalBackgroundPixelRange=data_set.DataBackgroundRoi[:2],
NormFlag=data_set.NormFlag,
NormPeakPixelRange=data_set.NormPeakPixels,
NormBackgroundPixelRange=data_set.NormBackgroundRoi,
SubtractNormBackground=data_set.NormBackgroundFlag,
LowResDataAxisPixelRangeFlag=data_set.data_x_range_flag,
LowResDataAxisPixelRange=data_set.data_x_range,
LowResNormAxisPixelRangeFlag=data_set.norm_x_range_flag,
LowResNormAxisPixelRange=data_set.norm_x_range,
TOFRange=data_set.DataTofRange,
IncidentMediumSelected=incident_medium,
GeometryCorrectionFlag=False,
QMin=data_set.q_min,
QStep=data_set.q_step,
AngleOffset=data_set.angle_offset,
AngleOffsetError=data_set.angle_offset_error,
ScalingFactorFile=str(data_set.scaling_factor_file),
SlitsWidthFlag=data_set.slits_width_flag,
ApplyPrimaryFraction=True,
SlitTolerance=slit_tolerance,
PrimaryFractionRange=[data_set.clocking_from, data_set.clocking_to],
OutputWorkspace='reflectivity_%s_%s_%s' % (first_run_of_set, sequence_number, run_number))
LiquidsReflectometryReduction(**kwargs)
elif "WithReference":
refl1d_parameters = self.getProperty("Refl1DModelParameters").value
LRReductionWithReference(
InputWorkspace=self.event_data,
NormalizationRunNumber=str(data_set.norm_file),
SignalPeakPixelRange=data_set.DataPeakPixels,
SubtractSignalBackground=data_set.DataBackgroundFlag,
SignalBackgroundPixelRange=data_set.DataBackgroundRoi[:2],
NormFlag=data_set.NormFlag,
NormPeakPixelRange=data_set.NormPeakPixels,
NormBackgroundPixelRange=data_set.NormBackgroundRoi,
SubtractNormBackground=data_set.NormBackgroundFlag,
LowResDataAxisPixelRangeFlag=data_set.data_x_range_flag,
LowResDataAxisPixelRange=data_set.data_x_range,
LowResNormAxisPixelRangeFlag=data_set.norm_x_range_flag,
LowResNormAxisPixelRange=data_set.norm_x_range,
TOFRange=data_set.DataTofRange,
IncidentMediumSelected=incident_medium,
GeometryCorrectionFlag=False,
QMin=data_set.q_min,
QStep=data_set.q_step,
AngleOffset=data_set.angle_offset,
AngleOffsetError=data_set.angle_offset_error,
ScalingFactorFile=str(data_set.scaling_factor_file),
SlitsWidthFlag=data_set.slits_width_flag,
ApplyPrimaryFraction=True,
SlitTolerance=slit_tolerance,
PrimaryFractionRange=[data_set.clocking_from, data_set.clocking_to],
OutputWorkspace='reflectivity_%s_%s_%s' % (first_run_of_set, sequence_number, run_number),
Refl1DModelParameters=refl1d_parameters)
kwargs['Refl1DModelParameters'] = refl1d_parameters
LRReductionWithReference(**kwargs)
# Put the reflectivity curve together
self._save_partial_output(data_set, first_run_of_set, sequence_number, run_number)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment