IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 13, 2006, 8:24:10 PM (21 years ago)
Author:
eugene
Message:

substantial work on the aperture residuals

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotMagnitudes.c

    r5837 r5980  
    1717        model = source->modelPSF;
    1818        if (model == NULL) return NULL;
    19         radius = apRadius;
     19        radius = (apRadius > 0) ? apRadius : model->radius;
    2020        isPSF = true;
    2121        break;
     
    4646    // for PSFs, correct both apMag and fitMag to same system, consistent with infinite flux star in aperture RADIUS
    4747    if (isPSF && (psf != NULL)) {
     48      if (psf->growth != NULL) {
     49          source->apMag += pmGrowthCurveCorrect (psf->growth, model->radius);
     50      }
     51
    4852      rflux   = pow (10.0, 0.4*source->fitMag);
    49       source->apMag  -= rflux * psf->skyBias * (M_PI * PS_SQR(apRadius));
    50       source->fitMag += psPolynomial3DEval (psf->ApTrend, x, y, 0.0);
     53      source->apMag  -= PS_SQR(model->radius)*rflux * psf->skyBias + psf->skySat / rflux;
     54      source->fitMag += psPolynomial4DEval (psf->ApTrend, x, y, 0.0, 0.0);
    5155    }
     56
     57    // unmask aperture
     58    psImageKeepCircle (source->mask, x, y, radius, "AND", ~PSPHOT_MASK_MARKED);
    5259
    5360    // subtract object, leave local sky
    5461    pmSourceSubModel (source->pixels, source->mask, model, false, false);
    55 
    56     // unmask aperture
    57     psImageKeepCircle (source->mask, x, y, radius, "AND", ~PSPHOT_MASK_MARKED);
    5862
    5963    if (!status) return NULL;
     
    6266
    6367/*
    64 aprMag' - fitMag = rflux*skyBias + ApTrend(x,y)
    65 (aprMag - rflux*skyBias) - fitMAg = ApTrend(x,y)
    66 (aprMag - rflux*skyBias) = fitMAg + ApTrend(x,y)
     68aprMag' - fitMag = flux*skySat + r^2*rflux*skyBias + ApTrend(x,y)
     69(aprMag - flux*skySat - r^2*rflux*skyBias) - fitMAg = ApTrend(x,y)
     70(aprMag - flux*skySat - r^2*rflux*skyBias) = fitMAg + ApTrend(x,y)
     71
    6772*/
Note: See TracChangeset for help on using the changeset viewer.