MedianDetectorTest

From MantidProject

Jump to: navigation, search

Contents

Summary

Indentifies histograms that contain a total number of counts a long way from the median total counts in histograms in that workspace.

Properties

Order Name Direction Type Default Description
1 InputWorkspace Input Workspace Mandatory Name of the input workspace
2 OutputWorkspace Input Workspace Mandatory Each histogram from the input workspace maps to a histogram in this workspace that has just one value which indicates if there was a bad detector
3 SignificanceTest Input double 3.3 Set this to a nonzero value and detectors in spectra with a total number of counts within this number of standard deviations from the median will not be labelled bad
4 LowThreshold Input double 0.1 Detectors corresponding to spectra with total counts equal to or less than this proportion of the median will be identified as reading badly
5 HighThreshold Input double 1.5 Detectors corresponding to spectra with total counts equal to or more than this number of medians will be identified as reading badly
6 StartWorkspaceIndex Input integer 0.0 The index number of the first spectrum to include in the calculation
7 EndWorkspaceIndex Input integer Last histogram in the workspace The index number of the last spectrum to include in the calculation
8 RangeLower Input double The start of each histogram No bin with a boundary at an x value less than this will be included in the summation used to decide if a detector is 'bad'
9 RangeUpper Input double The end of each histogram No bin with a boundary at an x value higher than this value will be included in the summation used to decide if a detector is 'bad'
10 OutputFile Output string No file output A filename to which to write the list of dead detector UDETs
11 GoodValue Input double 0.0 For each input workspace spectrum that passes write this flag value to the equivalent spectrum in the output workspace
12 BadValue Input double 100.0 For each input workspace spectrum that fails write this flag value to the equivalent spectrum in the output workspace
13 BadSpectraNums Output integer list Not available in MantidPlot The list of specta numbers that failed this test

Description

If instrument geometry information is available the SolidAngle algorithm is used to calculate the number of counts per unit solid angle, otherwise numbers of counts are used without correction. First the median number of counts in all the bins is calculated. Then the ratio of the total number of counts and the median number is calculated for each histogram. This ratio is compared against the user defined upper and lower thresholds and if the ratio is outside the limits the statistical significance test is done.

In the statistical significance test the difference between the number of counts in each spectrum and the median number is compared to the spectrum's error value. Any spectra where the ratio of the its deviation from the mean and the its error is less than the value of the property SignificanceTest will not be labelled bad. This test is particularly important when the number of counts is low, for example when examining the low count "background" parts of spectra.

The output workspace contains single bin histograms with a value of 100 where the input histogram with the same spectrum index fails and 0 where it passes. The detector IDs of all detectors associated with failing histograms are listed in the output array. The output file contains spectrum numbers and detector IDs for those histograms. Histograms associated with detectors that were already marked bad in the input workspace are listed as bad in the output workspace, file and array and are not included in any of the calculations.


Subalgorithms used

Uses the SolidAngle, Integration and ConvertToDistribution algorithms.

Source Code

Header MedianDetectorTest.h

Source MedianDetectorTest.cpp

Personal tools
Create a book