IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 20, 2011, 10:52:17 AM (15 years ago)
Author:
eugene
Message:

count pixels actually used for apertures; remove deprecated sky bias correction code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMoments.c

    r31312 r31327  
    130130    Sum = 0.0;  // the second pass may include slightly different pixels, re-determine Sum
    131131
     132    // float dX = source->moments->Mx - source->peak->xf;
     133    // float dY = source->moments->My - source->peak->yf;
     134    // float dR = hypot(dX, dY);
     135    // float Xo = (dR < 2.0) ? source->moments->Mx : source->peak->xf;
     136    // float Yo = (dR < 2.0) ? source->moments->My : source->peak->yf;
     137    float Xo = source->moments->Mx;
     138    float Yo = source->moments->My;
     139
    132140    // center of mass in subimage.  Note: the calculation below uses pixel index, so we correct
    133141    // xCM, yCM from pixel coords to pixel index here.
    134     psF32 xCM = source->moments->Mx - 0.5 - source->pixels->col0; // coord of peak in subimage
    135     psF32 yCM = source->moments->My - 0.5 - source->pixels->row0; // coord of peak in subimage
     142    psF32 xCM = Xo - 0.5 - source->pixels->col0; // coord of peak in subimage
     143    psF32 yCM = Yo - 0.5 - source->pixels->row0; // coord of peak in subimage
    136144
    137145    for (psS32 row = 0; row < source->pixels->numRows ; row++) {
     
    142150        psF32 *vPix = source->pixels->data.F32[row];
    143151        psF32 *vWgt = source->variance->data.F32[row];
     152
    144153        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
     154        // psImageMaskType  *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row];
    145155
    146156        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     
    280290        psF32 *vPix = source->pixels->data.F32[row];
    281291        psF32 *vWgt = source->variance->data.F32[row];
     292
    282293        psImageMaskType  *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
     294        // psImageMaskType  *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row];
    283295
    284296        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
     
    391403        psF32 *vPix = source->pixels->data.F32[row];
    392404        psF32 *vWgt = source->variance->data.F32[row];
     405
    393406        psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row];
     407        // psImageMaskType *vMsk = (source->maskView == NULL) ? NULL : source->maskView->data.PS_TYPE_IMAGE_MASK_DATA[row];
    394408
    395409        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
Note: See TracChangeset for help on using the changeset viewer.