git-svn-id: https://subversion.xor.aps.anl.gov/synApps/areaDetector/trunk@14479 dc6c5ff5-0b8b-c028-a01f-ffb33f00fc8b
999 lines
28 KiB
HTML
Executable File
999 lines
28 KiB
HTML
Executable File
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<title>areaDetector Plugin NDPluginStats</title>
|
|
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
|
|
</head>
|
|
<body>
|
|
<div style="text-align: center">
|
|
<h1>
|
|
areaDetector Plugin NDPluginStats</h1>
|
|
<h2>
|
|
February 12, 2012</h2>
|
|
<h2>
|
|
Mark Rivers</h2>
|
|
<h2>
|
|
University of Chicago</h2>
|
|
</div>
|
|
<h2>
|
|
Contents</h2>
|
|
<ul>
|
|
<li><a href="#Overview">Overview</a></li>
|
|
<li><a href="#Configuration">Configuration</a></li>
|
|
<li><a href="#Screens">Screen shots</a></li>
|
|
</ul>
|
|
<h2 id="Overview">
|
|
Overview
|
|
</h2>
|
|
<p>
|
|
NDPluginStats computes the following.
|
|
</p>
|
|
<ol>
|
|
<li>Basic statistics: minimum, maximum, mean, sigma, total, and net (background subtracted).</li>
|
|
<li>Centroid and sigma values in the X and Y dimensions.</li>
|
|
<li>Profiles of the array in the X and Y dimensions. A total of 8 profiles are calculated:
|
|
<ul>
|
|
<li>The average profiles in the X and Y directions. </li>
|
|
<li>The average profiles in the X and Y directions, for array elements greater than
|
|
the centroid threshold.</li>
|
|
<li>The profiles in the X and Y directions at the X and Y centroid position.</li>
|
|
<li>The profiles in the X and Y directions at a user-defined X and Y cursor position.</li>
|
|
</ul>
|
|
</li>
|
|
<li>A histogram of the values (e.g. number of pixels versus intensity per pixel).</li>
|
|
</ol>
|
|
<p>
|
|
Each calculcation can independently enabled and disabled. Calculations 1 and 4 can
|
|
be perfomed on arrays of any dimension. Calculations 2 and 3 are restricted to 2-D
|
|
arrays.
|
|
</p>
|
|
<p>
|
|
Time-series arrays of the basic statistics, centroid and sigma statistics can also
|
|
be collected. This is very useful for on-the-fly data acquisition, where the NDStats
|
|
plugin computes the net or total counts in the detector or an ROI. It can also be
|
|
used to quickly plot a time-history of beam position or width, etc.</p>
|
|
<p>
|
|
NDPluginStats inherits from NDPluginDriver. The <a href="areaDetectorDoxygenHTML/class_n_d_plugin_stats.html">
|
|
NDPluginStats class documentation</a> describes this class in detail.
|
|
</p>
|
|
<p>
|
|
NDPluginStats.h defines the following parameters. It also implements all of the
|
|
standard plugin parameters from <a href="pluginDoc.html#NDPluginDriver">NDPluginDriver</a>.
|
|
The EPICS database NDStats.template provide access to these parameters, listed in
|
|
the following table. Note that to reduce the width of this table the parameter index
|
|
variable names have been split into 2 lines, but these are just a single name, for
|
|
example <code>NDPluginStatsComputeStatistics</code>.
|
|
</p>
|
|
<table border="1" cellpadding="2" cellspacing="2" style="text-align: left">
|
|
<tbody>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>Parameter Definitions in NDPluginStats.h and EPICS Record Definitions in NDStats.template</b>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th>
|
|
Parameter index variable</th>
|
|
<th>
|
|
asyn interface</th>
|
|
<th>
|
|
Access</th>
|
|
<th>
|
|
Description</th>
|
|
<th>
|
|
drvInfo string</th>
|
|
<th>
|
|
EPICS record name</th>
|
|
<th>
|
|
EPICS record type</th>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>Basic statistics</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ComputeStatistics</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Flag to control whether to compute statistics for this array (0=No, 1=Yes). Not
|
|
computing statistics reduces CPU load. Basic statistics computations are quite fast,
|
|
since they involve mostly double precision addition, with 1 multiply to compute
|
|
sigma, per array element.</td>
|
|
<td>
|
|
COMPUTE_STATISTICS</td>
|
|
<td>
|
|
$(P)$(R)ComputeStatistics<br />
|
|
$(P)$(R)ComputeStatistics_RBV</td>
|
|
<td>
|
|
bo<br />
|
|
bi</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
BgdWidth</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Width of the background in pixels to use when computing net counts. 0=no background
|
|
subtraction, so the net counts is the same as the total counts.</td>
|
|
<td>
|
|
BGD_WIDTH</td>
|
|
<td>
|
|
$(P)$(R)BgdWidth<br />
|
|
$(P)$(R)BgdWidth_RBV</td>
|
|
<td>
|
|
longout<br />
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
MinValue</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Minimum value in any element in the array</td>
|
|
<td>
|
|
MIN_VALUE</td>
|
|
<td>
|
|
$(P)$(R)MinValue_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
MaxValue</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Maximum value in any element in the array</td>
|
|
<td>
|
|
MAX_VALUE</td>
|
|
<td>
|
|
$(P)$(R)MaxValue_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
MeanValue</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Mean value in the array</td>
|
|
<td>
|
|
MEAN_VALUE</td>
|
|
<td>
|
|
$(P)$(R)MeanValue_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
Total</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Sum (total) of all elements in the array. This is available as an ai record. The
|
|
total counts are also available as epicsInt32 values in an mca record via callbacks
|
|
to the drvFastSweep driver. The mca record is very useful for on-the-fly data acquisition
|
|
of the total counts in the detector or in an ROI.</td>
|
|
<td>
|
|
TOTAL</td>
|
|
<td>
|
|
$(P)$(R)Total_RBV<br />
|
|
$(P)$(R)TotalArray</td>
|
|
<td>
|
|
ai<br />
|
|
mca</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
Net</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Net (background subtracted) total of all elements in the array. The background is
|
|
calculated by determining the average counts per array element in a border around
|
|
the array of width NDPluginStatsBgdWidth. This average background counts per element
|
|
is then subtracted from all elements inside the array. If NDPluginStatsBgdWidth
|
|
is ≤ 0 then no background is computed. The net counts is available as an ai record.
|
|
The net counts is also available as epicsInt32 values in an mca record via callbacks
|
|
to the drvFastSweep driver. The mca record is very useful for on-the-fly data acquisition
|
|
of the net counts in the detector or in an ROI. </td>
|
|
<td>
|
|
NET</td>
|
|
<td>
|
|
$(P)$(R)Net_RBV<br />
|
|
$(P)$(R)NetArray</td>
|
|
<td>
|
|
ai<br />
|
|
mca</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
SigmaValue</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Sigma (standard deviation) of all elements in the array</td>
|
|
<td>
|
|
SIGMA_VALUE</td>
|
|
<td>
|
|
$(P)$(R)Sigma_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>Centroid statistics</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ComputeCentroid</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Flag to control whether to compute the centroid statistics (0=No, 1=Yes). The centroids
|
|
are computed from the average row and column profiles above the centroid threshold.
|
|
These calculations are also quite fast, since they just involve addition operations
|
|
for each array element.</td>
|
|
<td>
|
|
COMPUTE_CENTROID</td>
|
|
<td>
|
|
$(P)$(R)ComputeCentroid<br />
|
|
$(P)$(R)ComputeCentroid_RBV</td>
|
|
<td>
|
|
bo<br />
|
|
bi</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
CentroidThreshold</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Threshold used when computing the centroid statistics. All array elements less than
|
|
this value are set to 0 for computing the centroid statistics. It is important to
|
|
set this value to ignore the "background" when computing the position and size of
|
|
a "beam" image, for example.</td>
|
|
<td>
|
|
CENTROID_THRESHOLD</td>
|
|
<td>
|
|
$(P)$(R)CentroidThreshold<br />
|
|
$(P)$(R)CentroidThreshold_RBV</td>
|
|
<td>
|
|
ao<br />
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
CentroidX</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
X centroid of the array above the centroid threshold.</td>
|
|
<td>
|
|
CENTROIDX_VALUE</td>
|
|
<td>
|
|
$(P)$(R)CentroidX_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
CentroidY</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Y centroid of the array above the centroid threshold.</td>
|
|
<td>
|
|
CENTROIDY_VALUE</td>
|
|
<td>
|
|
$(P)$(R)CentroidY_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
SigmaX</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Sigma X (width) of the distribution above the centroid threshold.</td>
|
|
<td>
|
|
SIGMAX_VALUE</td>
|
|
<td>
|
|
$(P)$(R)SigmaX_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
SigmaY</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Sigma Y (height) of the distribution above the centroid threshold.</td>
|
|
<td>
|
|
SIGMAY_VALUE</td>
|
|
<td>
|
|
$(P)$(R)SigmaY_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
SigmaXY</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
This is the normalized value of sigmaXY, i.e. sigmaXY/(sigmaX * sigmaY). This is
|
|
often called the correlation coefficient, r. It is zero if the X and Y profiles
|
|
are not correlated, meaning that the distribution is not tilted with respect to
|
|
the X and Y axes.</td>
|
|
<td>
|
|
SIGMAXY_VALUE</td>
|
|
<td>
|
|
$(P)$(R)SigmaXY_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>Time-Series data</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
TSControl</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Controls time-series data collection. The enum choices are:
|
|
<ul>
|
|
<li>Erase/Start: Clears all time-series arrays, sets TS_CURRENT_POINT=0, and starts
|
|
time-series data collection.</li>
|
|
<li>Start: Starts time-series data collection without clearing arrays or modifying
|
|
TS_CURRENT_POINT. Used to restart collection after a Stop operation.</li>
|
|
<li>Stop: Stops times-series data collection. Performs callbacks on all time-series
|
|
waveform records.</li>
|
|
<li>
|
|
Read: Performs callbacks on all time-series waveform records, updating the values.
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
TS_CONTROL</td>
|
|
<td>
|
|
$(P)$(R)TSControl</td>
|
|
<td>
|
|
mbbo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
N.A.</td>
|
|
<td>
|
|
N.A.</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Sends the "Read" command to the TSControl record above. This record can be periodically
|
|
processed to update the time-series waveform records. It is scan disabled if TSAcquiring=Done,
|
|
so that updates are only performed when time-series acquisition is in progress.
|
|
</td>
|
|
<td>
|
|
N.A.</td>
|
|
<td>
|
|
$(P)$(R)TSRead</td>
|
|
<td>
|
|
longout</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
TSNumPoints</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Controls the number of time-series points to collect. There is no maximum value,
|
|
the time-series arrays in the plugin are freed and reallocated each time this value
|
|
is changed. However, the size of the waveform records is fixed when the IOC is started,
|
|
so NELM in those records must be large enough for the largest time-series needed.
|
|
</td>
|
|
<td>
|
|
TS_NUM_POINTS</td>
|
|
<td>
|
|
$(P)$(R)TSNumPoints</td>
|
|
<td>
|
|
longout</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
TSCurrentPoint</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
The current time-series point. If TSCurrentPoint reaches TSNumPoints then time-series
|
|
acquisition is automatically stopped, and callbacks are done on all time-series
|
|
waveform records, updating the values. This means that even if TSRead has SCAN=Passive
|
|
that the waveform records will update when time-series acquisition is complete.
|
|
</td>
|
|
<td>
|
|
TS_CURRENT_POINT</td>
|
|
<td>
|
|
$(P)$(R)TSCurrentPoint</td>
|
|
<td>
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
TSAcquiring</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Indicates status of time-series data acquisition. Values are 0=Done and 1=Acquiring.
|
|
</td>
|
|
<td>
|
|
TS_ACQUIRING</td>
|
|
<td>
|
|
$(P)$(R)TSAcquiring</td>
|
|
<td>
|
|
bi</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
TSXXX</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
The time series data arrays. XXX is one of the following, corresponding to each
|
|
of the basic statistics and centroid and sigma statistics described above:
|
|
<ul>
|
|
<li>MinValue</li>
|
|
<li>MaxValue</li>
|
|
<li>MeanValue</li>
|
|
<li>Sigma</li>
|
|
<li>Total</li>
|
|
<li>Net</li>
|
|
<li>CentroidX</li>
|
|
<li>CentroidY</li>
|
|
<li>SigmaX</li>
|
|
<li>SigmaY</li>
|
|
<li>SigmaXY</li>
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
<ul>
|
|
<li>TS_MIN_VALUE</li>
|
|
<li>TS_MAX_VALUE</li>
|
|
<li>TS_MEAN_VALUE</li>
|
|
<li>TS_SIGMA_VALUE</li>
|
|
<li>TS_TOTAL</li>
|
|
<li>TS_NET</li>
|
|
<li>TS_CENTROIDX_VALUE</li>
|
|
<li>TS_CENTROIDY_VALUE</li>
|
|
<li>TS_SIGMAX_VALUE</li>
|
|
<li>TS_SIGMAY_VALUE</li>
|
|
<li>TS_SIGMAXY_VALUE</li>
|
|
</ul>
|
|
</td>
|
|
<td>
|
|
$(P)$(R)TSXXX</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>X and Y Profiles</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ComputeProfiles</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Flag to control whether to compute the profiles for this array (0=No, 1=Yes).</td>
|
|
<td>
|
|
COMPUTE_PROFILES</td>
|
|
<td>
|
|
$(P)$(R)ComputeProfiles<br />
|
|
$(P)$(R)ComputeProfiles_RBV</td>
|
|
<td>
|
|
bo<br />
|
|
bi</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileSizeX</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Number of array elements in the X profiles.</td>
|
|
<td>
|
|
PROFILE_SIZE_X</td>
|
|
<td>
|
|
$(P)$(R)ProfileSizeX_RBV</td>
|
|
<td>
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileSizeY</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Number of array elements in the Y profiles.</td>
|
|
<td>
|
|
PROFILE_SIZE_Y</td>
|
|
<td>
|
|
$(P)$(R)ProfileSizeY_RBV</td>
|
|
<td>
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
CursorX</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
X position of a user-defined cursor for profiles.</td>
|
|
<td>
|
|
CURSOR_X</td>
|
|
<td>
|
|
$(P)$(R)CursorX<br />
|
|
$(P)$(R)CursorX_RBV</td>
|
|
<td>
|
|
longout<br />
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
CursorY</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Y position of a user-defined cursor for profiles.</td>
|
|
<td>
|
|
CURSOR_Y</td>
|
|
<td>
|
|
$(P)$(R)CursorY<br />
|
|
$(P)$(R)CursorY_RBV</td>
|
|
<td>
|
|
longout<br />
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileAverageX</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Profile of the average row in the array, i.e. the sum of all rows in the array divided
|
|
by the number of rows.</td>
|
|
<td>
|
|
PROFILE_AVERAGE_X</td>
|
|
<td>
|
|
$(P)$(R)ProfileAverageX_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileAverageY</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Profile of the average column in the array, i.e. the sum of all columns in the array
|
|
divided by the number of columns.</td>
|
|
<td>
|
|
PROFILE_AVERAGE_Y</td>
|
|
<td>
|
|
$(P)$(R)ProfileAverageY_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileThresholdX</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Same as ProfileAverageX except that all array elements less than CentroidThreshold
|
|
are set to zero when computing the average.</td>
|
|
<td>
|
|
PROFILE_THRESHOLD_X</td>
|
|
<td>
|
|
$(P)$(R)ProfileThresholdX_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileThresholdY</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Same as ProfileAverageY except that all array elements less than CentroidThreshold
|
|
are set to zero when computing the average.</td>
|
|
<td>
|
|
PROFILE_THRESHOLD_Y</td>
|
|
<td>
|
|
$(P)$(R)ProfileThresholdY_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileCentroidX</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
X profile through the array in the row defined by CentroidY.</td>
|
|
<td>
|
|
PROFILE_CENTROID_X</td>
|
|
<td>
|
|
$(P)$(R)ProfileCentroidX_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileCentroidY</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Y profile through the array in the column defined by CentroidX.</td>
|
|
<td>
|
|
PROFILE_CENTROID_Y</td>
|
|
<td>
|
|
$(P)$(R)ProfileCentroidY_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileCursorX</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
X profile through the array in the row defined by CursorY.</td>
|
|
<td>
|
|
PROFILE_CURSOR_X</td>
|
|
<td>
|
|
$(P)$(R)ProfileCursorX_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ProfileCursorY</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Y profile through the array in the row defined by CursorX.</td>
|
|
<td>
|
|
PROFILE_CURSOR_Y</td>
|
|
<td>
|
|
$(P)$(R)ProfileCursorY_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" colspan="7,">
|
|
<b>Array histogram</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
ComputeHistogram</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Flag to control whether to compute the histogram for this array (0=No, 1=Yes). Not
|
|
computing the histogram reduces CPU load.</td>
|
|
<td>
|
|
COMPUTE_HISTOGRAM</td>
|
|
<td>
|
|
$(P)$(R)ComputeHistogram<br />
|
|
$(P)$(R)ComputeHistogram_RBV</td>
|
|
<td>
|
|
bo<br />
|
|
bi</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
HistSize</td>
|
|
<td>
|
|
asynInt32</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Number of elements (bins) in the histogram</td>
|
|
<td>
|
|
HIST_SIZE</td>
|
|
<td>
|
|
$(P)$(R)HistSize<br />
|
|
$(P)$(R)HistSize_RBV</td>
|
|
<td>
|
|
longout<br />
|
|
longin</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
HistMin</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Minimum value for the histogram. All values less than or equal to this will be in
|
|
the first bin of the histogram.</td>
|
|
<td>
|
|
HIST_MIN</td>
|
|
<td>
|
|
$(P)$(R)HistMin<br />
|
|
$(P)$(R)HistMin_RBV</td>
|
|
<td>
|
|
ao<br />
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
HistMax</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/w</td>
|
|
<td>
|
|
Maximum value for the histogram. All values greater than or equal to this will be
|
|
in the last bin of the histogram.</td>
|
|
<td>
|
|
HIST_MAX</td>
|
|
<td>
|
|
$(P)$(R)HistMax<br />
|
|
$(P)$(R)HistMax_RBV</td>
|
|
<td>
|
|
ao<br />
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
HistEntropy</td>
|
|
<td>
|
|
asynFloat64</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Entropy of the image. This is a measure of the sharpness of the histogram, and is
|
|
often a useful figure of merit for determining sharpness of focus, etc. It is defined
|
|
as -SUM(BIN[i]*log(BIN[i]), where the sum is over the number of bins in the histogram
|
|
and BIN[i] is the number of elements in bin i.</td>
|
|
<td>
|
|
HIST_ENTROPY</td>
|
|
<td>
|
|
$(P)$(R)HistEntropy_RBV</td>
|
|
<td>
|
|
ai</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
NDPluginStats<br />
|
|
HistArray</td>
|
|
<td>
|
|
asynFloat64Array</td>
|
|
<td>
|
|
r/o</td>
|
|
<td>
|
|
Histogram array, i.e. counts in each histogram bin.</td>
|
|
<td>
|
|
HIST_ARRAY</td>
|
|
<td>
|
|
$(P)$(R)Histogram_RBV</td>
|
|
<td>
|
|
waveform</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
If the values of CentroidThreshold, CursorX, or CursorY are changed then the centroid
|
|
and profile calculations are performed again immediately on the last array collected.
|
|
Thus updated centroid statistics and profiles can be displayed even when new arrays
|
|
are not being acquired. These calculations are only performed when enabled by ComputeCentroid
|
|
and ComputeProfiles.</p>
|
|
<h2 id="Configuration">
|
|
Configuration</h2>
|
|
<p>
|
|
The NDPluginStats plugin is created with the NDStatsConfigure command, either from
|
|
C/C++ or from the EPICS IOC shell.</p>
|
|
<pre>NDStatsConfigure(const char *portName, int queueSize, int blockingCallbacks,
|
|
const char *NDArrayPort, int NDArrayAddr,
|
|
int maxBuffers, size_t maxMemory,
|
|
int priority, int stackSize)
|
|
</pre>
|
|
<p>
|
|
For details on the meaning of the parameters to this function refer to the detailed
|
|
documentation on the NDStatsConfigure function in the <a href="areaDetectorDoxygenHTML/_n_d_plugin_stats_8cpp.html">
|
|
NDPluginStats.cpp documentation</a> and in the documentation for the constructor
|
|
for the <a href="areaDetectorDoxygenHTML/class_n_d_plugin_stats.html">NDPluginStats
|
|
class</a>.
|
|
</p>
|
|
<h2 id="Screens">
|
|
Screen shots</h2>
|
|
<p>
|
|
The following MEDM screen provides access to the parameters in NDPluginDriver.h
|
|
and NDPluginStats.h through records in NDPluginBase.template and NDStats.template.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDStats.adl</h3>
|
|
<img alt="NDStats.png" src="NDStats.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows the average profile of an image in the X direction.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDPlot.adl</h3>
|
|
<img alt="NDStats_AverageX.png" src="NDStats_AverageX.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows the profile of an image in the Y direction at the
|
|
location of the user-defined cursor.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDPlot.adl</h3>
|
|
<img alt="NDStats_CursorY.png" src="NDStats_CursorY.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows the histogram of intensities of an array.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDPlot.adl</h3>
|
|
<img alt="NDStats_Histogram.png" src="NDStats_Histogram.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen combines many parameters for 5 NDPluginStats plugins on
|
|
a single screen.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDStats5.adl</h3>
|
|
<img alt="NDStats5.png" src="NDStats5.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows the the total counts from the Stats5 plugin. This
|
|
is the total counts as a function of time.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDTimeSeries.adl</h3>
|
|
<img alt="NDTimeSeriesTotal.png" src="NDTimeSeriesTotal.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows the Y centroid as a function of time from the Stats5
|
|
plugin.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDTimeSeries.adl</h3>
|
|
<img alt="NDTimeSeriesCentroidY.png" src="NDTimeSeriesCentroidY.png" />
|
|
</div>
|
|
<p>
|
|
The following MEDM screen shows all statistics as a function of time from the Stats5
|
|
plugin.
|
|
</p>
|
|
<div style="text-align: center">
|
|
<h3>
|
|
NDTimeSeriesAll.adl</h3>
|
|
<img alt="NDTimeSeriesAll.png" src="NDTimeSeriesAll.png" />
|
|
</div>
|
|
</body>
|
|
</html>
|