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

FindDeadDetectors v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Identifies and flags empty spectra caused by ‘dead’ detectors.

See Also

FindDetectorsOutsideLimits, DetectorDiagnostic

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Name of the input workspace

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Each histogram from the input workspace maps to a histogram in this workspace with one value that indicates if there was a dead detector

DeadThreshold

Input

number

0

The threshold against which to judge if a spectrum belongs to a dead detector

LiveValue

Input

number

0

The value to assign to an integrated spectrum flagged as ‘live’ (default 0.0)

DeadValue

Input

number

100

The value to assign to an integrated spectrum flagged as ‘dead’ (default 100.0)

RangeLower

Input

number

Optional

No bin with a boundary at an x value less than this will be used in the summation that decides if a detector is ‘dead’ (default: the start of each histogram)

RangeUpper

Input

number

Optional

No bin with a boundary at an x value higher than this value will be used in the summation that decides if a detector is ‘dead’ (default: the end of each histogram)

OutputFile

Input

string

A filename to which to write the list of dead detector UDETs

FoundDead

Output

int list

Description

This is then used to mark all ‘dead’ detectors with a ‘dead’ marker value, while all spectra from live detectors are given a ‘live’ marker value.

This algorithm is primarily used to ease identification using the instrument visualization tools.

ChildAlgorithms used

Uses the Integration v1 algorithm to sum the spectra.

Usage

Example - Find various dead detectors

import numpy as np

ws = CreateSampleWorkspace(BinWidth=2000)
#set some detectors as dead
#First - very dead all bins have zero counts
vd_data=[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
ws.setY(10,np.array(vd_data))
#second - drop off some counts, then drops to 0
do_data=[2.0,5.0,4.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0]
ws.setY(15,np.array(do_data))
#third strange some counts, then drops to 0, then recovers
str_data=[0.4,5.0,0.001,0.0,0.0,0.0,0.0,0.0,1.0,1.0]
ws.setY(20,np.array(str_data))

print("With no range will find very dead")
(wsOut,detList) = FindDeadDetectors(ws)
print(detList)

print("\nwith a lower range will find very dead and drop off")
(wsOut,detList) = FindDeadDetectors(ws,RangeLower=8e3)
print(detList)

print("\nwith a lower range and upper range will find all three")
(wsOut,detList) = FindDeadDetectors(ws,RangeLower=8e3, rangeUpper=1.6e4)
print(detList)

Output:

With no range will find very dead
[110]

with a lower range will find very dead and drop off
[110,115]

with a lower range and upper range will find all three
[110,115,120]

Categories: AlgorithmIndex | Diagnostics

Source

C++ header: FindDeadDetectors.h

C++ source: FindDeadDetectors.cpp