From 5bddc77d2b2fd57c5d49448cb1ae53a7911d7cb9 Mon Sep 17 00:00:00 2001 From: Mathieu Doucet Date: Fri, 12 Apr 2024 16:19:02 -0400 Subject: [PATCH] add options --- README.md | 1 + reduction/lr_reduction/__init__.py | 2 +- .../scaling_factors/LRScalingFactors.py | 13 ++++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5655f69..bf83020 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Reduction scripts for the Liquids Reflectometer. This includes both automated re ## Release notes: + - reduction v2.0.22 [04/2024] Add dead time correction to scaling factor calculation - reduction v2.0.20 [03/2024] Add error events to dead time correction - reduction v2.0.19 [03/2024] Add dead time correction and clean up functional background option - reduction v2.0.14 [02/2024] Add functional background diff --git a/reduction/lr_reduction/__init__.py b/reduction/lr_reduction/__init__.py index 19dc9e5..0e15751 100644 --- a/reduction/lr_reduction/__init__.py +++ b/reduction/lr_reduction/__init__.py @@ -1 +1 @@ -__version__ = '2.0.21' +__version__ = '2.0.22' diff --git a/reduction/lr_reduction/scaling_factors/LRScalingFactors.py b/reduction/lr_reduction/scaling_factors/LRScalingFactors.py index 9436216..768b068 100644 --- a/reduction/lr_reduction/scaling_factors/LRScalingFactors.py +++ b/reduction/lr_reduction/scaling_factors/LRScalingFactors.py @@ -11,6 +11,7 @@ from mantid.simpleapi import * from mantid.kernel import * +import lr_reduction from lr_reduction import DeadTimeCorrection from lr_reduction.utils import mantid_algorithm_exec @@ -74,7 +75,7 @@ def PyInit(self): self.declareProperty("FrontSlitName", "S1", doc="Name of the front slit") self.declareProperty("BackSlitName", "Si", doc="Name of the back slit") self.declareProperty("TOFSteps", 500.0, doc="TOF step size") - self.declareProperty("SlitTolerance", 0.02, doc="Tolerance for matching slit positions") + self.declareProperty("SlitTolerance", 0.07, doc="Tolerance for matching slit positions") self.declareProperty("UseDeadTimeCorrection", True, doc="If True, counts will be corrected for dead time") self.declareProperty("ParalyzableDeadTime", True, doc="If true, paralyzable correction will be applied, non-paralyzing otherwise") @@ -400,9 +401,19 @@ def save_scaling_factor_file(self): medium = self.getProperty("IncidentMedium").value scaling_file_meta[medium] = "# Medium=%s, runs: %s" % (medium, direct_beams) + correct_for_deadtime = self.getProperty("UseDeadTimeCorrection").value + paralyzable = self.getProperty("ParalyzableDeadTime").value + deadtime = self.getProperty("DeadTime").value + deadtime_step = self.getProperty("DeadTimeTOFStep").value + fd = open(scaling_file, "w") fd.write("# y=a+bx\n#\n") fd.write("# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b\n#\n") + fd.write("# Version: lr_reduction %s\n" % lr_reduction.__version__) + fd.write("# apply_deadtime: %s\n" % correct_for_deadtime) + fd.write("# paralyzable_deadtime: %s\n" % paralyzable) + fd.write("# deadtime_value: %s\n" % deadtime) + fd.write("# deadtime_tof_step: %s\n#\n" % deadtime_step) for k, v in scaling_file_meta.items(): fd.write("%s\n" % v)