Ticket #1675 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Normalise SANS data to the detector flood source file

Reported by: Steve Williams Owned by: Steve Williams
Priority: blocker Milestone: Iteration 25
Component: Mantid Keywords:
Cc: martyn.gigg@… Blocked By:
Blocking: Tester: Michael Whitty

Description

In summary:

  • The CorrectToFile algorithm needs to be modified to normalise spectra
  • The user file needs to parse command containing the name of the file
  • The GUI needs to read this value, allow it, to be changed and allow disabling the this normalisation

Below is Steve King's original request for normalisation to the detector flood source file:

Hi Nick,

Sorry, I thought Richard had already given Russell this information!

So any SANS run (sample, or can, [or background]) needs to have every main detector spectrum divided (we think… been a long time…but changing an operator is at least trivial!) by the corresponding value in the flat cell file BEFORE any data reduction takes place.  So the operation needs to happen somewhere between reading each SANS run in and calling 1D_Reduce (or whatever it’s called).

You will have noticed that the values in the file are generally around 1 apart from a few outliers and things like S1 & S2 (which on LOQ are the monitors).

We would like a check box on the GUI to be able to turn this feature off/on.

So, I don’t think it’s too big a  job?

Thanks,
Steve


From: Draper, Nick (-,RAL,ISIS) 
Sent: 16 September 2010 17:11
To: King, Stephen (STFC,RAL,ISIS)
Subject: RE: [Mantid-help] New feature in SANS GUI - 5

Steve,

By normalize here do you just mean divide the sample data by?

Regards,
Nick Draper

From: mantid-help-bounces@mantidproject.org [mailto:mantid-help-bounces@mantidproject.org] On Behalf Of stephen.king@stfc.ac.uk
Sent: 15 September 2010 15:47
To: Mantid Help
Cc: King, Stephen (STFC,RAL,ISIS)
Subject: [Mantid-help] New feature in SANS GUI - 5

Richard asks me to remind you that at present the SANS reduction (LOQ or SANS2D) in Mantid, unlike COLETTE, makes no attempt to normalize the data to the detector flood source file.
In a COLETTE mask file this is instigated by the command:

MON/FLAT=LOQ$DISK0:[LOQMGR.EFFIC]FLAT_CELL.061

Note that this file must have an entry for each spectrum, hence one for SANS2D will be a lot bigger than the LOQ one attached.

This would be higher priority for us than, say, multiple scattering corrections.

Thanks,
Steve

Change History

comment:1 Changed 10 years ago by Steve Williams

  • Status changed from new to accepted

Updating the algorithm and writing tests 4 hours Writing the Python code to parse the user file 1 hour Updating the GUI 2 hours Update systems test 0.5 hours

Total 7.5 hours

comment:2 Changed 10 years ago by Martyn Gigg

Time estimate, M. Gigg: I agree that most of the work should be in modifying the algorithm so I think 4 hours is fair for that. I think 30mins mis enough to update the mask file reading to grab the name of the flat cell file, most of the code for reading is already there. I think the GUI update should be only an hour mask as it's simply a new line edit and check box. Total 6 hours

comment:3 Changed 10 years ago by Martyn Gigg

  1. Gigg. In light of small issues found with the file finder I would add an extra 1.5 hours on to the estimate, which includes testing.

comment:4 Changed 10 years ago by Steve Williams

(In [6536]) Correct to file has been extended to take a file that contains the correction factors to apply to each spectrum re #1675

comment:5 Changed 10 years ago by Steve Williams

(In [6540]) DoxyGen fix re #1675

comment:6 Changed 10 years ago by Steve Williams

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

comment:7 Changed 10 years ago by Steve Williams

  • Status changed from verify to reopened
  • Resolution fixed deleted

comment:8 Changed 10 years ago by Steve Williams

(In [6649]) Fix SANS system tests that were broken when correct to file was turned on re #1675

comment:9 Changed 10 years ago by Steve Williams

  • Status changed from reopened to accepted

comment:10 Changed 10 years ago by Steve Williams

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

To the tester, The functionality that I added is described below:

Dear All,
   The Mantid download currently on the server includes a flood file correction. Any user files that already contain the string MON/FLAT= will now trigger the correction and you can also configure things in the GUI, at the bottom of the "Analysis Details" tab. 

Those using Python can use SetDetectorFloodFile(filename) and it's possible to apply the correction to an arbitrary workspace using the algorithm CorrectToFile (FirstColumnValue="SpectrumNumber").

Regards,
Steve

comment:11 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:12 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to verify
  • Tester Martyn Gigg deleted

comment:13 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:14 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

The LOQ analysis can't be run from the GUI. It gives a script error saying

SyntaxError: "EOL while scanning single-quoted string" 

comment:15 Changed 10 years ago by Martyn Gigg

  • Priority changed from major to blocker

comment:16 Changed 10 years ago by Steve Williams

  • Status changed from reopened to accepted

comment:17 Changed 10 years ago by Steve Williams

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

comment:18 Changed 10 years ago by Martyn Gigg

  • Status changed from verify to verifying

comment:19 Changed 10 years ago by Martyn Gigg

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Now a problem with running a data reduction twice. It falls over the second time saying it can't crop the workspace.

comment:20 Changed 10 years ago by Steve Williams

  • Status changed from reopened to accepted
  • Milestone changed from Iteration 25 to Iteration 26

comment:21 Changed 10 years ago by Steve Williams

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

comment:22 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 26 to Iteration 25

comment:23 Changed 10 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Tester changed from Martyn Gigg to Michael Whitty

comment:24 Changed 10 years ago by Michael Whitty

  • Status changed from verifying to closed

I've ran this with and without the "Apply flood correction file" ticked on LOQ, the resulting workspaces are slightly different by something approaching +-10% which would seem to be in line with what I understand this corection to be doing. The "with" calls CorrectToFile while without doesn't, so I'm confident that some correction is being applied (tested in [7215])

comment:25 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2522

Note: See TracTickets for help on using tickets.