IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31312


Ignore:
Timestamp:
Apr 18, 2011, 8:53:12 AM (15 years ago)
Author:
eugene
Message:

adding flag to mark PASS1 (vs PASS2) detections; moving AP_MAGS flag inot pmSourcePhotometry; bad mask was missing suspect bits (logic error in I/O writing MASK.PSPHOT - added explicitly to maskPoor in PSF_QF_PERFECT; limit Kron radius at upper and lower bounds; use non-linear position errors only for PSF sources in PSF output (extended sources not fitted with non-linear PSF model); make sure pmSourceCopy gets all the elements of the structure that it needs

Location:
branches/eam_branches/ipp-20110404/psModules/src/objects
Files:
5 edited

Legend:

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

    r31153 r31312  
    199199    source->type = in->type;
    200200    source->mode = in->mode;
     201    source->mode2 = in->mode2;
     202    source->tmpFlags = in->tmpFlags;
    201203    source->imageID = in->imageID;
     204
     205    source->psfMag             = in->psfMag;
     206    source->psfFlux            = in->psfFlux;
     207    source->psfFluxErr         = in->psfFluxErr;
     208    source->extMag             = in->extMag;
     209    source->errMag             = in->errMag;
     210    source->apMag              = in->apMag;
     211    source->apMagRaw           = in->apMagRaw;
     212    source->apRadius           = in->apRadius;
     213    source->apFlux             = in->apFlux;
     214    source->apFluxErr          = in->apFluxErr;
     215    source->pixWeightNotBad    = in->pixWeightNotBad;
     216    source->pixWeightNotPoor   = in->pixWeightNotPoor;
     217    source->psfChisq           = in->psfChisq;
     218    source->crNsigma           = in->crNsigma;
     219    source->extNsigma          = in->extNsigma;
     220    source->sky                = in->sky;
     221    source->skyErr             = in->skyErr;
    202222
    203223    return(source);
     
    486506        // create vectors with Sx, Sy values in window
    487507        // clip sources based on S/N
    488         for (psS32 i = 0 ; i < sources->n ; i++)
     508        for (psS32 i = 0; i < sources->n; i++)
    489509        {
    490510            pmSource *tmpSrc = (pmSource *) sources->data[i];
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMasks.h

    r31306 r31312  
    5151    PM_SOURCE_MODE2_ON_BURNTOOL      = 0x00000020, ///< > 25% of (PSF-weighted) pixels land on burntool
    5252    PM_SOURCE_MODE2_ON_CONVPOOR      = 0x00000040, ///< > 25% of (PSF-weighted) pixels land on convpoor
     53
     54    PM_SOURCE_MODE2_PASS1_SRC        = 0x00000080, ///< source detected in first pass analysis
    5355} pmSourceMode2;
    5456
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceMoments.c

    r31153 r31312  
    109109    // Xn  = SUM (x - xc)^n * (z - sky)
    110110
     111    psF32 RFW = 0.0;
     112    psF32 RHW = 0.0;
     113
    111114    psF32 RF = 0.0;
    112115    psF32 RH = 0.0;
     
    187190            psF32 rs = fDiff;
    188191
     192            psF32 rfw = r * pDiff;
     193            psF32 rhw = sqrt(r) * pDiff;
     194
    189195            psF32 x = xDiff * pDiff;
    190196            psF32 y = yDiff * pDiff;
     
    208214            RH  += rh;
    209215            RS  += rs;
     216
     217            RFW  += rfw;
     218            RHW  += rhw;
    210219
    211220            XX  += xx;
     
    226235    }
    227236
    228     source->moments->Mrf = RF/RS;
    229     source->moments->Mrh = RH/RS;
     237    // if Mrf (first radial moment) is << sigma, we are getting into low-significance
     238    // territory.  saturate at 0.75*sigma.  conversely, if Mrf is > radius, we are clearly
     239    // making an error.  saturate at radius.
     240    source->moments->Mrf = MIN(radius, MAX(0.75*sigma, RF/RS));
     241    source->moments->Mrh = MIN(radius, MAX(0.75*sigma, RH/RS));
    230242
    231243    source->moments->Mxx = XX/Sum;
     
    243255    source->moments->Mxyyy = XYYY/Sum;
    244256    source->moments->Myyyy = YYYY/Sum;
     257
     258    // XXX TEST:
     259    // source->moments->KronFinner = RFW/Sum;
     260    // source->moments->KronFouter = sigma;
    245261
    246262    // Calculate the Kron magnitude (make this block optional?)
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourceOutputs.c

    r31307 r31312  
    9898        outputs->xPos = PAR[PM_PAR_XPOS];
    9999        outputs->yPos = PAR[PM_PAR_YPOS];
    100         if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) {
     100        if ((source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) && !(source->mode & PM_SOURCE_MODE_EXTMODEL)) {
     101            // we only do non-linear PSF fits for non-extended objects
    101102            outputs->xErr = dPAR[PM_PAR_XPOS];
    102103            outputs->yErr = dPAR[PM_PAR_YPOS];
  • branches/eam_branches/ipp-20110404/psModules/src/objects/pmSourcePhotometry.c

    r31153 r31312  
    310310    bool status;
    311311    status = pmSourcePhotometryAper(&source->apMagRaw, &source->apFlux, &source->apFluxErr, model, image, variance, mask, maskVal);
     312    if (status) {
     313        source->mode |= PM_SOURCE_MODE_AP_MAGS;
     314    }
    312315
    313316    return status;
     
    413416    maskBad &= ~maskSuspect;
    414417
     418    psImageMaskType maskPoor = maskVal | maskSuspect;
     419
    415420    // measure modelSum and validSum.  this function is applied to a sources' subimage.  the
    416421    // value of DX is chosen (see above) to cover the full possible size of the subimage if it
     
    446451
    447452            // count pixels which are masked with an mask bit (bad or poor)
    448             if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & maskVal)) {
     453            if (!(mask->data.PS_TYPE_IMAGE_MASK_DATA[my][mx] & maskPoor)) {
    449454                notPoorSum += value;
    450455            }
     
    487492
    488493    if (isfinite(source->pixWeightNotBad) && isfinite(source->pixWeightNotPoor)) {
    489         psAssert (source->pixWeightNotBad <= source->pixWeightNotPoor, "error: all bad pixels should also be poor");
     494        psAssert (source->pixWeightNotPoor <= source->pixWeightNotBad, "error: all bad pixels should also be poor");
    490495    }
    491496
Note: See TracChangeset for help on using the changeset viewer.