IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:12:39 PM (15 years ago)
Author:
eugene
Message:

use the smoothed image for footprint culling; use a more stringent culling for saturated stars; more tweaks to get sat stars to be fitted; various updates to psphotStack; unify psphotImageLoop varients; be a bit careful about number of stars in a PSF clump

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotSignificanceImage.c

    r29548 r31154  
    44// (S/N)^2.  If FWMH_X,Y have been recorded, use them, otherwise use PEAKS_SMOOTH_SIGMA for the
    55// smoothing kernel.
    6 psImage *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, psImageMaskType maskVal) {
     6pmReadout *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, psImageMaskType maskVal) {
    77
    88    float SIGMA_SMTH, NSIGMA_SMTH;
     
    2121        minGauss = 0.5;
    2222    }
     23
     24    // NOTE: for a faint extended-source detection pass, we over-smooth by SOMETHING
    2325
    2426    // if we have already determined the PSF model, then we have a better idea how to smooth this image
     
    9294    psMetadataAddF32(readout->analysis, PS_LIST_TAIL, "SIGNIFICANCE_SCALE_FACTOR", PS_META_REPLACE, "Signicance scale factor", factor);
    9395
    94     // XXX multithread this if needed
     96    // we are going to return both the image and the weight here: the image contains the signal
     97    // while the 'weight' will contain the significance (NOTE the deviation from the usual
     98    // definition)
     99
     100    // save the smoothed significance image in the weight array
    95101    for (int j = 0; j < smooth_im->numRows; j++) {
    96102        for (int i = 0; i < smooth_im->numCols; i++) {
    97103            float value = smooth_im->data.F32[j][i];
    98104            if (value < 0 || smooth_wt->data.F32[j][i] <= 0 || (mask->data.PS_TYPE_IMAGE_MASK_DATA[j][i] & maskVal)) {
    99                 smooth_im->data.F32[j][i] = 0.0;
     105                smooth_wt->data.F32[j][i] = 0.0;
    100106            } else {
    101                 float v2 = value + PS_SQR(value/1000.0);
    102                 smooth_im->data.F32[j][i] = factor * PS_SQR(v2) / smooth_wt->data.F32[j][i];
     107                // XXX the value of 100 here (or 1000 before) must depend on the FWHM of the smoothing kernel, right??
     108                float v2 = value + PS_SQR(value/100.0);
     109                smooth_wt->data.F32[j][i] = factor * PS_SQR(v2) / smooth_wt->data.F32[j][i];
    103110            }
    104111        }
     
    112119        static int pass = 0;
    113120        sprintf (name, "snsmooth.v%d.fits", pass);
    114         psphotSaveImage (NULL, smooth_im, name);
     121        psphotSaveImage (NULL, smooth_wt, name);
    115122        pass ++;
    116123    }
    117 
    118     psFree(smooth_wt);
    119 
    120124    psImageConvolveSetThreads(oldThreads);
    121125
    122     return smooth_im;
     126    pmReadout *significanceRO = pmReadoutAlloc(NULL);
     127    significanceRO->variance = smooth_wt;   
     128    significanceRO->image = smooth_im;   
     129
     130    return significanceRO;
    123131}
    124132
Note: See TracChangeset for help on using the changeset viewer.