Function Documentation

double vircam_dmean

(

double *

data,

unsigned char *

bpm,

long

npts

)

Name:

vircam_dmean

Purpose:

Find the mean of a double array with a possible bad pixel mask

Description:

If a bad pixel mask is not included a straight forward mean is performed on the input data array. If a bad pixel mask is included then the data good data are copied into a temporary array and then the mean is performed. This is a routine for double precision data.

If a bad pixel mask is not included a straight forward median is performed on the input data array. If a bad pixel mask is included then the data good data are copied into a temporary array and then the median is performed. This is a routine for double precision data.

If a bad pixel mask is not included a straight forward mean is performed on the input data array. If a bad pixel mask is included then the data good data are copied into a temporary array and then the mean is performed. This is a routine for floating point data.

Find the mean and sigma of a floating point array with a possible bad pixel mask and with lower and upper cuts.

Description:

A straight-forward mean and standard deviation calculation is done. If a bad pixel mask is included, then the flagged pixels are removed from the calculations. Data lower than the lower cut and data higher than the upper cut are removed also.

Language:

C

Parameters:

data

Input data

bpm

Input bad pixel mask or NULL

npts

Number of pixels in the data

lcut

Lower value for data window

hcut

Upper value for data window

mean

The output mean

sig

The output dispersion

Return values:

VIR_OK

If all went well

VIR_WARN

If the variance is negative. Sigma is passed back as CX_MAXFLOAT. Also if all data points are flagged. In that case both the mean and sigma are set to CX_MAXFLOAT.

If a bad pixel mask is not included a straight forward median is performed on the input data array. If a bad pixel mask is included then the data good data are copied into a temporary array and then the median is performed. This is a routine for floating point data.

Find the median and median absolute deviation in a data array with a high and/or low cut.

Description:

The median of an array is found, taking into account any flagged values and any values outside a low and high data value cut. An array of absolute deviations is created and the median is found of that array.

Find a "quick" median and sigma of a floating point array with a bad pixel mask, with lower and upper cuts and with clipping.

Description:

Data outside the data window and data flagged in the bad pixel mask are removed from further consideration. The remaining data are histogrammed in 1 adu bins. A number of iterations are used to find the median and sigma by finding the meidan in the histogram and its quartiles, then using these in conjunction with user defined clipping thresholds to define new estimates.