VIRCAM Pipeline  1.3.4
Functions

These are support routines used for doing statistics on data arrays. More...

Functions

float vircam_med (float *data, unsigned char *bpm, long npts)
 
double vircam_dmed (double *data, unsigned char *bpm, long npts)
 
float vircam_mean (float *data, unsigned char *bpm, long npts)
 
double vircam_dmean (double *data, unsigned char *bpm, long npts)
 
int vircam_meansig (float *data, unsigned char *bpm, long npts, float *mean, float *sig)
 
int vircam_meansigcut (float *data, unsigned char *bpm, long npts, float lcut, float hcut, float *mean, float *sig)
 
void vircam_qmedsig (float *data, unsigned char *bpm, long npts, float thresh, int niter, float lowv, float highv, float *median, float *sigma)
 
void vircam_medmad (float *data, unsigned char *bpm, long np, float *med, float *mad)
 
void vircam_medmadcut (float *data, unsigned char *bpm, long np, float lcut, float hcut, float *med, float *mad)
 
void vircam_medsig (float *data, unsigned char *bpm, long np, float *med, float *sig)
 
int vircam_sumbpm (unsigned char *bpm, int npts, int *sumb)
 

Detailed Description

These are support routines used for doing statistics on data arrays.

Author
Jim Lewis, CASU, CASU

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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
Return values
meanWhen all goes well
CX_MAXDOUBLEif all are flagged as bad
Author
Jim Lewis, CASU

Definition at line 301 of file vircam_stats.c.

double vircam_dmed ( double *  data,
unsigned char *  bpm,
long  npts 
)
Name:
vircam_dmed
Purpose:
Find the median of a double array with a possible bad pixel mask
Description:
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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
Return values
medianWhen all goes well
CX_MAXDOUBLEif all are flagged as bad
Author
Jim Lewis, CASU

Definition at line 170 of file vircam_stats.c.

Referenced by vircam_platesol().

float vircam_mean ( float *  data,
unsigned char *  bpm,
long  npts 
)
Name:
vircam_mean
Purpose:
Find the mean of a float 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 floating point data.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
Return values
meanWhen all goes well
CX_MAXFLOATif all are flagged as bad
Author
Jim Lewis, CASU

Definition at line 246 of file vircam_stats.c.

Referenced by vircam_mkconf().

int vircam_meansig ( float *  data,
unsigned char *  bpm,
long  npts,
float *  mean,
float *  sig 
)
Name:
vircam_meansig
Purpose:
Find the mean and sigma of a floating point array with a possible bad pixel mask
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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
meanThe output mean
sigThe output dispersion
Return values
VIR_OKIf all went well
VIR_WARNIf 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.
Author
Jim Lewis, CASU

Definition at line 362 of file vircam_stats.c.

Referenced by vircam_difference_image().

int vircam_meansigcut ( float *  data,
unsigned char *  bpm,
long  npts,
float  lcut,
float  hcut,
float *  mean,
float *  sig 
)
Name:
vircam_meansigcut
Purpose:
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
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
lcutLower value for data window
hcutUpper value for data window
meanThe output mean
sigThe output dispersion
Return values
VIR_OKIf all went well
VIR_WARNIf 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.
Author
Jim Lewis, CASU

Definition at line 451 of file vircam_stats.c.

Referenced by vircam_illum(), and vircam_photcal().

float vircam_med ( float *  data,
unsigned char *  bpm,
long  npts 
)
Name:
vircam_med
Purpose:
Find the median of a float array with a possible bad pixel mask
Description:
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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
nptsNumber of pixels in the data
Return values
medianWhen all goes well
CX_MAXFLOATif all are flagged as bad
Author
Jim Lewis, CASU

Definition at line 89 of file vircam_stats.c.

Referenced by vircam_backmap(), vircam_grout(), vircam_imcombine(), vircam_jmp_interleave(), vircam_matchxy(), vircam_medmad(), vircam_medmadcut(), and vircam_medsig().

void vircam_medmad ( float *  data,
unsigned char *  bpm,
long  np,
float *  med,
float *  mad 
)
Name:
vircam_medmad
Purpose:
Find the median and median absolute deviation in a data array
Description:
The median of an array is found, taking into account any flagged values. An array of absolute deviations is created and the median is found of that array.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
npNumber of pixels in the data
medThe output median
madThe output median absolute deviation
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 625 of file vircam_stats.c.

References vircam_med().

Referenced by vircam_defringe(), vircam_destripe(), vircam_difference_image(), vircam_genbpm(), vircam_illum(), vircam_matchstds(), and vircam_photcal().

void vircam_medmadcut ( float *  data,
unsigned char *  bpm,
long  np,
float  lcut,
float  hcut,
float *  med,
float *  mad 
)
Name:
vircam_medmadcut
Purpose:
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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
npNumber of pixels in the data
lcutLower value for data window
hcutUpper value for data window
medThe output median
madThe output median absolute deviation
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 684 of file vircam_stats.c.

References vircam_med().

Referenced by vircam_destripe().

void vircam_medsig ( float *  data,
unsigned char *  bpm,
long  np,
float *  med,
float *  sig 
)
Name:
vircam_medsig
Purpose:
Find the median and sigma about that median.
Description:
The median of an array is found, taking into account any flagged values. The sigma is then worked out about the median.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask or NULL
npNumber of pixels in the data
medThe output median
sigThe output sigma
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 756 of file vircam_stats.c.

References vircam_med().

Referenced by vircam_genbpm(), and vircam_illum().

void vircam_qmedsig ( float *  data,
unsigned char *  bpm,
long  npts,
float  thresh,
int  niter,
float  lowv,
float  highv,
float *  median,
float *  sigma 
)
Name:
vircam_qmedsig
Purpose:
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.
Language:
C
Parameters
dataInput data
bpmInput bad pixel mask
nptsNumber of pixels in the data
threshClipping threshold
niterNumber of clipping iterations
lowvLower value for data window
highvUpper value for data window
medianThe output median
sigmaThe output dispersion
Returns
Nothing
Author
Jim Lewis, CASU

Definition at line 542 of file vircam_stats.c.

Referenced by vircam_destripe(), and vircam_jmp_skycor().

int vircam_sumbpm ( unsigned char *  bpm,
int  npts,
int *  sumb 
)
Name:
vircam_sumbpm
Purpose:
Get the sum from a bad pixel mask
Description:
Sum all the values in a bad pixel mask. This is useful for telling how many pixels are bad.
Language:
C
Parameters
bpmInput bad pixel mask
nptsNumber of pixels in the bpm
sumbThe output sum
Return values
VIR_OKAlways
Author
Jim Lewis, CASU

Definition at line 822 of file vircam_stats.c.