IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8137


Ignore:
Timestamp:
Aug 4, 2006, 2:37:17 AM (20 years ago)
Author:
eugene
Message:

added maximum allowed ApResid value to config data, track failures in log message

File:
1 edited

Legend:

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

    r7342 r8137  
    55bool psphotApResid (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf) {
    66
     7    int Nfail = 0;
     8    int Nskip = 0;
    79    int Npsf;
    810    bool status;
     
    1315
    1416    // S/N limit to perform full non-linear fits
    15     float FIT_SN_LIM = psMetadataLookupF32 (&status, recipe, "FULL_FIT_SN_LIM");
     17    float MAX_AP_OFFSET = psMetadataLookupF32 (&status, recipe, "MAX_AP_OFFSET");
    1618
    1719    // set limits on the aperture magnitudes
     
    3638    for (int i = 0; i < sources->n; i++) {
    3739        source = sources->data[i];
     40        model = source->modelPSF;
    3841
    3942        if (source->type != PM_SOURCE_TYPE_STAR) continue;
     
    4346        if (source->mode &  PM_SOURCE_MODE_POOR) continue;
    4447
    45         model = source->modelPSF;
    46         if (model == NULL) continue;
    47 
    48         // XXX tune independently?
    49         if (source->moments->SN < 2*FIT_SN_LIM) continue;
    50 
    5148        // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures
    52         if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) continue;
     49        // will fail if below S/N threshold or model is missing
     50        if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) {
     51            Nskip ++;
     52            continue;
     53        }
    5354
    5455        apResid->data.F64[Npsf] = source->apMag - source->psfMag;
     
    6566        // XXX need to see if all data were tossed?
    6667        // XXX need to subtract median?
    67         if (fabs(apResid->data.F64[Npsf]) > 0.2) continue;
     68        // XXX need to put this in the config data...
     69        // if (fabs(apResid->data.F64[Npsf]) > 0.2) continue;
     70        if (fabs(apResid->data.F64[Npsf]) > MAX_AP_OFFSET) {
     71            Nfail ++;
     72            continue;
     73        }
    6874
    6975        dMag->data.F64[Npsf] = model->dparams->data.F32[1] / model->params->data.F32[1];
     
    7884        Npsf ++;
    7985    }
    80     psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec for %d objects\n", psTimerMark ("psphot"), Npsf);
     86    psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec for %d objects (%d skipped, %d failed, %d invalid)\n",
     87              psTimerMark ("psphot"), Npsf, Nskip, Nfail, sources->n - Npsf - Nskip - Nfail);
    8188
    8289    // APTREND options : NONE SKYBIAS XY_LIN XY_QUAD SKY_XY_LIN FULL
Note: See TracChangeset for help on using the changeset viewer.