Ticket #7829 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

New Algorithm: RadiusSum

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: major Milestone: Release 3.0
Component: SANS Keywords:
Cc: Blocked By:
Blocking: #4032, #8111, #8112 Tester: Samuel Jackson

Description

Sum of all the counts inside a ring against the scattering angle for each Radius.

Inputs:

  • Centre - position of the centre of the ring (2 or 3 coordinates)
  • MinRadius - distance between the centre and the inner circumference (default value = 0)
  • MaxRadius - distance between the centre and the outer circumference (default value = min(width, height)) / 2
  • NumBins - Number of slices to be taken. The total ring goes from MinRadio to MaxRadio, it will be sliced in NumBins rings, witdh equal to (MaxRadio-MinRadio)/NumBins
  • NormalizeByRadius – Boolean flag that indicates if the Summing for each ring should be divided by the Radius powered by NormalizationOrder
  • NormalizationOrder - – If 2, the normalization will be divided by the quadratic value of the ring for each radius.

For each pixel, the distance(pixel, centre) will be taken. If the distance(pixel,centre) is inside the interval [rMin,rMax] it is considered valid. Then, this distance will be used to define for which bin it belongs to. And each bin will accumulate the values.

Attachments

RadiusSumPicture.png (105.1 KB) - added by Gesner Passos 7 years ago.
19675_sans_2d.nxs (3.1 MB) - added by Gesner Passos 7 years ago.
RadiusSum.txt (2.8 KB) - added by Gesner Passos 7 years ago.
Wiki page that will be created by wiki_maker.py

Change History

Changed 7 years ago by Gesner Passos

comment:1 Changed 7 years ago by Gesner Passos

  • Status changed from new to inprogress

comment:2 Changed 7 years ago by Gesner Passos

  • Blocking 8111 added

comment:3 Changed 7 years ago by Gesner Passos

Creation of the RadiusSum algorithm

just execution of class_maker

re #7829

Changeset: e04fb8bb9c40464f195cc7b466b12a9480d93c82

comment:4 Changed 7 years ago by Gesner Passos

RadiusSum: Declaration of the options

Declare all the options for RadiusSum and use the setPropertiesSettings to allow the option NormalizationOrder to appear only when the NormalizeByRadius is selected.

re #7829

Changeset: 55129fb494714176b356b3f201ee4ce6781a81ba

comment:5 Changed 7 years ago by Gesner Passos

RadiusSum cache properties values

re #7829

Changeset: 4300e4316a20642f80a8bced3f62d57a79832afa

comment:6 Changed 7 years ago by Gesner Passos

Implementation of RingSum algorithm

re #7829

Changeset: cc6dae5355fe58bbefa16b248ab4ff6a8238a60c

comment:7 Changed 7 years ago by Gesner Passos

Implement Normalize by Radius

Reorganize and document the code as well.

re #7829

Changeset: 1587db59514e7db7a7ec0a8100882ddc903a8362

comment:8 Changed 7 years ago by Gesner Passos

Make some methods on RingProfileTest static to use in RadiusSumTest

re #7829

Changeset: 0b8044abc44b56e2f6787db8573dd261321471a7

comment:9 Changed 7 years ago by Gesner Passos

Describe the RadiusSum tests

creation of the unit test for radius sum

re #7829

Changeset: 72fc89abaa2673d42b9931877e1d8e1fe507fb7e

comment:10 Changed 7 years ago by Gesner Passos

RadiusSum unit test NormalizeByRadius

re #7829

Changeset: fb7087a1587683e6436963d79ffd45b7e6ccac01

comment:11 Changed 7 years ago by Gesner Passos

Conflicts in AlgorithmCMakeList.txt:

Code/Mantid/Framework/Algorithms/CMakeLists.txt

Occurred due to the removal of deprecated algorithms.

re #7829

Changeset: a80b8f12ea6d90291e8f2bfbd5c19f4a67ddc606

comment:12 Changed 7 years ago by Gesner Passos

RadiusSum include lacking file numeric

re #7829

Changeset: 355de3545ee81fc5d1d85ba88b1bb714f2b65833

comment:13 Changed 7 years ago by Gesner Passos

Remove c++11 features not supported in all compilers

re #7829

Changeset: ba04f031e2f4356691f3594f7f4c031d2ce093d4

comment:14 Changed 7 years ago by Gesner Passos

RadiusSum: include boost foreach

re #7829

Changeset: df3337bf44e79780455b5c422021cc1bb3e0b953

comment:15 Changed 7 years ago by Gesner Passos

RadiusSumTest Remove c++11 not supported

re #7829

Changeset: b8ce744dc210178bf1e13dae53cec51e5149aafc

comment:16 Changed 7 years ago by Gesner Passos

RadiusSumTest: change std::unique_ptr per boost::shared_ptr

Mac does not support std::unique_ptr (c++11)

re #7829

Changeset: b69ca5a6051c9ab2ef10aff690f07aa64fc2e20c

Changed 7 years ago by Gesner Passos

comment:17 Changed 7 years ago by Gesner Passos

Executing this

config['default.instrument'] = 'SANS2D'
config['datasearch.directories'] += ';/archive/ndxsans2d/Instrument/data/cycle_13_2/'
ws = LoadNexus('19675')
ws = CropWorkspace(ws, EndWorkspaceIndex=36871)
out_from_instrument = RadiusSum(ws,(-0.05355, -0.16575, 23.281),0.001,0.6, 40,True,2)

result in a spectrum, whose axis X is marked as Time-of-flight...

Fix it.

Last edited 7 years ago by Gesner Passos (previous) (diff)

comment:18 Changed 7 years ago by Gesner Passos

Tester: this script exercises the application of RadiusSum in images.

ws_im = LoadNexus('19675_sans_2d.nxs')
out_from_image = RadiusSum(ws_im, (0,0), 0.05,0.22,40,NormalizeByRadius=True,NormalizationOrder=2)
out_from_image_n = RadiusSum(ws_im, (0,0), 0.05,0.22,40)

And this, in workspaces attached to instruments:

config['default.instrument'] = 'SANS2D'
config['datasearch.directories'] += ';/archive/ndxsans2d/Instrument/data/cycle_13_2/'
ws = LoadNexus('19675')
ws = CropWorkspace(ws, EndWorkspaceIndex=36871)
out_from_instrument = RadiusSum(ws,(-0.05355, -0.16575, 23.281),0.01,0.8, 100,True,2)
out_from_instrument_n = RadiusSum(ws,(-0.05355, -0.16575, 23.281),0.01,0.8, 100)
Last edited 7 years ago by Gesner Passos (previous) (diff)

comment:19 Changed 7 years ago by Gesner Passos

Precede the previous scripts with

config['default.instrument'] = 'SANS2D'

comment:20 Changed 7 years ago by Gesner Passos

RadiusSum: Correct the unit for OutputWorkspace

It also add unit test for this feature.

re #7829

Changeset: df65506849065d7021b0d03f10adfc9d79285375

comment:21 Changed 7 years ago by Gesner Passos

  • Blocking 4032 added

comment:22 Changed 7 years ago by Gesner Passos

  • Blocking 8112 added

comment:23 Changed 7 years ago by Gesner Passos

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

comment:24 Changed 7 years ago by Nick Draper

  • Component changed from Framework to SANS

comment:25 Changed 7 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:26 Changed 7 years ago by Nick Draper

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Merge conflict in Algorithms/CMakeLists.txt

Please merge master into the branch and send for testing again

comment:27 Changed 7 years ago by Gesner Passos

  • Status changed from reopened to inprogress

Merge remote-tracking branch 'origin/master' into re #7829

Conflicts:

Code/Mantid/Framework/Algorithms/CMakeLists.txt

Changeset: 6c8007ea01d32ebef74fa0d877140bfbc1d2b3bc

comment:28 Changed 7 years ago by Gesner Passos

Merge branch 'feature/7829_radius_sum' into develop

Conflicts:

Code/Mantid/Framework/Algorithms/CMakeLists.txt

re #7829

Changeset: 88dd0e68c91e548a76f50e857a960f512bee4506

comment:29 Changed 7 years ago by Gesner Passos

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

comment:30 Changed 7 years ago by Samuel Jackson

  • Status changed from verify to verifying
  • Tester changed from Nick Draper to Samuel Jackson

comment:31 Changed 7 years ago by Samuel Jackson

  • Status changed from verifying to reopened
  • Resolution fixed deleted

Seems to work fine, but this fails a code inspection due to the algorithm having no wiki documentation. Fix and I'd be happy to verify.

comment:32 Changed 7 years ago by Gesner Passos

  • Status changed from reopened to inprogress

re #7829: RadiusSum wiki documentation

Changeset: 03dcc41f0c0b36061636f953c0268b5200029c9b

Changed 7 years ago by Gesner Passos

Wiki page that will be created by wiki_maker.py

comment:33 Changed 7 years ago by Gesner Passos

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

Tester:

Go to the link www.mantidproject.org/RadiusSum, and copy the content of RadiusSum.txt to our wiki, and select the preview, to see how the algorithm will be shown in the wiki after being parsed the the wiki_maker jenkins job.

comment:34 Changed 7 years ago by Samuel Jackson

  • Status changed from verify to verifying

comment:35 Changed 7 years ago by Samuel Jackson

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7829_radius_sum'

Full changeset: f0b7cadc03b7922eb2a5f9d28797cba6dfa7bfe6

comment:36 Changed 7 years ago by Samuel Jackson

Already tested algorithm and documentation now looks good.

comment:37 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8674

Note: See TracTickets for help on using tickets.