\(\renewcommand\AA{\unicode{x212B}}\)

CreateDetectorTable v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Create a table showing detector information for the given workspace and optionally the data for that detector

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace

Mandatory

The name of the workspace to take as input.

WorkspaceIndices

Input

int list

If left empty then all workspace indices are used.

IncludeData

Input

boolean

False

Include the first value from each spectrum.

DetectorTableWorkspace

Output

TableWorkspace

The name of the outputted detector table workspace, if left empty then the input workspace name + “-Detectors” is used.

Description

Creates a table workspace of detector information for a given matrix or peaks workspace.

Usage

Example

ws = CreateSampleWorkspace()

ws_detectors = CreateDetectorTable(ws)

# Print the first row of the table
first_row = ws_detectors.row(0)
print("Index: {0}, Spectrum No: {1}, Detector ID: {2}, R: {3}, Theta: {4}, Phi: {5}, Monitor: {6}".format(
      first_row['Index'],
      first_row['Spectrum No'],
      first_row['Detector ID(s)'],
      first_row['R'],
      first_row['Theta'],
      first_row['Phi'],
      first_row['Monitor']))

Output:

Index: 0.0, Spectrum No: 1, Detector ID: 100, R: 5.0, Theta: 0.0, Phi: 0.0, Monitor: no

Categories: AlgorithmIndex | Utility\Workspaces

Source

C++ header: CreateDetectorTable.h

C++ source: CreateDetectorTable.cpp