IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31610


Ignore:
Timestamp:
Jun 8, 2011, 11:41:35 AM (15 years ago)
Author:
eugene
Message:

use same min radius for masked kron mags as unmasked

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110505/psphot/src/psphotKronMasked.c

    r31452 r31610  
    11# include "psphotInternal.h"
    22
    3 bool psphotKronMag (pmSource *source, float radius, psImageMaskType maskVal);
     3bool psphotKronMag (pmSource *source, float radius, float minKronRadius, psImageMaskType maskVal);
    44
    55bool psphotKronMasked (pmConfig *config, const pmFPAview *view, const char *filerule)
     
    6565    if (!status) {
    6666        RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
     67    }
     68
     69    float MIN_KRON_RADIUS = psMetadataLookupF32 (&status, readout->analysis, "MOMENTS_MIN_KRON");
     70    if (!status) {
     71        MIN_KRON_RADIUS = 0.25*RADIUS;
    6772    }
    6873
     
    96101        }
    97102
    98         psphotKronMag (source, RADIUS, maskVal);
     103        psphotKronMag (source, RADIUS, MIN_KRON_RADIUS, maskVal);
    99104
    100105        // re-subtract the object, leave local sky
     
    138143}
    139144
    140 bool psphotKronMag (pmSource *source, float radius, psImageMaskType maskVal) {
     145bool psphotKronMag (pmSource *source, float radius, float minKronRadius, psImageMaskType maskVal) {
    141146
    142147    PS_ASSERT_PTR_NON_NULL(source, false);
     
    219224
    220225    // Saturate the 1st radial moment
    221     float Mrf = MIN(radius, MAX(0.25*radius, RF/RS));
     226    float Mrf = MAX(minKronRadius, RF/RS);
     227    if (sqrt(source->peak->detValue) < 10.0) {
     228        Mrf = MIN (radius, Mrf);
     229    }
    222230
    223231    // Calculate the Kron magnitude (make this block optional?)
     
    263271        }
    264272    }
     273
     274    source->moments->Mrh = Mrf;
     275
    265276    // XXX for a test, save the old values here:
    266     source->moments->KronCore    = source->moments->KronFlux;
     277    source->moments->KronFouter    = source->moments->KronFlux;
    267278    source->moments->KronCoreErr = source->moments->KronFluxErr;
    268279
Note: See TracChangeset for help on using the changeset viewer.