Ticket #10577 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Create base implementation for PhaseQuad algorithm

Reported by: Raquel Alvarez Banos Owned by: Raquel Alvarez Banos
Priority: major Milestone: Release 3.3
Component: Muon Keywords:
Cc: federico.montesino-pouzols@… Blocked By:
Blocking: #10498 Tester: Federico M Pouzols

Description

Create base implementation for PhaseQuad algorithm as described in ticket #10498:

  • Write algorithm to create two scpectra from input workspace and phase table
  • Add unit test
  • Create .rst file and usage example

Attachments

MUSR00041779.nxs (654.8 KB) - added by Raquel Alvarez Banos 6 years ago.
MUSR00041780.nxs (654.5 KB) - added by Raquel Alvarez Banos 6 years ago.
MUSR00041781.nxs (655.9 KB) - added by Raquel Alvarez Banos 6 years ago.
HISSDATA.INF (2.6 KB) - added by Raquel Alvarez Banos 6 years ago.

Change History

comment:1 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Cleanning PhaseQuad and adding unit test

Changeset: a09f1940df45a9683957a4ee32a1265b4d045dc2

comment:2 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 docs-test and algorithm updates

Changeset: a9a23d7a049a5514cc0d7c3eb223c2efb041e3ca

comment:3 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Remove unnecessary includes

Changeset: f6dc876fd08b1d90450b94a5e76f2169b1cf5b37

comment:4 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Fixing compiler warnings and cppcheck error

Changeset: a15ed0ad3d68742db3acbb4bb26b266d38bda8b4

comment:5 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Fixing more compiler warnings

Changeset: 72ad4b04c459ea431061344b27f2db22d9094b46

Changed 6 years ago by Raquel Alvarez Banos

Changed 6 years ago by Raquel Alvarez Banos

Changed 6 years ago by Raquel Alvarez Banos

Changed 6 years ago by Raquel Alvarez Banos

comment:6 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Added optional Phase Table to load histogram info

Changeset: 8b62a9011d9d8eb497ce8e029830c6bf0705a417

comment:7 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Fixing doxygen_develop warning

Changeset: 5bd8d9933bd5183ec8b2748f366323ba31199d6c

comment:8 Changed 6 years ago by Raquel Alvarez Banos

Re #10577 Remove old PhaseQuadMuon-v1.rst

Changeset: 6417e4da9741b9544556f38338c34ce3036b3548

comment:9 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from new to assigned

comment:10 Changed 6 years ago by Raquel Alvarez Banos

  • Status changed from assigned to verify
  • Cc anders.markvardsen@… added
  • Resolution set to fixed

To test:

  • Check PhaseQuadMuon.cpp, PhaseQuadMuon.h, PhaseQuadMuonTest.h and PhaseQuad-v1.rst. Check code, variable names and types, methods, etc. These will be the base structure for ticket #10498
  • Check PhaseQuad algorithm:
    1. Open a muon dataset, for instance one of the nexus files attached in this ticket
    2. Run PhaseQuad. You should be required to provide an input and output workspace. Properties PhaseTable and PhaseList are optional, but one of them must be provided.
    3. Try using HISSDATA.INF (attached) as PhaseList input. A workspace with two spectra should be created.
    4. Try using a TableWorkspace as PhaseInput. A workspace with two spectra should be created.
  • Check unit test code
  • Check .rst file and usage example

comment:11 Changed 6 years ago by Federico M Pouzols

  • Status changed from verify to verifying
  • Tester set to Federico M Pouzols

comment:12 Changed 6 years ago by Federico M Pouzols

  • Status changed from verifying to closed

This looks like a good solid base implementation. The class declarations seem fine, documented, and follow the Mantid common practices. There are some TODO that will be sorted out, as there still seem to be a few question marks as to how the algorithm will work in the end.

The example runs work well and I get the output workspace with two spectra. Are those numbered 1-2 instead of 0-1 for any particular reason? The algorithm also handles wrong files or missing phase table/list correctly. The new test passes.

I only spotted a few very minor details that can be fixed when working on the follow-up tickets:

  • PhaseQuadMuon.h: the @date tag and &copy years are a bit old/odd.
  • PhaseQuadMuon.cpp: tab issue, line 45
  • in the tests, the filename string "TestPhaseList.txt" is used at least a couple of times. I'd suggest making it a const string variable.

Also, the test loads and writes files. Is there any createWorkspace helper that could be used here? If not, would it make sense to add a new one for this type of algorithm? If this is not feasible or too complex for muon data files, I'd at least keep the phase list/table as a string in memory (for the tests).

comment:13 Changed 6 years ago by Federico Montesino Pouzols

Merge remote-tracking branch 'origin/feature/10577_PhaseQuad_base_implementation'

Full changeset: bc0d21c33687c13832e7ba2573204ee146cdfb14

comment:14 Changed 6 years ago by Raquel Alvarez Banos

  • Cc federico.montesino-pouzols@… added; anders.markvardsen@… removed

Hi Federico,

thanks for your suggestions. Regarding the workspace numbering, as far as I have seen, spectra are numbered from 1 to N, whereas workspace indices range from 0 to N-1 (but please, let me know if I am wrong).

I have uploaded the code according to your suggestions, however, the unit tests still load the muon dataset. The reason is that muon datasets are small in comparison to other datasets, and as far as I know, other unit tests (see for instance ApplyDeadTimeCorrTest.h) also load the data.

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11419

Note: See TracTickets for help on using tickets.