Skip to content

Commit

Permalink
add options
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Apr 12, 2024
1 parent 8f0d896 commit 5bddc77
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion reduction/lr_reduction/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.21'
__version__ = '2.0.22'
13 changes: 12 additions & 1 deletion reduction/lr_reduction/scaling_factors/LRScalingFactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5bddc77

Please sign in to comment.