Ticket #5368 (assigned)
exposing python to method for converting between SpecNum, WI and detID
Reported by: | Anders Markvardsen | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
MatrixWorkspace class has various method for converting between SpecNum, WI and detID including:
size_t getIndexFromSpectrumNumber (const specid_t specNo) const
Given a spectrum number, find the corresponding workspace index.
void getIndicesFromDetectorIDs (const std::vector< detid_t > &detIdList, std::vector< size_t > &indexList) const
Converts a list of detector IDs to the corresponding workspace indices.
void getIndicesFromSpectra (const std::vector< specid_t > &spectraList, std::vector< size_t > &indexList) const
Converts a list of spectrum numbers to the corresponding workspace indices.
virtual void getIntegratedSpectra (std::vector< double > &out, const double minX, const double maxX, const bool entireRange) const
Return a vector with the integrated counts for all spectra withing the given range.
spec2index_map * getSpectrumToWorkspaceIndexMap () const
Return a map where: KEY is the Spectrum # VALUE is the Workspace Index.
void getSpectrumToWorkspaceIndexVector (std::vector< size_t > &out, specid_t &offset) const
Return a vector where: The index into the vector = spectrum number + offset The value at that index = the corresponding Workspace Index.
index2detid_map * getWorkspaceIndexToDetectorIDMap () const
Return a map where: KEY is the Workspace Index VALUE is the DetectorID (pixel ID).
index2spec_map * getWorkspaceIndexToSpectrumMap () const
Return a map where: KEY is the Workspace Index VALUE is the Spectrum #.
Some of these method are not in a 'convenient' (not 100% sure if this is the right work for it) state to be exposed to python.
Purpose of this ticket is to expose some C++ methods to python which allow for the convertion between SpecNum, WI and detID
Change History
comment:2 Changed 8 years ago by Nick Draper
- Milestone changed from Release 2.3 to Release 2.4
Moved to milestone 2.4
comment:5 Changed 7 years ago by Martyn Gigg
- Milestone changed from Release 2.6 to Release 2.7
Batch move to 2.7
Moved at the end of release 2.2