FindDetectorsOutsideLimits v1

../_images/FindDetectorsOutsideLimits-v1_dlg.png

FindDetectorsOutsideLimits dialog.

Summary

Identifies histograms and their detectors that have total numbers of counts over a user defined maximum or less than the user define minimum.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory Name of the input workspace2D
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
HighThreshold Input number Optional Spectra whose total number of counts are equal to or above this value will be marked bad (default off)
LowThreshold Input number 0 Spectra whose total number of counts are equal to or below this value will be marked bad (default 0)
StartWorkspaceIndex Input number 0 The index number of the first spectrum to include in the calculation (default 0)
EndWorkspaceIndex Input number Optional The index number of the last spectrum to include in the calculation (default the last histogram)
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 ‘bad’ (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 ‘bad’ (default: the end of each histogram)
NumberOfFailures Output number    

Description

This is intended to identify detectors that are grossly over or under counting. It reads the input workspace and identifies all histograms with numbers of counts outside the user defined upper and lower limits. Each spectra that fails has its spectra masked on the output workspace. Spectra that pass the test have their data set to a positive value, 1.0. The output workspace can be fed to MaskDetectors v1 to mask the same spectra on another workspace.

ChildAlgorithms used

Uses the Integration v1 algorithm to sum the spectra.

Usage

Example:

import numpy as np
ws = CreateSampleWorkspace(BankPixelWidth=10,NumBanks=1)

#create dome dead and noisy detectors
deadDetArray=[0.0] * ws.blocksize()
noisyDetArray= [100.0] * ws.blocksize()

for i in range(0,ws.getNumberHistograms(),5):
    ws.setY(i,np.array(deadDetArray))
    ws.setY(i+1,np.array(noisyDetArray))

print "With just the default LowThreshold of 0"
(wsOut,NumberOfFailures)=FindDetectorsOutsideLimits(ws)
print "%i spectra were outside the limits." % NumberOfFailures
print

print "With a High and LowThreshold, as well as restricting the XRange to consider"
(wsOut2,NumberOfFailures)=FindDetectorsOutsideLimits(ws, HighThreshold=1000,
    LowThreshold=0, RangeLower=200, RangeUpper=10000)
print "%i spectra were outside the limits." % NumberOfFailures

mtd.clear()

Output:

With just the default LowThreshold of 0
20 spectra were outside the limits.

With a High and LowThreshold, as well as restricting the XRange to consider
40 spectra were outside the limits.

Categories: Algorithms | Diagnostics