mantid icon indicating copy to clipboard operation
mantid copied to clipboard

Algorithm required to calculate the efficiency of the ISIS SANS two spin flippers

Open rbauststfc opened this issue 1 year ago • 1 comments

An algorithm is required to calculate the efficiency of the two spin flippers. This is required for the Polarised SANS reduction at ISIS. Calculating the efficiency of just one of the spin flippers is required for the epic MVP, as SANS are currently only using a single flipper in their setup. They would like the flexibility to support two in the future, though, so the full scope implementation will calculate the efficiency of two flippers.

The algorithm will be used in advance as part of commissioning, rather than calculating the flipper efficiency during the normal polarised SANS reduction workflow. A calibration measurement will be taken and the algorithm will be used to calculate the flipper efficiency and save the result as a Nexus file. This is not expected to vary between experiments, so the file can ultimately be read into the reduction workflow from the user file.

Math

Ixx represents the configuration of the flipper.

  • (I00 - I10) / (I00 + I10)

This applies if there is only one flipper, according to Wildes 2006.

Questions

  • [ ] Example code seems a bit unclear. Do we only need to consider I00 & I10, or both
    • I00, I10
    • I11, I01
    • And then do something with the two results to compare them?

Workflow

  • [ ] Input: One workspace group containing 4 periods, assignments of these 4 periods.
  • [ ] Perform the above equation on the ++ and -+ periods
  • [ ] Output the result a nexus file to an file path provided by the user.

Requirements for this still need to be gathered.

rbauststfc avatar Sep 20 '23 08:09 rbauststfc

There is only one algorithm to determine the efficiency of a flipper on the incoming instrument site. We will take care that we expose a variable that shows if the instrument is in a flipper on/off state via a block in IBEX. The efficiency is calculated by simple linear combination and ratios of worksheets. Below is a code example to calculate the Flipper efficiency PF and the combined polarizer and analyzer efficiency PA. PA will be used further in #36139.

The function takes 4 (monitor) worksheets normalised to incidence flux, nfs1/2 and sf1/2 are the for spin-resolved measurements.

def calculate_beam_polarisation(strname): strname=str(rnum)+"trans" output1=Plus(strname+""+nsf1,strname+""+nsf2) output2=Plus(strname+""+sf1,strname+""+sf2)
output5=Minus(strname+"
"+nsf2,strname+""+sf1) output6=Minus(strname+""+nsf1,strname+""+sf2) output7=Plus(strname+""+nsf2,strname+""+sf1) output8=Plus(strname+""+nsf1,strname+""+sf2)
PA=Divide(LHSWorkspace=output5, RHSWorkspace=output7, OutputWorkspace='PA
'+strname) PF=Divide(LHSWorkspace=output6/output8,RHSWorkspace=PA, OutputWorkspace='PF_'+strname)

dehoni avatar Nov 07 '23 07:11 dehoni