IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2006, 4:58:31 PM (20 years ago)
Author:
eugene
Message:

fixed up low-level issues with sky levels, sky bias

File:
1 edited

Legend:

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

    r6715 r6753  
    1717    // measure the aperture loss as a function of radius for PSF
    1818    float REF_RADIUS = psMetadataLookupF32 (&status, config, "PSF_REF_RADIUS");
    19     psf->growth = pmGrowthCurveAlloc (3.0, REF_RADIUS, 0.1);
     19    psf->growth = pmGrowthCurveAlloc (3.0, 50.0, REF_RADIUS);
    2020    psphotGrowthCurve (readout, psf);
    2121   
     
    4343        if (source->moments->SN < 2*FIT_SN_LIM) continue;
    4444
    45         // get uncorrected magnitudes in scaled apertures
    46         model = pmSourceMagnitudes (source, NULL, 0);
     45        // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures
     46        model = pmSourceMagnitudes (source, psf, true, false);
    4747        if (model == NULL) continue;
    4848
     49        apResid->data.F64[Npsf] = source->apMag - source->psfMag;
     50
     51        xPos->data.F64[Npsf]    = model->params->data.F32[2];
     52        yPos->data.F64[Npsf]    = model->params->data.F32[3];
     53
     54        flux->data.F64[Npsf]    = pow(10.0, -0.4*source->psfMag);
     55        r2rflux->data.F64[Npsf] = PS_SQR(model->radiusTMP) / flux->data.F64[Npsf];
     56
    4957        mask->data.U8[Npsf] = 0;
    50         xPos->data.F64[Npsf] = model->params->data.F32[2];
    51         yPos->data.F64[Npsf] = model->params->data.F32[3];
    52 
    53         flux->data.F64[Npsf] = pow(10.0, -0.4*source->psfMag);
    54         r2rflux->data.F64[Npsf] = PS_SQR(model->radius) / flux->data.F64[Npsf];
    55        
    56         apResid->data.F64[Npsf] = source->apMag + pmGrowthCurveCorrect (psf->growth, model->radius) - source->psfMag;
    5758
    5859        // XXX sanity clip?
     
    8384    stats->max = 3.0;
    8485
     86    // no correction
     87    if (!strcasecmp (ApTrendOption, "NONE")) {
     88        // remove ApTrend fit from pmPSFtry
     89        psf->ApTrend->coeff[0][0][0][0] = 0;
     90    }
     91
    8592    // constant only
    8693    if (!strcasecmp (ApTrendOption, "CONSTANT")) {
     
    202209    psVector *resid = (psVector *) psBinaryOp (NULL, (void *) apResid, "-", (void *) fit);
    203210
    204 # if (0)
     211# if (1)
    205212    FILE *fout = fopen ("resid.dat", "w");
    206213    for (int i = 0; i < resid->n; i++) {
     
    241248
    242249    psLogMsg ("psphot.apresid", 3, "measure full-frame aperture residual: %f sec\n", psTimerMark ("psphot"));
    243     psLogMsg ("psphot.apresid", 4, "aperture residual: %f +/- %f : %f bias\n", psf->ApResid, psf->dApResid, psf->skyBias);
     250    psLogMsg ("psphot.apresid", 4, "aperture residual: %f +/- %f : %f bias, %f skysat\n", psf->ApResid, psf->dApResid, psf->skyBias, psf->skySat);
    244251    psLogMsg ("psphot.apresid", 4, "apresid trends: %f %f %f %f %f\n",
    245252              1e3*psf->ApTrend->coeff[1][0][0][0],
Note: See TracChangeset for help on using the changeset viewer.