Skip to content

Commit

Permalink
Fix uncertainties with dead time
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoucet committed Apr 25, 2024
1 parent 9b071c0 commit 97d09b4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 29 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.24 [04/2024] Fix issue with errors when using dead time correction
- 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
Expand Down
18 changes: 9 additions & 9 deletions reduction/data/sf_197912_Si_dt_par_42_200.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b
#
# Medium=Si, runs: [197920, 197921, 197922, 197923, 197924, 197925, 197926, 197927, 197928, 197929, 197930, 197931]
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.0888766996055554 b=-5.6872177686659006e-08 error_a=161.84564441183014 error_b=0.003988540742274152
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=7.341821040427503 b=-6.012040147643712e-06 error_a=741.2376390289155 error_b=0.024193504430316405
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.320962216410319 b=-3.708412514404863e-05 error_a=606.2605886476512 error_b=0.03099199091035445
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=30.370149781266015 b=9.763444187558825e-05 error_a=2680.8766315704106 error_b=0.1365883376903538
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=62.89965009567662 b=0.0001557592235018875 error_a=5488.459056149113 error_b=0.27948760026302427
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=120.9852469160573 b=0.00020691590164400054 error_a=11657.27959807004 error_b=0.5869489140907286
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=356.40436234906264 b=0.0018275069497976878 error_a=36527.53453159627 error_b=1.8464457216875345
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=455.2870337782051 b=0.0018152748579145265 error_a=50088.87968853836 error_b=2.508098158009919
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=2380.7392962875742 b=-0.03222957069862086 error_a=184998.5077522072 error_b=9.063057308166101
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.1054667160382166 b=-5.617912037982684e-07 error_a=0.04667538104702767 error_b=1.3018137429370627e-06
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=6.82724232536997 b=1.2688656560311094e-05 error_a=0.2324028930846952 error_b=9.318009212411148e-06
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.04233369452896 b=-1.9489360157486167e-05 error_a=0.157663410572646 error_b=1.0481969546743443e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=29.869209957867863 b=0.00012753449483166555 error_a=0.7248899379790393 error_b=4.9826485598721424e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=61.66839462305655 b=0.0002316351252582843 error_a=1.478288415593624 error_b=0.00010149188596609691
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=105.17590678199322 b=0.0011910971933833392 error_a=3.3420276308542833 error_b=0.00023663673892889404
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=329.76886893249366 b=0.0035035523003574304 error_a=10.326707453657816 error_b=0.0007301721330986305
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=386.3721629485569 b=0.006100247348655508 error_a=15.135094864969659 error_b=0.0010981858339085394
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=1510.4224478401736 b=0.021473822799934317 error_a=57.353529249467414 error_b=0.004150920730355883
18 changes: 9 additions & 9 deletions reduction/data/sf_197912_Si_dt_par_46_200.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b
#
# Medium=Si, runs: [197920, 197921, 197922, 197923, 197924, 197925, 197926, 197927, 197928, 197929, 197930, 197931]
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.0888766996055554 b=-5.6872177686659006e-08 error_a=161.84564441183014 error_b=0.003988540742274152
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=7.341821040427503 b=-6.012040147643712e-06 error_a=741.2376390289155 error_b=0.024193504430316405
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.320962216410319 b=-3.708412514404863e-05 error_a=606.2605886476512 error_b=0.03099199091035445
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=30.370149781266015 b=9.763444187558825e-05 error_a=2680.8766315704106 error_b=0.1365883376903538
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=62.89965009567662 b=0.0001557592235018875 error_a=5488.459056149113 error_b=0.27948760026302427
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=120.9852469160573 b=0.00020691590164400054 error_a=11657.27959807004 error_b=0.5869489140907286
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=356.40436234906264 b=0.0018275069497976878 error_a=36527.53453159627 error_b=1.8464457216875345
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=455.2870337782051 b=0.0018152748579145265 error_a=50088.87968853836 error_b=2.508098158009919
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=2380.7392962875742 b=-0.03222957069862086 error_a=184998.5077522072 error_b=9.063057308166101
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.1054992345498493 b=-5.625546560670077e-07 error_a=0.04667557694518741 error_b=1.3018185997288024e-06
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=6.845214788691569 b=1.2112363525135511e-05 error_a=0.23250544139472942 error_b=9.32148528730967e-06
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.066536473419438 b=-2.058179223152465e-05 error_a=0.15781643043917584 error_b=1.0490020014108388e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=30.001333728554908 b=0.00012142674557014467 error_a=0.7259156900740316 error_b=4.988155081266469e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=62.05895058430106 b=0.00021341633275382337 error_a=1.4812551069307072 error_b=0.00010164977521644902
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=105.98397291311224 b=0.0011529508091935002 error_a=3.349267266183389 error_b=0.00023703366200445846
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=333.25109098259907 b=0.003336390794860261 error_a=10.356876562439577 error_b=0.0007318035807947515
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=390.8337160043824 b=0.005884020602055347 error_a=15.179745173375228 error_b=0.0011006833226223623
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=1532.0673341760432 b=0.02040743422121812 error_a=57.56105902203619 error_b=0.004162335276565998
18 changes: 9 additions & 9 deletions reduction/data/sf_197912_Si_dt_par_46_300.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# LambdaRequested[Angstroms] S1H[mm] (S2/Si)H[mm] S1W[mm] (S2/Si)W[mm] a b error_a error_b
#
# Medium=Si, runs: [197920, 197921, 197922, 197923, 197924, 197925, 197926, 197927, 197928, 197929, 197930, 197931]
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=0.9696521424239634 b=3.109825930777195e-06 error_a=233.25548699691095 error_b=0.005709869223821722
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=7.888065990554204 b=-2.5851412589413515e-05 error_a=1054.563051347941 error_b=0.033950572631030344
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.62385188352408 b=-5.570512058074805e-05 error_a=871.2007519922379 error_b=0.043472028815114895
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=30.788530271881037 b=7.368170486421024e-05 error_a=3864.1491573285743 error_b=0.1924859170699873
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=63.48718014559093 b=0.0001257591150576306 error_a=7921.015153325416 error_b=0.394555674637449
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=128.62729619621012 b=-0.0002561652398998484 error_a=16762.476487369557 error_b=0.8226687408455199
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=369.7306065840916 b=0.0010537182539730222 error_a=52662.092278312455 error_b=2.599967726224994
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=489.54945849091285 b=-0.00023641838136746494 error_a=72046.19892232501 error_b=3.5158122875352493
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=2761.264907784248 b=-0.05537054457130235 error_a=264191.38397000416 error_b=12.510086943391116
IncidentMedium=Si LambdaRequested=9.74 S1H=0.391 S2iH=0.24999999999999978 S1W=20.005 S2iW=20.000084375 a=1.1054992345498493 b=-5.625546560670077e-07 error_a=0.04667557694518741 error_b=1.3018185997288024e-06
IncidentMedium=Si LambdaRequested=7.043 S1H=0.39 S2iH=0.24999999999999978 S1W=19.952000000000005 S2iW=19.950864375000002 a=6.845214788691569 b=1.2112363525135511e-05 error_a=0.23250544139472942 error_b=9.32148528730967e-06
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=8.779 S2iW=8.780164375000002 a=9.066536473419438 b=-2.058179223152465e-05 error_a=0.15781643043917584 error_b=1.0490020014108388e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.39 S2iH=0.24999999999999978 S1W=20.002 S2iW=19.999844375000002 a=30.001333728554908 b=0.00012142674557014467 error_a=0.7259156900740316 error_b=4.988155081266469e-05
IncidentMedium=Si LambdaRequested=4.25 S1H=0.77 S2iH=0.49312 S1W=12.489000000000004 S2iW=12.485564375000003 a=62.05895058430106 b=0.00021341633275382337 error_a=1.4812551069307072 error_b=0.00010164977521644902
IncidentMedium=Si LambdaRequested=4.25 S1H=0.774 S2iH=0.4930399999999997 S1W=20.001000000000005 S2iW=20.000244375 a=105.98397291311224 b=0.0011529508091935002 error_a=3.349267266183389 error_b=0.00023703366200445846
IncidentMedium=Si LambdaRequested=4.25 S1H=1.525 S2iH=0.976 S1W=16.384000000000004 S2iW=16.395444375000004 a=333.25109098259907 b=0.003336390794860261 error_a=10.356876562439577 error_b=0.0007318035807947515
IncidentMedium=Si LambdaRequested=4.25 S1H=1.528 S2iH=0.976 S1W=20.004 S2iW=20.000244375 a=390.8337160043824 b=0.005884020602055347 error_a=15.179745173375228 error_b=0.0011006833226223623
IncidentMedium=Si LambdaRequested=4.25 S1H=3.016 S2iH=1.9319199999999999 S1W=20.003000000000004 S2iW=20.000164375 a=1532.0673341760432 b=0.02040743422121812 error_a=57.56105902203619 error_b=0.004162335276565998
4 changes: 4 additions & 0 deletions reduction/lr_reduction/DeadTimeCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def PyExec(self):
logger.error(error)

counts_ws.setY(0, corr)

# We don't compute an error on the dead time correction, so set it to zero
counts_ws.setE(0, 0 * corr)

self.setProperty('OutputWorkspace', counts_ws)


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.23'
__version__ = '2.0.24'
2 changes: 1 addition & 1 deletion reduction/lr_reduction/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from . import event_reduction, reduction_template_reader

TOLERANCE = 0.02
TOLERANCE = 0.07


def read_template(template_file, sequence_number):
Expand Down
4 changes: 4 additions & 0 deletions scripts/autoreduce/reduce_REF_L.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@

import mantid
from mantid.simpleapi import *
from mantid.kernel import ConfigService
ConfigService.Instance().setString("default.instrument", "REF_L")
ConfigService.Instance().setString("default.facility", "SNS")
ConfigService.Instance().setString("datasearch.searcharchive", "sns")

event_file_path=sys.argv[1]
output_dir=sys.argv[2]
Expand Down

0 comments on commit 97d09b4

Please sign in to comment.