IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 28, 2009, 2:33:51 PM (17 years ago)
Author:
Paul Price
Message:

Changing pmReadout.weight to variance. Adding pmReadout.covariance which will carry around a covariance pseudo-matrix, allowing us to calculate the pixel-to-pixel variance. pmReadout.covariance now exists and is set, but no mechanism yet to read/write, or use it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/pap_branch_20090128/psModules/src/objects/pmSourceMoments.c

    r21183 r21211  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-01-27 06:39:38 $
     8 *  @version $Revision: 1.7.2.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-01-29 00:33:51 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4747    pmSource->peak
    4848    pmSource->pixels
    49     pmSource->weight (optional)
     49    pmSource->variance (optional)
    5050    pmSource->mask (optional)
    5151
     
    9999
    100100        psF32 *vPix = source->pixels->data.F32[row];
    101         psF32 *vWgt = source->weight->data.F32[row];
     101        psF32 *vWgt = source->variance->data.F32[row];
    102102        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    103103
     
    110110                vMsk++;
    111111            }
    112             if (isnan(*vPix)) continue;
     112            if (isnan(*vPix)) continue;
    113113
    114114            psF32 xDiff = col - xPeak;
     
    189189
    190190        psF32 *vPix = source->pixels->data.F32[row];
    191         psF32 *vWgt = source->weight->data.F32[row];
     191        psF32 *vWgt = source->variance->data.F32[row];
    192192        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    193193
     
    200200                vMsk++;
    201201            }
    202             if (isnan(*vPix)) continue;
     202            if (isnan(*vPix)) continue;
    203203
    204204            psF32 xDiff = col - xCM;
     
    206206
    207207            // radius is just a function of (xDiff, yDiff)
    208             psF32 r2  = PS_SQR(xDiff) + PS_SQR(yDiff);
    209             psF32 r  = sqrt(r2);
     208            psF32 r2  = PS_SQR(xDiff) + PS_SQR(yDiff);
     209            psF32 r  = sqrt(r2);
    210210            if (r > radius) continue;
    211211
     
    278278
    279279    psTrace ("psModules.objects", 4, "Mxx: %f  Mxy: %f  Myy: %f  Mxxx: %f  Mxxy: %f  Mxyy: %f  Myyy: %f  Mxxxx: %f  Mxxxy: %f  Mxxyy: %f  Mxyyy: %f  Mxyyy: %f\n",
    280              source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy, 
     280             source->moments->Mxx,   source->moments->Mxy,   source->moments->Myy,
    281281             source->moments->Mxxx,  source->moments->Mxxy,  source->moments->Mxyy,  source->moments->Myyy,
    282282             source->moments->Mxxxx, source->moments->Mxxxy, source->moments->Mxxyy, source->moments->Mxyyy, source->moments->Myyyy);
     
    286286
    287287    if (source->moments->Mxx < 0) {
    288         fprintf (stderr, "error: neg second moment??\n");
     288        fprintf (stderr, "error: neg second moment??\n");
    289289    }
    290290    if (source->moments->Myy < 0) {
    291         fprintf (stderr, "error: neg second moment??\n");
     291        fprintf (stderr, "error: neg second moment??\n");
    292292    }
    293293
     
    341341
    342342        psF32 *vPix = source->pixels->data.F32[row];
    343         psF32 *vWgt = source->weight->data.F32[row];
     343        psF32 *vWgt = source->variance->data.F32[row];
    344344        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
    345345
     
    352352                vMsk++;
    353353            }
    354             if (isnan(*vPix)) continue;
     354            if (isnan(*vPix)) continue;
    355355
    356356            psF32 xDiff = col - xPeak;
     
    407407    }
    408408
    409 # if (PS_TRACE_ON) 
     409# if (PS_TRACE_ON)
    410410    float Sxx = PS_MAX(X2/Sum - PS_SQR(x), 0);
    411411    float Sxy = XY / Sum;
Note: See TracChangeset for help on using the changeset viewer.