IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

updates to pmPeak to better distinguish peak flux versions; updates to visualization; add bits for substantial suspect masking; consolidate assignment of source position and flux based on peak, moments, etc; improve footprint culling process; fix PSF_QF and PSF_QF_PERFECT calculations; fix source model chisq values

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

    • Property svn:ignore
      •  

        old new  
        2828ChangeLog
        2929psmodules-*.tar.*
         30a.out.dSYM
  • trunk/psModules/test/objects/tap_pmPeaks.c

    r15985 r31153  
    650650    ok(test_pmPeaksInImage(TST02_NUM_ROWS, 2*TST02_NUM_COLS),
    651651      "Tested pmPeaksInImage() on (%d, %d) image", TST02_NUM_ROWS, 2*TST02_NUM_COLS);
    652 
    653 
    654     // ------------------------------------------------------------------------
    655     // Test pmPeaksSubset()
    656     // Calling pmPeaksSubset with NULL psList.  Should generate error.
    657     {
    658         psMemId id = psMemGetId();
    659         psArray *outData = pmPeaksSubset(NULL, 0.0, psRegionSet(0, 0, 0, 0));
    660         ok(outData == NULL, "pmPeaksSubset() returned a NULL with a NULL psArray input");
    661         psFree(outData);
    662         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    663     }
    664 
    665 
    666     // Set peaks in input image.  All even-column and even-row pixels are
    667     // set non-zero, all other pixels are set to zero.
    668     psImage *imgData = psImageAlloc(NUM_COLS, NUM_ROWS, PS_TYPE_F32);
    669     psS32 numPeaksOrig = 0;
    670     for (psS32 i = 0 ; i < NUM_ROWS ; i++) {
    671         for (psS32 j = 0 ; j < NUM_COLS ; j++) {
    672             if ((0 == i%2) && (0 == j%2)) {
    673                 imgData->data.F32[i][j] = (float) (i + 10);
    674                 numPeaksOrig++;
    675             } else {
    676                 imgData->data.F32[i][j] = 0.0;
    677             }
    678         }
    679     }
    680     // Call pmPeaksSubset() with large maxValue and disjoint psRegion.
    681     // Should not remove any peaks.
    682     {
    683         psMemId id = psMemGetId();
    684         psArray *outData = pmPeaksInImage(imgData, 0.0);
    685         psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, psRegionSet(20, 20, 20, 20));
    686         ok(outData2 != NULL && psMemCheckArray(outData),
    687            "pmPeaksSubset() returned a non-NULL psArray (large maxValue)");
    688         ok(outData2->n == numPeaksOrig,
    689           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n+1, numPeaksOrig);
    690         psFree(outData);
    691         psFree(outData2);
    692         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    693     }
    694 
    695 
    696     // Call pmPeaksSubset() with small maxValue and disjoint psRegion.
    697     // Should not remove any peaks.
    698     {
    699         psMemId id = psMemGetId();
    700         psArray *outData = pmPeaksInImage(imgData, 0.0);
    701         psArray *outData2 = pmPeaksSubset(outData, 0.0, psRegionSet(20, 20, 20, 20));
    702         ok(outData2 != NULL && psMemCheckArray(outData),
    703            "pmPeaksSubset() returned a non-NULL psArray (small maxValue)");
    704         ok(outData2->n == 0,
    705           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    706         psFree(outData);
    707         psFree(outData2);
    708         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    709     }
    710 
    711 
    712     // Call pmPeaksSubset() with large maxValue and enclosing psRegion.
    713     // Should remove aall peaks.
    714     {
    715         psMemId id = psMemGetId();
    716         psArray *outData = pmPeaksInImage(imgData, 0.0);
    717         psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
    718         psArray *outData2 = pmPeaksSubset(outData, PS_MAX_F32, tmpRegion);
    719         ok(outData2 != NULL && psMemCheckArray(outData),
    720            "pmPeaksSubset() returned a non-NULL psArray (small maxValue, enclosing psRegion)");
    721         ok(outData2->n == 0,
    722           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    723         psFree(outData);
    724         psFree(outData2);
    725         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    726     }
    727 
    728 
    729     // Call pmPeaksSubset() with large maxValue and enclosing psRegion.
    730     // Should remove aall peaks.
    731     {
    732         psMemId id = psMemGetId();
    733         psArray *outData = pmPeaksInImage(imgData, 0.0);
    734         psRegion tmpRegion = psRegionSet(-PS_MAX_F32, PS_MAX_F32, -PS_MAX_F32, PS_MAX_F32);
    735         psArray *outData2 = pmPeaksSubset(outData, 0.0, tmpRegion);
    736         ok(outData2 != NULL && psMemCheckArray(outData),
    737            "pmPeaksSubset() returned a non-NULL psArray (small maxValue, inclusive psRegion)");
    738         ok(outData2->n == 0,
    739           "pmPeaksSubset() returned correct number of peaks (was %d, should be %d)", outData2->n, 0);
    740         psFree(outData);
    741         psFree(outData2);
    742         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    743     }
    744652}
Note: See TracChangeset for help on using the changeset viewer.