imProc.stat - EranOfek/AstroPack GitHub Wiki

Description

The imProc.stat package contains pixel-wise statistics functions that can be implemented on AstroImage object. The functions also allow the statistics to include or exclude pixels flagged by specific bit masks.

Functions

The functions in this package work on AstroImage objects. If the AstroImage contains multiple elements, then the functions will return a vector of results (with the exception of hist).

  • allFunList - List of all functions in the package.
  • hist - Plot a histogram of pixel values.
  • histcounts - histcounts for an AstroImage
  • identifyBadImages - Identify bad images.
  • mean - Mean of all pixels in an image.
  • min - Minimum of all pixels in an image.
  • max - Maximum of all pixels in an image.
  • moment - Nth central moment of all pixels in an image.
  • range - range of pixel values.
  • std - StD of pixels.
  • rstd - Robust StD of pixels.
  • var - Variance of pixels.
  • countNaN - Count the number of NaN pixels.
  • median - Median of pixels.
  • mode - Mode of pixels.
  • quantile - Quantile of pixels.
  • unitTest - Test the package.

Examples

% Create an AstroImage with 2 random images:
AI = AstroImage({rand(100,100), rand(1000,1000)});
% return the minimum pixel value in each of the two images:
imProc.stat.min(AI)
% the same for robust std:
imProc.stat.rstd(AI)

Calculating statistics including/excluding pixels marked by specific bit mask names:

% calculate the median of pixels marked as saturated
[a,b]=imProc.stat.median(AI,'BitNames',{'Saturated'})

% calculate the mean of pixels marked as LowRN __AND__ HighRN 
[a,b]=imProc.stat.mean(AI,'BitNames',{'LowRN','HighRN})

% calculate the robust std of pixels marked as LowRN __OR__ HighRN 
[a,b]=imProc.stat.mean(AI,'BitNames',{'LowRN','HighRN}, 'Method','any')

% calculate the min of pixels marked as __NOT__ saturated:
[a,b]=imProc.stat.median(AI,'BitNames',{'Saturated'},'UseNot',true)