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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
npts | Number of pixels in the data |
- Return values:
-
mean | When all goes well |
CX_MAXDOUBLE | if 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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
npts | Number of pixels in the data |
- Return values:
-
median | When all goes well |
CX_MAXDOUBLE | if 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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
npts | Number of pixels in the data |
- Return values:
-
mean | When all goes well |
CX_MAXFLOAT | if 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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
npts | Number of pixels in the data |
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. |
- 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:
-
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. |
- 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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
npts | Number of pixels in the data |
- Return values:
-
median | When all goes well |
CX_MAXFLOAT | if 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 |
|
) |
| |
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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
np | Number of pixels in the data |
lcut | Lower value for data window |
hcut | Upper value for data window |
med | The output median |
mad | The 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:
-
data | Input data |
bpm | Input bad pixel mask or NULL |
np | Number of pixels in the data |
med | The output median |
sig | The 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:
-
data | Input data |
bpm | Input bad pixel mask |
npts | Number of pixels in the data |
thresh | Clipping threshold |
niter | Number of clipping iterations |
lowv | Lower value for data window |
highv | Upper value for data window |
median | The output median |
sigma | The 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:
-
bpm | Input bad pixel mask |
npts | Number of pixels in the bpm |
sumb | The output sum |
- Return values:
-
- Author:
- Jim Lewis, CASU
Definition at line 822 of file vircam_stats.c.