Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class SNSPowderReduction(DataProcessorAlgorithm):
_sampleFormula = None
_massDensity = None
_containerShape = None
_compressionThreshold = None

def category(self):
return "Diffraction\\Reduction"
Expand All @@ -178,7 +179,9 @@ def summary(self):
return "The algorithm used for reduction of powder diffraction data obtained on SNS instruments (e.g. PG3)"

def PyInit(self):
self.copyProperties("AlignAndFocusPowderFromFiles", ["Filename", "PreserveEvents", "DMin", "DMax", "DeltaRagged"])
self.copyProperties(
"AlignAndFocusPowderFromFiles", ["Filename", "PreserveEvents", "DMin", "DMax", "DeltaRagged", "MinSizeCompressOnLoad"]
)

self.declareProperty("Sum", False, "Sum the runs. Does nothing for characterization runs.")
self.declareProperty(
Expand Down Expand Up @@ -438,6 +441,8 @@ def PyExec(self): # noqa
self._info = None
self._chunks = self.getProperty("MaxChunkSize").value

self._compressionThreshold = self.getProperty("MinSizeCompressOnLoad").value

# define splitters workspace and filter wall time
self._splittersWS = self.getProperty("SplittersWorkspace").value
if self._splittersWS is not None:
Expand Down Expand Up @@ -928,6 +933,7 @@ def _focusAndSum(self, filenames, preserveEvents=True, final_name=None, absorpti
ReductionProperties="__snspowderreduction",
LogAllowList=self.getPropertyValue("LogAllowList").strip(),
LogBlockList=self.getPropertyValue("LogBlockList").strip(),
MinSizeCompressOnLoad=self._compressionThreshold,
**otherArgs,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ def testValidateInputs(self):
RuntimeError, SNSPowderReduction, Filename="PG3_46577", OutputDirectory="/tmp/", PushDataPositive="AddMinimum", OffsetData=42.0
)

def testValidateInputsCompressLoad(self):
# PushDataPositive and OffsetData cannot be specified together
self.assertRaises(
RuntimeError,
SNSPowderReduction,
Filename="PG3_46577",
OutputDirectory="/tmp/",
PushDataPositive="AddMinimum",
OffsetData=42.0,
MinSizeCompressOnLoad=1e-14,
)


if __name__ == "__main__":
unittest.main()
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Added a load compression parameter ``MinSizeCompressOnLoad`` for ref: :ref:`AlignAndFocusPowderFromFiles <algm-AlignAndFocusPowderFromFiles>`.
- Added a load compression parameter ``MinSizeCompressOnLoad`` for ref: :ref:`AlignAndFocusPowderFromFiles <algm-AlignAndFocusPowderFromFiles>`.
- Added a load compression parameter ``MinSizeCompressOnLoad`` for ref: :ref:`SNSPowderReduction <algm-SNSPowderReduction>`.