20#include "hdrl_cat_moments.h"
50 double xintmin = ap->xintmin;
51 plstruct *plarray = ap->plarray;
52 cpl_size np = ap->npl_pix;
54 double xoff = (double)(plarray[0].x);
55 double yoff = (double)(plarray[0].y);
57 double tmax = plarray[0].z;
70 for (cpl_size i = 0; i < np; i++) {
72 double t = plarray[i].z;
75 double w = plarray[i].zsm;
77 double x = (double)(plarray[i].x) - xoff;
78 double y = (double)(plarray[i].y) - yoff;
92 tmax = CPL_MAX(tmax, plarray[i].z);
97 if (tsum >= xintmin) {
99 double xbar = xsum / tsum;
100 double ybar = ysum / tsum;
102 double sxx = CPL_MAX(0., (xsumsq / tsum - xbar * xbar));
103 double syy = CPL_MAX(0., (ysumsq / tsum - ybar * ybar));
104 double sxy = xysum / tsum - xbar * ybar;
106 xbar = CPL_MAX(1., CPL_MIN(ap->lsiz, xoff + xsum_w / wsum));
107 ybar = CPL_MAX(1., CPL_MIN(ap->csiz, yoff + ysum_w / wsum));
void hdrl_moments(ap_t *ap, double results[])
Do moments analysis on an object in a Plessey array.