IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 21, 2011, 10:44:17 AM (15 years ago)
Author:
eugene
Message:

distinguish window used for moment calculation and window used for model fitting more clearly; re-generate the cached model after PCM fitting using new function (instead of caching the fit models); add function to set window which shrinks as well as expands as needed

Location:
branches/eam_branches/ipp-20110710/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psphot/src

    • Property svn:ignore
      •  

        old new  
        2222psphotMakePSF
        2323psphotStack
         24psphotModelTest
  • branches/eam_branches/ipp-20110710/psphot/src/psphotRadiusChecks.c

    r31990 r32157  
    144144# define MIN_WINDOW 5.0
    145145# define SCALE1 5.0
    146 # define SCALE2 12.5
     146# define SCALE2 12.0
    147147
    148148// call this function whenever you (re)-define the EXT model
     149// XXX this function does not shrink the window
    149150bool psphotSetRadiusMoments (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal) {
    150151
     
    160161    // redefine the pixels if needed
    161162    pmSourceRedefinePixels (source, readout, source->peak->xf, source->peak->yf, *windowRadius);
     163
     164    // set the mask to flag the excluded pixels
     165    psImageKeepCircle (source->maskObj, source->peak->xf, source->peak->yf, *fitRadius, "OR", markVal);
     166
     167    return true;
     168}
     169# undef SCALE1
     170# undef SCALE2
     171# undef MIN_WINDOW
     172
     173# define MIN_WINDOW 5.0
     174# define SCALE1 5.0
     175# define PAD_WINDOW 3.0
     176
     177// call this function whenever you (re)-define the EXT model
     178// XXX alternate function to set exactly the desired window size
     179bool psphotSetRadiusMomentsExact (float *fitRadius, float *windowRadius, pmReadout *readout, pmSource *source, psImageMaskType markVal) {
     180
     181    psRegion newRegion;
     182
     183    psAssert (source, "source not defined??");
     184    psAssert (source->moments, "moments not defined??");
     185
     186    *fitRadius = SCALE1 * source->moments->Mrf;
     187    *fitRadius = PS_MIN (PS_MAX(*fitRadius, MIN_WINDOW), EXT_FIT_MAX_RADIUS);
     188
     189    *windowRadius = *fitRadius + PAD_WINDOW;
     190
     191    // check to see if new region is completely contained within old region
     192    newRegion = psRegionForSquare (source->peak->xf, source->peak->yf, *windowRadius);
     193    newRegion = psRegionForImage (readout->image, newRegion);
     194
     195    // redefine the pixels to match
     196    pmSourceRedefinePixelsByRegion (source, readout, newRegion);
    162197
    163198    // set the mask to flag the excluded pixels
Note: See TracChangeset for help on using the changeset viewer.