IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 10, 2011, 5:23:09 PM (15 years ago)
Author:
eugene
Message:

measure a core flux in the moment analysis - this can be used with the kron flux to flag (and exclude?) detections in the badly-subtracted background regions

File:
1 edited

Legend:

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

    r29602 r30865  
    8282    psF32 Sum = 0.0;
    8383    psF32 Var = 0.0;
     84    psF32 SumCore = 0.0;
     85    psF32 VarCore = 0.0;
    8486    psF32 R2 = PS_SQR(radius);
    8587    psF32 minSN2 = PS_SQR(minSN);
     
    248250
    249251    int nKronPix = 0;
     252    int nCorePix = 0;
     253    int nInner = 0;
     254    int nOuter = 0;
    250255    Sum = Var = 0.0;
    251256    float SumInner = 0.0;
     
    255260
    256261        psF32 yDiff = row - yCM;
    257         if (fabs(yDiff) > radKron) continue;
     262        if (fabs(yDiff) > radKouter) continue;
    258263
    259264        psF32 *vPix = source->pixels->data.F32[row];
     
    272277
    273278            psF32 xDiff = col - xCM;
    274             if (fabs(xDiff) > radKron) continue;
     279            if (fabs(xDiff) > radKouter) continue;
    275280
    276281            // radKron is just a function of (xDiff, yDiff)
     
    293298            }
    294299
     300            // use sigma (fixed by psf) not a radKron based value
     301            if (r < sigma) {
     302                SumCore += pDiff;
     303                VarCore += wDiff;
     304                nCorePix ++;
     305            }
     306
    295307            if ((r > radKinner) && (r < radKron)) {
    296308                SumInner += pDiff;
     309                nInner ++;
    297310            }
    298311            if ((r > radKron)  && (r < radKouter)) {
    299312                SumOuter += pDiff;
     313                nOuter ++;
    300314            }
    301315        }
    302316    }
    303     source->moments->KronFlux = Sum;
    304     source->moments->KronFinner = SumInner;
    305     source->moments->KronFouter = SumOuter;
    306     source->moments->KronFluxErr = sqrt(Var);
     317    // *** should I rescale these fluxes by pi R^2 / nNpix?
     318    source->moments->KronCore    = SumCore       * M_PI * PS_SQR(sigma) / nCorePix;
     319    source->moments->KronCoreErr = sqrt(VarCore) * M_PI * PS_SQR(sigma) / nCorePix;
     320    source->moments->KronFlux    = Sum       * M_PI * PS_SQR(radKron) / nKronPix;
     321    source->moments->KronFluxErr = sqrt(Var) * M_PI * PS_SQR(radKron) / nKronPix;
     322    source->moments->KronFinner = SumInner * M_PI * (PS_SQR(radKron)   - PS_SQR(radKinner)) / nInner;
     323    source->moments->KronFouter = SumOuter * M_PI * (PS_SQR(radKouter) -   PS_SQR(radKron)) / nOuter;
    307324
    308325    psTrace ("psModules.objects", 4, "Mrf: %f  KronFlux: %f  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",
Note: See TracChangeset for help on using the changeset viewer.