Changeset 11762 for trunk/psModules/src/objects
- Timestamp:
- Feb 12, 2007, 5:14:42 PM (19 years ago)
- Location:
- trunk/psModules/src/objects
- Files:
-
- 2 edited
-
pmSource.c (modified) (4 diffs)
-
pmSourceSky.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r11261 r11762 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-0 1-24 21:32:19$8 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-02-13 03:14:42 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 292 292 // find the peak in this image 293 293 stats = psStatsAlloc (PS_STAT_MAX); 294 stats = psImageStats (stats, splane, NULL, 0); 294 if (!psImageStats (stats, splane, NULL, 0)) { 295 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); 296 psFree(stats); 297 psFree(splane); 298 return emptyClump; 299 } 295 300 peaks = pmFindImagePeaks (splane, stats[0].max / 2); 296 301 psTrace ("psModules.objects", 2, "clump threshold is %f\n", stats[0].max/2); … … 544 549 pmSource data structure, along with the peak location, and determines the 545 550 various moments associated with that peak. 546 551 547 552 Requires the following to have been created: 548 553 pmSource … … 551 556 pmSource->weight 552 557 pmSource->mask 553 558 554 559 XXX: The peak calculations are done in image coords, not subImage coords. 555 560 556 561 XXX EAM : this version clips input pixels on S/N 557 562 XXX EAM : this version returns false for several reasons -
trunk/psModules/src/objects/pmSourceSky.c
r9594 r11762 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 200 6-10-17 02:21:03$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-02-13 03:14:42 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 pmSource *pmSourceLocalSky(source, statsOptions, Radius): this 34 34 routine creates a new pmSource.moments element if needed and sets pmSource.pmMoments.sky 35 35 36 36 The sky value is set from the pixels in the square annulus surrounding the 37 37 peak pixel. 38 38 39 39 The source.pixels and source.mask must already exist 40 40 *****************************************************************************/ … … 69 69 psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK); 70 70 psStats *myStats = psStatsAlloc(statsOptions); 71 myStats = psImageStats(myStats, image, mask, 0xff); 71 if (!psImageStats(myStats, image, mask, 0xff)) { 72 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); 73 psFree(myStats); 74 return false; 75 } 72 76 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK)); 73 77 double value = psStatsGetValue(myStats, statistic); … … 116 120 psImageMaskRegion(mask, srcRegion, "OR", PM_MASK_MARK); 117 121 psStats *myStats = psStatsAlloc(statsOptions); 118 myStats = psImageStats(myStats, image, mask, 0xff); 122 if (!psImageStats(myStats, image, mask, 0xff)) { 123 psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n"); 124 psFree(myStats); 125 return false; 126 } 119 127 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK)); 120 128 double value = psStatsGetValue(myStats, statistic);
Note:
See TracChangeset
for help on using the changeset viewer.
