/* FILE: vec_median.c * 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: Kenneth J. Mighell (mighell@noao.edu) * LANGUAGE: ANSI C * DATE: 2001JUL03 * COPYRIGHT: (C) 2001 Assoc. of Universities for Research in Astronomy Inc. */ #include "mx.h" #include "qdphot.h" #ifndef DBL_MAX #define DBL_MAX 0.99E307 #endif void qdphot5_VecdRobustMdn_vf6 ( double *pxv, int px_n, double *tv, int *median_n_, double *median_, double *adev_ ){ char mxfunc[] = "qdphot5_VecdRobustMdn_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