Ticket #9187 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Mari problem with GeitEi at high incident energy

Reported by: Nick Draper Owned by: Alex Buts
Priority: critical Milestone: Release 3.2
Component: Direct Inelastic Keywords:
Cc: Blocked By:
Blocking: Tester:

Description

From Jon Taylor

We found a bug in get ei when running mari at high incident energy.

We have to fix the ei, but in so doing the factor in time of flight is generated incorrectly as -0 musec rather than a real time.

I've attached two scripts the one with the bug and the fixed one
thanks
jon
######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
LoadMask(Instrument='MAR',InputFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MaskFiles/mari_mask2014.msk',OutputWorkspace='hard_mask_ws')
LoadRaw(Filename=r'/home/mari/data/mar18622.raw',OutputWorkspace='wb_wksp',LoadLogFiles='0')
LoadRaw(Filename=r'/home/mari/data/mar00000.raw',OutputWorkspace='run_wksp',LoadLogFiles='0')
LoadDetectorInfo(Workspace='run_wksp',DataFilename=r'/home/mari/data/mar18622.raw',RelocateDets='1')
AddSampleLog(Workspace='run_wksp',LogName='calibrated',LogText='MAR18622.raw')
GetEi(InputWorkspace='run_wksp',Monitor1Spec='2',Monitor2Spec='3',EnergyEstimate='1771',FixEi='1')
ScaleX(InputWorkspace='run_wksp',OutputWorkspace='_wksp.spe',Factor='-0',Operation='Add',InstrumentParameter='DelayTime',Combine='1')
MoveInstrumentComponent(Workspace='_wksp.spe',ComponentName='Moderator',Z='-1.4419999999999999',RelativePosition='0')
ConvertToDistribution(Workspace='_wksp.spe')
CalculateFlatBackground(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',StartX='18000',EndX='19500',Mode='Mean')
ConvertFromDistribution(Workspace='_wksp.spe')
NormaliseByCurrent(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
AddSampleLog(Workspace='_wksp.spe',LogName='DirectInelasticReductionNormalisedBy',LogText='current')
ConvertUnits(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Target='DeltaE',EMode='Direct')
Rebin(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Params='-200,3,900',PreserveEvents='0')
DetectorEfficiencyCor(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
CorrectKiKf(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
Rebin(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Params='-200,3,900')
MaskDetectors(Workspace='_wksp.spe',MaskedWorkspace='hard_mask_ws')
GroupDetectors(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',MapFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MapFiles/mari_res2013.map',Behaviour='Average')
ConvertToDistribution(Workspace='_wksp.spe')
LoadDetectorInfo(Workspace='wb_wksp',DataFilename=r'/home/mari/data/mar18622.raw',RelocateDets='1')
AddSampleLog(Workspace='wb_wksp',LogName='calibrated',LogText='MAR18622.raw')
CloneWorkspace(InputWorkspace='wb_wksp',OutputWorkspace='_wksp.spe-white')
NormaliseByCurrent(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white')
AddSampleLog(Workspace='_wksp.spe-white',LogName='DirectInelasticReductionNormalisedBy',LogText='current')
ConvertUnits(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',Target='Energy')
Rebin(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',Params='20,160,100')
MaskDetectors(Workspace='_wksp.spe-white',MaskedWorkspace='hard_mask_ws')
GroupDetectors(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',MapFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MapFiles/mari_res2013.map',Behaviour='Average')
CreateSingleValuedWorkspace(OutputWorkspace='__tmp_binary_operation_double',DataValue='1000')
Multiply(LHSWorkspace='_wksp.spe-white',RHSWorkspace='__tmp_binary_operation_double',OutputWorkspace='_wksp.spe-white')
Divide(LHSWorkspace='_wksp.spe',RHSWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe')
CreateSingleValuedWorkspace(OutputWorkspace='__tmp_binary_operation_double',DataValue='181820000')
Multiply(LHSWorkspace='_wksp.spe',RHSWorkspace='__tmp_binary_operation_double',OutputWorkspace='_wksp.spe')
RenameWorkspace(InputWorkspace='_wksp.spe',OutputWorkspace='w1')
RenameWorkspace(InputWorkspace='w1',OutputWorkspace='mar0')


now for the corrected version

######################################################################
#Python Script Generated by GeneratePythonScript Algorithm
######################################################################
LoadMask(Instrument='MAR',InputFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MaskFiles/mari_mask2014.msk',OutputWorkspace='hard_mask_ws')
LoadRaw(Filename=r'/home/mari/data/mar18622.raw',OutputWorkspace='wb_wksp',LoadLogFiles='0')
LoadRaw(Filename=r'/home/mari/data/mar00000.raw',OutputWorkspace='run_wksp',LoadLogFiles='0')
LoadDetectorInfo(Workspace='run_wksp',DataFilename=r'/home/mari/data/mar18622.raw',RelocateDets='1')
AddSampleLog(Workspace='run_wksp',LogName='calibrated',LogText='MAR18622.raw')
GetEi(InputWorkspace='run_wksp',Monitor1Spec='2',Monitor2Spec='3',EnergyEstimate='1771',FixEi=True)
ScaleX(InputWorkspace='run_wksp',OutputWorkspace='_wksp.spe',Factor='-559.0271718578523',Operation='Add',InstrumentParameter='DelayTime',Combine='1')
MoveInstrumentComponent(Workspace='_wksp.spe',ComponentName='Moderator',Z='-1.4419999999999999',RelativePosition='0')
ConvertToDistribution(Workspace='_wksp.spe')
#CalculateFlatBackground(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',StartX='17249.972828142149',EndX='18749.972828142149',Mode='Mean')
ConvertFromDistribution(Workspace='_wksp.spe')
NormaliseByCurrent(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
AddSampleLog(Workspace='_wksp.spe',LogName='DirectInelasticReductionNormalisedBy',LogText='current')
ConvertUnits(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Target='DeltaE',EMode='Direct')
Rebin(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Params='-200,3,1700',PreserveEvents='0')
DetectorEfficiencyCor(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
CorrectKiKf(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe')
Rebin(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',Params='-200,3,1700')
MaskDetectors(Workspace='_wksp.spe',MaskedWorkspace='hard_mask_ws')
GroupDetectors(InputWorkspace='_wksp.spe',OutputWorkspace='_wksp.spe',MapFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MapFiles/mari_res2013.map',Behaviour='Average')
ConvertToDistribution(Workspace='_wksp.spe')
LoadDetectorInfo(Workspace='wb_wksp',DataFilename=r'/home/mari/data/mar18622.raw',RelocateDets='1')
AddSampleLog(Workspace='wb_wksp',LogName='calibrated',LogText='MAR18622.raw')
CloneWorkspace(InputWorkspace='wb_wksp',OutputWorkspace='_wksp.spe-white')
NormaliseByCurrent(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white')
AddSampleLog(Workspace='_wksp.spe-white',LogName='DirectInelasticReductionNormalisedBy',LogText='current')
ConvertUnits(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',Target='Energy')
Rebin(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',Params='20,160,100')
MaskDetectors(Workspace='_wksp.spe-white',MaskedWorkspace='hard_mask_ws')
GroupDetectors(InputWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe-white',MapFile=r'/home/mari/Desktop/MantidUserScripts/direct_inelastic/MARI/MapFiles/mari_res2013.map',Behaviour='Average')
CreateSingleValuedWorkspace(OutputWorkspace='__tmp_binary_operation_double',DataValue='1000')
Multiply(LHSWorkspace='_wksp.spe-white',RHSWorkspace='__tmp_binary_operation_double',OutputWorkspace='_wksp.spe-white')
Divide(LHSWorkspace='_wksp.spe',RHSWorkspace='_wksp.spe-white',OutputWorkspace='_wksp.spe')
CreateSingleValuedWorkspace(OutputWorkspace='__tmp_binary_operation_double',DataValue='181820000')
Multiply(LHSWorkspace='_wksp.spe',RHSWorkspace='__tmp_binary_operation_double',OutputWorkspace='_wksp.spe')
RenameWorkspace(InputWorkspace='_wksp.spe',OutputWorkspace='w1')
RenameWorkspace(InputWorkspace='w1',OutputWorkspace='w1')


Change History

comment:1 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

comment:2 Changed 7 years ago by Alex Buts

  • Status changed from assigned to inprogress

comment:3 Changed 7 years ago by Alex Buts

refs #9187 Added Property which defines the search range.

Changeset: e65e71bfbd7597c78b7893c24de442a3a38a0f01

comment:4 Changed 7 years ago by Alex Buts

refs #9187 modified calculatePeakWidthAtHalfHeight to work with

high background. This should fix the problem, though background can generate some stabilizing effects sometimes -- this can change results in other places.

Changeset: 57be0a827338ab54fbf69dad028666e0dc5ad6f7

comment:5 Changed 7 years ago by Alex Buts

refs #9187 Modified algorithm to return guess time together

with guess energy. This would allow reduction to work properly for Ei specified manually.

Changeset: d897ea43b49811aac08b8f1a52d08ab634cca9d8

comment:6 Changed 7 years ago by Alex Buts

refs #9187 Added parameter to IDF parameters for instruments

which can work in high energy mode. This parameter allows to specify ei-search-range as input to DGreduction.

Changeset: 4d05e46c5ba2026c749c06a1aa610d482ec77789

comment:7 Changed 7 years ago by Alex Buts

refs #9187 Fixing unit test

Changeset: 20bd356e0cb1ed134ff2e10f9e66f5a7f4d5044d

comment:8 Changed 7 years ago by Alex Buts

refs #9187 Fixing another unit test/GetEiTest.h

This one relates to changes in behavior -- if Ei is given, monitor peak returns guess time. -- This would allow reduction to work for Ei given

Changeset: cbe7ca944932404cbfd55807dd446c2cf18c9083

comment:9 Changed 7 years ago by Alex Buts

refs #9187 Changed info to warning

when peak has not been found within the specified range and guess energy is fixed.

Changeset: 93720a45c5b2121d337e57719458d5513da8efa1

comment:10 Changed 7 years ago by Alex Buts

  • Status changed from inprogress to verify
  • Resolution set to fixed

To test this ticket one need couple of high energy run files. I put them at ftp://ftp.nd.rl.ac.uk/scratch/abuts/. Map and mask files for MARI are present in the system tests folder.

Both scripts below should fail before the ticket is applied but after merging, two solutions are available:

1) This script should run and produce history similar to the one deemed right in the ticket description.

      import dgreduce 
      # The tests rely on MARI_Parameters.xml file valind on 31 July 2013
      dgreduce.setup("MAR") 

      args={};
      args['hard_mask_file'] = 'mar11015.msk'
      args['det_cal_file']= 18622 #"11060"
      args['fix_ei']= True 

      outWS=dgreduce.arb_units(18622,19227,1771,[-200,3,1700],'mari_res.map',None,**args)

2) This script should run and find ei peak from the initial energy guess.

      import dgreduce 
      # The tests rely on MARI_Parameters.xml file valind on 31 July 2013
      dgreduce.setup("MAR") 

      args={};
      args['hard_mask_file'] = 'mar11015.msk'
      args['det_cal_file']= 18622 #"11060"
      args['ei_mon_peak_search_range']= 0.05

      outWS=dgreduce.arb_units(18622,19227,1771,[-200,3,1700],'mari_res.map',None,**args)

Last edited 7 years ago by Alex Buts (previous) (diff)

comment:11 Changed 7 years ago by Alex Buts

refs #9187 Spelling error.

Changeset: ca7bee037b2f68c7f9b1819618b56db7d7abb892

comment:12 Changed 7 years ago by Martyn Gigg

  • Status changed from verify to closed

Merge remote-tracking branch 'origin/bugfix/9187_getEIatHighE'

Full changeset: 1bc69422f3e988b14bdad4d0c17a8f000f4bf90b

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10030

Note: See TracTickets for help on using tickets.