IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18040


Ignore:
Timestamp:
Jun 9, 2008, 3:32:15 PM (18 years ago)
Author:
eugene
Message:

ignore nan aperture mags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSFtry.c

    r16911 r18040  
    55 *  @author EAM, IfA
    66 *
    7  *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-03-11 00:49:14 $
     7 *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2008-06-10 01:32:15 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    184184
    185185        // XXX : use a different aperture radius from the fit radius?
    186         if (!pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal, mark)) {
     186        status = pmSourceMagnitudes (source, psfTry->psf, PM_SOURCE_PHOT_INTERP, maskVal, mark);
     187        if (!status || isnan(source->apMag)) {
    187188            psfTry->mask->data.U8[i] = PSFTRY_MASK_BAD_PHOT;
    188189            psTrace ("psModules.objects", 4, "dropping %d (%d,%d) : poor photometry\n", i, source->peak->x, source->peak->y);
     
    252253    if (!pmPSFtryMetric (psfTry, options)) {
    253254        psError(PS_ERR_UNKNOWN, false, "Attempt to fit PSF with model %s failed.", modelName);
     255        psFree (psfTry);
    254256        return NULL;
    255257    }
     
    285287            continue;
    286288        r2rflux->data.F32[i] = PS_SQR(RADIUS) * pow(10.0, 0.4*psfTry->fitMag->data.F32[i]);
     289    }
     290
     291    // XXX test dump of aperture residual data
     292    if (psTraceGetLevel("psModules.objects") >= 5) {
     293        FILE *f = fopen ("apresid.dat", "w");
     294        for (int i = 0; i < psfTry->sources->n; i++) {
     295            int keep = (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL);
     296
     297            pmSource *source = psfTry->sources->data[i];
     298            float x = source->peak->x;
     299            float y = source->peak->y;
     300
     301            fprintf (f, "%d  %d, %f %f %f  %f %f %f \n",
     302                     i, keep, x, y,
     303                     psfTry->fitMag->data.F32[i],
     304                     r2rflux->data.F32[i],
     305                     psfTry->metric->data.F32[i],
     306                     psfTry->metricErr->data.F32[i]);
     307        }
     308        fclose (f);
    287309    }
    288310
Note: See TracChangeset for help on using the changeset viewer.