IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26596


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

pmSourceMoments now takes the image mask; it is not not an error to find no peaks in an image

Location:
branches/eam_branches/20091201/psphot/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/psphot/src/psphotFindDetections.c

    r26540 r26596  
    5353    psMetadataAddF32  (recipe, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold);
    5454    if (!detections->peaks) {
    55         // No peaks found
     55        // we only get a NULL peaks array due to a programming or config error.
     56        // this will result in a failure.
     57        psFree (detections);
     58        psError (PSPHOT_ERR_CONFIG, false, "failed on peak search");
    5659        return NULL;
    5760    }
  • branches/eam_branches/20091201/psphot/src/psphotFindPeaks.c

    r25755 r26596  
    1313    psArray *peaks = pmPeaksInImage (significance, threshold);
    1414    if (peaks == NULL) {
    15         // XXX should we be sending back an empty array instead of NULL?
    16         // XXX this may also be due to a programming or config error
     15        // we only get a NULL peaks array due to a programming or config error.
     16        // this will result in a failure.
     17        psError(PSPHOT_ERR_DATA, false, "no peaks found in this image");
     18        return NULL;
     19    }
     20
     21    if (peaks->n == 0) {
    1722        // XXX do we need to set something in the readout->analysis to indicate that
    1823        // we tried and failed to find peaks (something in the header data)
    19         psError(PSPHOT_ERR_DATA, false, "no peaks found in this image");
    20         return false;
     24        psLogMsg ("psphot", PS_LOG_INFO, "no peaks found in this image");
     25        return peaks;
    2126    }
    2227
  • branches/eam_branches/20091201/psphot/src/psphotModelTest.c

    r24588 r26596  
    139139
    140140    // get the source moments
    141     status = pmSourceMoments (source, mRADIUS, 0.0, 1.0);
     141    status = pmSourceMoments (source, mRADIUS, 0.0, 1.0, maskVal);
    142142    if (!status) psAbort("psSourceMoments error");
    143143    source->peak->value = source->moments->Peak;
  • branches/eam_branches/20091201/psphot/src/psphotMomentsStudy.c

    r24585 r26596  
    148148      pmSourceAdd(source, PM_MODEL_OP_FUNC, 0);
    149149
    150       pmSourceMoments (source, 32.0, sigWindow, 0.0);
     150      pmSourceMoments (source, 32.0, sigWindow, 0.0, 0xffff);
    151151      // fprintf (stderr, "sigOut : %f\n", sqrt(source->moments->Mxx));
    152152
  • branches/eam_branches/20091201/psphot/src/psphotPSFConvModel.c

    r25755 r26596  
    3939    // adjust the pixels based on the footprint
    4040    float radius = psphotSetRadiusEXT (readout, source, markVal);
    41     if (!pmSourceMoments (source, radius, 0.0, 0.0)) return false;
     41    if (!pmSourceMoments (source, radius, 0.0, 0.0, maskVal)) return false;
    4242
    4343    // XXX test : modify the Io, SXX, SYY terms based on the psf SXX, SYY terms:
  • branches/eam_branches/20091201/psphot/src/psphotReadout.c

    r26542 r26596  
    7676    pmDetections *detections = psphotFindDetections (NULL, readout, recipe);
    7777    if (!detections) {
     78        // this only happens if we had an error in psphotFindDetections
     79        psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
     80        return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
     81    }
     82    if (!detections->peaks->n) {
    7883        psLogMsg ("psphot", 3, "unable to find detections in this image");
    7984        return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
  • branches/eam_branches/20091201/psphot/src/psphotReadoutMinimal.c

    r26542 r26596  
    5151    detections = psphotFindDetections(detections, readout, recipe);
    5252    if (!detections) {
     53        psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
     54        return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
     55    }
     56    if (!detections->peaks->n) {
    5357        psLogMsg ("psphot", 3, "unable to find detections in this image");
    5458        return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL);
  • branches/eam_branches/20091201/psphot/src/psphotSourceFits.c

    r26507 r26596  
    235235    // at this stage, skip Gaussian windowing, and do not clip pixels by S/N
    236236    // this uses the footprint to judge both radius and aperture?
    237     if (!pmSourceMoments (source, radius, 0.0, 0.0)) return false;
     237    if (!pmSourceMoments (source, radius, 0.0, 0.0, maskVal)) return false;
    238238
    239239    psTrace ("psphot", 5, "trying blob...\n");
  • branches/eam_branches/20091201/psphot/src/psphotSourceStats.c

    r26317 r26596  
    325325
    326326        // measure basic source moments (no S/N clipping on input pixels)
    327         status = pmSourceMoments (source, RADIUS, SIGMA, 0.0);
     327        status = pmSourceMoments (source, RADIUS, SIGMA, 0.0, maskVal);
    328328        if (status) {
    329329            Nmoments ++;
     
    335335        BIG_RADIUS = PS_MIN (INNER, 3*RADIUS);
    336336        psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y);
    337         status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, 0.0);
     337        status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, 0.0, maskVal);
    338338        if (status) {
    339339            source->mode |= PM_SOURCE_MODE_BIG_RADIUS;
     
    394394
    395395            // measure basic source moments (no S/N clipping on input pixels)
    396             status = pmSourceMoments (source, 4*sigma[i], sigma[i], 0.0);
     396            status = pmSourceMoments (source, 4*sigma[i], sigma[i], 0.0, 0xffff);
    397397        }
    398398
Note: See TracChangeset for help on using the changeset viewer.