IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9993


Ignore:
Timestamp:
Nov 14, 2006, 4:36:51 PM (20 years ago)
Author:
eugene
Message:

adding PM_SOURCE_PHOT_INTERP option to pmSourceMagnitudes call (depending on config INTERPOLATE_AP_

File:
1 edited

Legend:

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

    r9890 r9993  
    2828    // this is the smallest radius allowed: need to at least extend growth curve down to this...
    2929    float PSF_FIT_PAD   = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING");
    30     bool  IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH");
     30    bool IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH");
     31    bool INTERPOLATE_AP = psMetadataLookupBool (&status, recipe, "INTERPOLATE_AP");
     32
     33    pmSourcePhotometryMode photMode = 0;
     34    if (!IGNORE_GROWTH) photMode |= PM_SOURCE_PHOT_GROWTH;
     35    if (INTERPOLATE_AP) photMode |= PM_SOURCE_PHOT_INTERP;
    3136
    3237    // set limits on the aperture magnitudes
     
    4853    Npsf = 0;
    4954
     55    // XXX test dump
     56    FILE *f = fopen ("apresid.dat", "w");
     57
    5058    // select all good PM_SOURCE_TYPE_STAR entries
    5159    for (int i = 0; i < sources->n; i++) {
     
    6169        // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures
    6270        // will fail if below S/N threshold or model is missing
    63         if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) {
     71        if (!pmSourceMagnitudes (source, psf, photMode)) {
    6472            Nskip ++;
    6573            continue;
     
    8896        dMag->data.F64[Npsf] = model->dparams->data.F32[PM_PAR_I0] / model->params->data.F32[PM_PAR_I0];
    8997
     98        fprintf (f, "%d %f %f   %f %f   %f %f %f %f\n", i,
     99                 xPos->data.F64[Npsf], yPos->data.F64[Npsf],
     100                 flux->data.F64[Npsf], r2rflux->data.F64[Npsf],
     101                 source->apMag, source->psfMag, apResid->data.F64[Npsf],dMag->data.F64[Npsf]);
     102
    90103        psVectorExtend (mask,    100, 1);
    91104        psVectorExtend (xPos,    100, 1);
     
    99112    psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec for %d objects (%d skipped, %d failed, %ld invalid)\n",
    100113              psTimerMark ("psphot"), Npsf, Nskip, Nfail, sources->n - Npsf - Nskip - Nfail);
     114
     115    fclose (f);
    101116
    102117    // XXX choose a better value here?
Note: See TracChangeset for help on using the changeset viewer.