IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26594


Ignore:
Timestamp:
Jan 14, 2010, 10:19:12 AM (16 years ago)
Author:
eugene
Message:

pmSourceMoments now takes a mask value and correctly ANDs the image mask against that (needed to handle SUSPECT as opposed to BAD pixels); pmPeaks returns an empty, but non NON peak array if no peaks are found (this is a valid result)

Location:
branches/eam_branches/20091201/psModules/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psModules/src/imcombine/pmPSFEnvelope.c

    r25754 r26594  
    6565                     int radius,        // Radius of each PSF
    6666                     const char *modelName,// Name of PSF model to use
    67                      int xOrder, int yOrder // Order for PSF variation fit
     67                     int xOrder, int yOrder, // Order for PSF variation fit
     68                     psImageMaskType maskVal
    6869                     )
    6970{
     
    360361
    361362        // measure the source moments: tophat windowing, no pixel S/N cutoff
    362         if (!pmSourceMoments(source, maxRadius, 0.0, 1.0)) {
     363        // XXX probably should be passing the maskVal to this function so we can pass it along here...
     364        if (!pmSourceMoments(source, maxRadius, 0.0, 1.0, maskVal)) {
    363365            // Can't do anything about it; limp along as best we can
    364366            psErrorClear();
  • branches/eam_branches/20091201/psModules/src/imcombine/pmPSFEnvelope.h

    r15837 r26594  
    1717                     int radius,        // Radius of each PSF
    1818                     const char *modelName, // Name of PSF model to use
    19                      int xOrder, int yOrder // Order for PSF variation
     19                     int xOrder, int yOrder, // Order for PSF variation
     20                     psImageMaskType maskVal
    2021    );
    2122
  • branches/eam_branches/20091201/psModules/src/objects/pmPeaks.c

    r25754 r26594  
    375375    psU32 col = 0;
    376376    psU32 row = 0;
    377     psArray *list = NULL;
     377    psArray *list = psArrayAllocEmpty(100);
    378378
    379379    // Find peaks in row 0 only.
     
    416416
    417417        } else {
    418             psError(PS_ERR_UNKNOWN, true, "peak specified valid column range.");
     418            psLogMsg ("psModules.objects", 5, "peak specified outside valid column range.");
    419419        }
    420420    }
     
    501501                }
    502502            } else {
    503                 psError(PS_ERR_UNKNOWN, true, "peak specified outside valid column range.");
     503                psLogMsg ("psModules.objects", 5, "peak specified outside valid column range.");
    504504            }
    505505
     
    545545            }
    546546        } else {
    547             psError(PS_ERR_UNKNOWN, true, "peak specified outside valid column range.");
     547            psLogMsg ("psModules.objects", 5, "peak specified outside valid column range.");
    548548        }
    549549    }
  • branches/eam_branches/20091201/psModules/src/objects/pmSource.c

    r26523 r26594  
    409409
    410410        // if we failed to find a valid peak, return the empty clump (failure signal)
    411         if (peaks == NULL)
     411        if (peaks == NULL) {
     412            psError(PS_ERR_UNKNOWN, false, "failure in peak analysis for PSF clump.\n");
     413            return emptyClump;
     414        }
     415
     416        if (peaks->n == 0)
    412417        {
    413418            psLogMsg ("psphot", 3, "failed to find a peak in the PSF clump image\n");
  • branches/eam_branches/20091201/psModules/src/objects/pmSource.h

    r25754 r26594  
    220220    float radius,     ///< Use a circle of pixels around the peak
    221221    float sigma,      ///< size of Gaussian window function (<= 0.0 -> skip window)
    222     float minSN       ///< minimum pixel significance
     222    float minSN,              ///< minimum pixel significance
     223    psImageMaskType maskVal
    223224);
    224225
  • branches/eam_branches/20091201/psModules/src/objects/pmSourceMoments.c

    r26426 r26594  
    5454# define VALID_RADIUS(X,Y,RAD2) (((RAD2) >= (PS_SQR(X) + PS_SQR(Y))) ? 1 : 0)
    5555
    56 bool pmSourceMoments(pmSource *source, psF32 radius, psF32 sigma, psF32 minSN)
     56bool pmSourceMoments(pmSource *source, psF32 radius, psF32 sigma, psF32 minSN, psImageMaskType maskVal)
    5757{
    5858    PS_ASSERT_PTR_NON_NULL(source, false);
     
    114114        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
    115115            if (vMsk) {
    116                 if (*vMsk) {
     116                if (*vMsk & maskVal) {
    117117                    vMsk++;
    118118                    continue;
     
    226226        for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) {
    227227            if (vMsk) {
    228                 if (*vMsk) {
     228                if (*vMsk & maskVal) {
    229229                    vMsk++;
    230230                    continue;
Note: See TracChangeset for help on using the changeset viewer.