Ticket #3203 (closed: fixed)
Implement a Spectra class with an ISpectra interface
Reported by: | Martyn Gigg | Owned by: | Janik Zikovsky |
---|---|---|---|
Priority: | major | Milestone: | Iteration 30 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | #3300 | |
Blocking: | Tester: | Roman Tolchenov |
Description
In algorithms we frequently use the workspace index to access many things about a spectra and reuse the index a lot. A cleaner approach would be to have a spectra promoted to a class-level concept so that ws->getSpectrum(i) would return an object that has a reference to the workspace and the current index and could then access everything without the need for remembering the index.
It should have an interface so that the EventList can implement it as this is a broadly similar concept.
Change History
comment:2 Changed 9 years ago by Janik Zikovsky
- Status changed from new to accepted
- Owner set to Janik Zikovsky
comment:4 Changed 9 years ago by Janik Zikovsky
(In [13047]) - Refs #3203: Implemented ISpectrum. It is the base class of EventList and Histogram and contains the spectrum number and list of detector IDs for a given spectrum.
- ISpectrum return X/Y/E vectors. EventList, e.g. calculates the histogram on the fly.
- Moved the EventWorkspace MRU list of histograms to be contained within the EventList; better code separation. Made a EventWorkspaceMRU class to encapsulate this more easily.
- Workspaces must implement getSpectrum (const/not const) to return a ISpectrum object. dataX(i), etc. methods on MatrixWorkspaces no longer need to be overridden since they call getSpectrum()
- Got rid of EventWorkspace::getEventListatPixelID() and doneLoadingData()
- replaceSpectraMap() methods offers backwards-compatibility with SpectraDetectorMaps by setting the specNo and detector list when called. Must be called AFTER creating all the spectra in a workspace.
- Refs #3318: maskWorkspaceIndex() implemented as part of ISpectrum.
comment:10 Changed 9 years ago by Russell Taylor
Janik - please can you find a way to eliminate the following Intel compiler warnings, which (because of the classes they come from) appear many times in the Mac build:
EventList.h:67, Intel, Priority: Normal
overloaded virtual function "Mantid::API::ISpectrum::dataX" is only partially overridden in class "Mantid::DataObjects::EventList"
EventList.h:67, Intel, Priority: Normal
overloaded virtual function "Mantid::API::ISpectrum::setX" is only partially overridden in class "Mantid::DataObjects::EventList"
EventWorkspace.h:47, Intel, Priority: Normal
overloaded virtual function "Mantid::API::MatrixWorkspace::setX" is only partially overridden in class "Mantid::DataObjects::EventWorkspace"
comment:11 Changed 9 years ago by Janik Zikovsky
In [13129]:
comment:12 Changed 9 years ago by Janik Zikovsky
In [13245]:
comment:13 Changed 9 years ago by Janik Zikovsky
In [13247]:
comment:14 Changed 9 years ago by Janik Zikovsky
In [13251]:
comment:15 Changed 9 years ago by Janik Zikovsky
In [13252]:
comment:16 Changed 9 years ago by Janik Zikovsky
In [13253]:
comment:17 Changed 9 years ago by Janik Zikovsky
In [13254]:
comment:18 Changed 9 years ago by Janik Zikovsky
In [13255]:
comment:19 Changed 9 years ago by Janik Zikovsky
In [13256]:
comment:20 Changed 9 years ago by Janik Zikovsky
In [13257]:
comment:21 Changed 9 years ago by Janik Zikovsky
In [13414]:
comment:22 Changed 9 years ago by Mathieu Doucet
In [13435]:
comment:23 Changed 9 years ago by Janik Zikovsky
In [13534]:
comment:12 Changed 9 years ago by Janik Zikovsky
In [13536]:
comment:13 Changed 9 years ago by Janik Zikovsky
In [13555]:
comment:14 Changed 9 years ago by Janik Zikovsky
In [13558]:
comment:15 Changed 9 years ago by Janik Zikovsky
- Status changed from accepted to verify
- Resolution set to fixed
spectraMap() is very nearly gone. Nick says he wants to leave it for a little while, but it is called exactly twice in all the code.
comment:16 Changed 9 years ago by Russell Taylor
In [13584]:
comment:17 Changed 9 years ago by Russell Taylor
In [13598]:
comment:18 Changed 9 years ago by Janik Zikovsky
In [13677]:
comment:19 Changed 9 years ago by Martyn Gigg
In [13678]:
comment:20 Changed 9 years ago by Vickie Lynch
In [13679]:
comment:21 Changed 9 years ago by Roman Tolchenov
- Status changed from verify to verifying
- Tester set to Roman Tolchenov
comment:22 Changed 9 years ago by Roman Tolchenov
- Status changed from verifying to closed
Confirm implementation of ISpectra
comment:23 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 4050
"New" tickets moved at the code freeze of iteration 29