IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 26, 2011, 5:54:39 PM (15 years ago)
Author:
eugene
Message:

pmSourceCopy and pmPeakCopy should copy all appropriate values; do not fit sources with moments failures

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

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110404/psphot/src/psphotBlendFit.c

    r31313 r31384  
    242242        if (source->mode &  PM_SOURCE_MODE_PAIR) continue;
    243243
     244        // do not include MOMENTS_FAILURES in the fit
     245        if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue;
     246
    244247        // limit selection to some SN limit
    245248        if (sqrt(source->peak->detValue) < FIT_SN_LIM) continue;
  • branches/eam_branches/ipp-20110404/psphot/src/psphotFitSourcesLinear.c

    r31381 r31384  
    137137        if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue;
    138138
     139        // do not include MOMENTS_FAILURES in the fit
     140        if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue;
     141
    139142        // XXX count saturated stars
    140143        if (source->mode & PM_SOURCE_MODE_SATSTAR) {
     
    166169        // apply mask?
    167170        float modelSum = 0.0;
     171        float maskedSum = 0.0;
    168172        for (int iy = 0; iy < source->modelFlux->numRows; iy++) {
    169173            for (int ix = 0; ix < source->modelFlux->numCols; ix++) {
    170174                modelSum += source->modelFlux->data.F32[iy][ix];
     175                if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] & maskVal) continue;
     176                maskedSum += source->modelFlux->data.F32[iy][ix];
    171177            }
    172178        }
    173179        if (modelSum < 0.5) continue; // skip sources with no model constraint (somewhat arbitrary limit)
    174180        if (modelSum < 0.8) {
    175             fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n",
    176                      source->peak->xf, source->peak->yf, modelSum, source->peak->rawFlux);
     181            fprintf (stderr, "low-sig model @ %f, %f (%f masked sum, %f sum, %f peak)\n",
     182                     source->peak->xf, source->peak->yf, maskedSum, modelSum, source->peak->rawFlux);
     183        }
     184        if (maskedSum < 0.5) {
     185            fprintf (stderr, "worrying model @ %f, %f (%f masked sum, %f sum, %f peak)\n",
     186                     source->peak->xf, source->peak->yf, maskedSum, modelSum, source->peak->rawFlux);
    177187        }
    178188
  • branches/eam_branches/ipp-20110404/psphot/src/psphotGuessModels.c

    r31154 r31384  
    160160        pmSource *source = sources->data[i];
    161161
    162         if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) {
    163             fprintf (stderr, "moment failure\n");
    164         }
    165 
    166162        // this is used to mark sources for which the model is measured. We check later that
    167163        // all are used.
     
    169165
    170166        // skip non-astronomical objects (very likely defects)
     167        if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue;
    171168        if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
    172169        if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
     
    196193        }
    197194
     195# if (0)
    198196        if (source->mode & PM_SOURCE_MODE_SATSTAR) {
    199197            fprintf (stderr, "satstar: %f,%f vs %f,%f : %c\n",
     
    202200                     (useMoments ? 'T' : 'F'));
    203201        }
     202# endif
    204203
    205204        // set PSF parameters for this model (apply 2D shape model to coordinates Xo, Yo)
  • branches/eam_branches/ipp-20110404/psphot/src/psphotMakeGrowthCurve.c

    r31362 r31384  
    5050# endif
    5151
     52    psLogMsg ("psphot", PS_LOG_MINUTIA, "built growth curve: %f sec\n", psTimerMark ("psphot.growth"));
     53
    5254    float offset = pmGrowthCurveCorrect (psf->growth, PSF_APERTURE);
    53     fprintf (stderr, "correction from %f to %f: %f mags\n", PSF_APERTURE, REF_RADIUS, offset);
    54 
    55     psLogMsg ("psphot", PS_LOG_MINUTIA, "built growth curve: %f sec\n", psTimerMark ("psphot.growth"));
     55    psLogMsg ("psphot", PS_LOG_DETAIL, "correction from %f to %f: %f mags\n", PSF_APERTURE, REF_RADIUS, offset);
    5656
    5757    return true;
  • branches/eam_branches/ipp-20110404/psphot/src/psphotRadialApertures.c

    r31154 r31384  
    9595        if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
    9696        if (source->mode & PM_SOURCE_MODE_DEFECT) continue;
    97         if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;
     97
     98        // XXX measure radial apertures even for saturated stars
     99        // if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;
    98100
    99101        // limit selection to some SN limit
     
    257259        float SBstdv = sqrt((fluxStd->data.F32[i] / nPix) - PS_SQR(SBmean));
    258260
     261        // XXX report the total flux or the mask-corrected flux?
    259262        // flux->data.F32[i]    = SBmean * Area;
     263        // fluxErr->data.F32[i] = sqrt(fluxErr->data.F32[i]) * Area / nPix;
     264
     265        fluxErr->data.F32[i] = sqrt(fluxErr->data.F32[i]);
    260266        fluxStd->data.F32[i] = SBstdv * Area;
    261         fluxErr->data.F32[i] = sqrt(fluxErr->data.F32[i]) * Area / nPix;
    262 
    263         // fill->data.F32[i] /= Area;
     267        fill->data.F32[i] /= Area;
     268
    264269        psTrace ("psphot", 5, "radial bins: %3d  %5.1f : %8.1f +/- %7.2f : %8.1f +/- %8.1f : %4.2f %6.1f\n",
    265270                 i, aperRadii->data.F32[i], flux->data.F32[i], fluxErr->data.F32[i], SBmean, SBstdv, fill->data.F32[i], Area);
Note: See TracChangeset for help on using the changeset viewer.