IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9807


Ignore:
Timestamp:
Oct 31, 2006, 9:37:39 AM (20 years ago)
Author:
eugene
Message:

added ignore option to psphotGrowthCurve

Location:
trunk/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r9771 r9807  
    5151int             psphotSortBySN (const void **a, const void **b);
    5252int             psphotSortByY (const void **a, const void **b);
    53 bool            psphotGrowthCurve (pmReadout *readout, pmPSF *psf);
     53bool            psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore);
    5454void            psphotTestArguments (int *argc, char **argv);
    5555bool            psphotMaskReadout (pmReadout *readout, psMetadata *recipe);
  • trunk/psphot/src/psphotApResid.c

    r9771 r9807  
    2525    // S/N limit to perform full non-linear fits
    2626    float MAX_AP_OFFSET = psMetadataLookupF32 (&status, recipe, "MAX_AP_OFFSET");
     27    bool  IGNORE_GROWTH = psMetadataLookupBool (&status, recipe, "IGNORE_GROWTH");
    2728
    2829    // set limits on the aperture magnitudes
     
    3233    float REF_RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_REF_RADIUS");
    3334    psf->growth = pmGrowthCurveAlloc (3.0, 100.0, REF_RADIUS);
    34     psphotGrowthCurve (readout, psf);
     35
     36    psphotGrowthCurve (readout, psf, IGNORE_GROWTH);
    3537
    3638    psVector *mask    = psVectorAllocEmpty (300, PS_TYPE_U8);
     
    6769
    6870        flux->data.F64[Npsf]    = pow(10.0, -0.4*source->psfMag);
    69         r2rflux->data.F64[Npsf] = PS_SQR(model->radiusTMP) / flux->data.F64[Npsf];
     71        r2rflux->data.F64[Npsf] = PS_SQR(model->radiusFit) / flux->data.F64[Npsf];
    7072
    7173        mask->data.U8[Npsf] = 0;
  • trunk/psphot/src/psphotGrowthCurve.c

    r9595 r9807  
    55//     the 'center' option
    66
    7 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf) {
     7// XXX add a option to turn off the curve-of-growth (ie, make the apMag = fitMag everywhere);
     8
     9bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore) {
    810
    911    // bool status;
     
    3133    pmModel *model = pmModelFromPSF (modelRef, psf);
    3234
     35    // measure the fitMag for this model
     36    pmSourcePhotometryModel (&fitMag, model);
     37    psf->growth->fitMag = fitMag;
     38
    3339    // generate working image for this source
    3440    psRegion region = {xc - dx, xc + dx, yc - dy, yc + dy};
     
    4652
    4753        psImageKeepCircle (mask, xc, yc, radius, "OR", PM_MASK_MARK);
     54        pmModelAdd (image, mask, model, false, false);
     55        pmSourcePhotometryAper (&apMag, model, image, mask);
     56        psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_U8(PM_MASK_MARK));
    4857
    49         pmModelAdd (image, mask, model, false, false);
    50 
    51         pmSourcePhotometryAper (&apMag, model, image, mask);
    52 
    53         psImageKeepCircle (mask, xc, yc, radius, "AND", PS_NOT_U8(PM_MASK_MARK));
    54         psf->growth->apMag->data.F32[i] = apMag;
     58        // the 'ignore' mode is for testing
     59        if (ignore) {
     60            psf->growth->apMag->data.F32[i] = fitMag;
     61        } else {
     62            psf->growth->apMag->data.F32[i] = apMag;
     63        }
    5564    }
    56 
    57     pmSourcePhotometryModel (&fitMag, model);
    58     psf->growth->fitMag = fitMag;
    5965
    6066    psf->growth->apRef = psVectorInterpolate (psf->growth->radius, psf->growth->apMag, psf->growth->refRadius);
Note: See TracChangeset for help on using the changeset viewer.