/* MX LIBRARY FUNCTION: mxqdphot0_qdimdn_vf6 * * PURPOSE: * * determine the robust median and average deviation of the pixel vector pxv * of size px_n using a temporary pixel vector tv of size px_n. t_n is the * number of pixels used in the determination of the robust median. * * AUTHOR: K. J. Mighell (mighell@noao.edu) * * LANGUAGE: ANSI C * * DOCUMENTATION: http://www.noao.edu/staff/mighell/mx * * DATE: 20000316 * * MOD: 2 * * Copyleft (L) 2000 Kenneth John Mighell */ #include #include "mxqdphot.h" #ifndef DBL_MAX #define DBL_MAX 0.99E307 #endif void mxqdphot0_qdimdn_vf6 ( double *pxv, int px_n, double *tv, int *median_n_, double *median_, double *adev_ ){ char mxfunc[] = "mxqdphot0_qdimdn_vf6"; double median; double adev; int t_n; int t_n_old; double t_mdn; double t_mdn_old; double t_adv; double t_adv_old; double t_limit; double t_px; double t_mean; double t_min; int j; int jj; int m; int k; t_n = px_n; t_n_old = t_n; t_mdn_old = pxv[0]; t_adv_old = DBL_MAX; for (j=0; j