Unverified Commit b2a7f4a9 authored by Whitfield, Ross's avatar Whitfield, Ross Committed by GitHub
Browse files

Merge pull request #32537 from Kvieta1990/patch_abs_corr

patch for absorption correction
parents 32e10783 d645fb26
......@@ -425,6 +425,7 @@ def create_absorption_input( # noqa: C901
material={},
geometry={},
environment={},
find_environment=True,
opt_wl_min=0,
opt_wl_max=Property.EMPTY_DBL,
metaws=None,
......@@ -438,6 +439,7 @@ def create_absorption_input( # noqa: C901
:param material: Optional material to use in SetSample
:param geometry: Optional geometry to use in SetSample
:param environment: Optional environment to use in SetSample
:param find_environment: Optional find_environment to control whether to figure out environment automatically.
:param opt_wl_min: Optional minimum wavelength. If specified, this is used instead of from the props
:param opt_wl_max: Optional maximum wavelength. If specified, this is used instead of from the props
:param metaws: Optional workspace name with metadata to use for donor workspace instead of reading from filename
......@@ -538,6 +540,10 @@ def create_absorption_input( # noqa: C901
# Make sure one is set before calling SetSample
if material or geometry or environment:
mantid.simpleapi.SetSampleFromLogs(InputWorkspace=absName, Material=material, Geometry=geometry, Environment=environment)
mantid.simpleapi.SetSampleFromLogs(InputWorkspace=absName,
Material=material,
Geometry=geometry,
Environment=environment,
FindEnvironment=find_environment)
return absName
......@@ -1416,6 +1416,7 @@ class SNSPowderReduction(DistributedDataProcessorAlgorithm):
'Height': 7.,
'Radius': self._vanRadius,
'Center': [0., 0., 0.]},
find_environment=False,
opt_wl_min=self._wavelengthMin,
opt_wl_max=self._wavelengthMax)
......
......@@ -92,7 +92,7 @@ class SetSampleFromLogs(DistributedDataProcessorAlgorithm):
beamline = 'BL11A'
else:
warningMsg = 'Do not know how to create lognames for "{}"'.format(instrEnum.name())
self.log().warn(warningMsg)
self.log().warning(warningMsg)
if beamline:
# "internal" log names at SNS are templated from the beamline number
heightInContainerUnitsNames.append('{}:CS:ITEMS:HeightInContainerUnits'.format(beamline))
......@@ -115,14 +115,16 @@ class SetSampleFromLogs(DistributedDataProcessorAlgorithm):
warningMsg = "HeightInContainerUnits expects cm or mm;" + \
" specified units not recognized: {:s};".format(units) + \
" we will reply on user input for sample density information."
self.log().warn(warningMsg)
self.log().warning(warningMsg)
# set the height
heightKey = _findKey(runObject, *heightInContainerNames)
if heightKey:
geometry['Height'] = conversion * _getLogValue(runObject, heightKey)
else:
raise RuntimeError("Failed to determine the height from the logs")
warningMsg = "No valid height found in sample logs;" + \
"we will rely on user input for sample density information."
self.log().warning(warningMsg)
# log the results and return
self.log().information('GEOMETRY (in cm): ' + str(geometry))
......
......@@ -14,6 +14,10 @@ Powder Diffraction
- `GetDetOffsetsMultiPeaks`, which is deprecate since v6.2.0, is removed.
- `CalibrateRectangularDetectors`, which is deprecate since v6.2.0, is removed. And system test CalibrateRectangularDetectors_Test is removed.
Bugfixes
########
- For processing vanadium run, we don't want to find environment automatically in :ref:`SetSampleFromLogs <algm-SetSampleFromLogs>`.
Engineering Diffraction
-----------------------
......
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