Ticket #5368 (assigned)

Opened 8 years ago

Last modified 5 years ago

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:1 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.2 to Release 2.3

Moved at the end of release 2.2

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:3 Changed 8 years ago by Martyn Gigg

  • Milestone changed from Release 2.4 to Release 2.5

comment:4 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:5 Changed 7 years ago by Martyn Gigg

  • Milestone changed from Release 2.6 to Release 2.7

Batch move to 2.7

comment:6 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.7 to Backlog

comment:7 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:8 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

Bulk move to assigned at the introduction of the triage step

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6214

Note: See TracTickets for help on using tickets.