Changeset 6556 for branches/rel10_ifa/psModules/src/objects/pmSourceSky.c
- Timestamp:
- Mar 8, 2006, 5:14:23 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/objects/pmSourceSky.c
r6537 r6556 1 /** @file pmSourceSky.c 2 * 3 * Functions to measure the local sky and sky variance for sources on images 4 * 5 * @author GLG, MHPCC 6 * @author EAM, IfA: significant modifications. 7 * 8 * @version $Revision: 1.1.2.2 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-03-09 03:14:23 $ 10 * 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 12 * 13 */ 14 15 #include <stdio.h> 16 #include <math.h> 17 #include <string.h> 18 #include "pslib.h" 19 #include "pmHDU.h" 20 #include "pmFPA.h" 21 #include "pmPeaks.h" 22 #include "pmMoments.h" 23 #include "pmModel.h" 24 #include "pmSource.h" 25 #include "pmSourceSky.h" 1 26 2 27 /****************************************************************************** 3 pmSource *pmSourceLocalSky(image, peak, innerRadius, outerRadius): this 4 routine creates a new pmSource data structure and sets the following members: 5 ->pmPeak 6 ->pmMoments->sky 28 pmSource *pmSourceLocalSky(source, statsOptions, Radius): this 29 routine creates a new pmSource.moments element if needed and sets pmSource.pmMoments.sky 7 30 8 31 The sky value is set from the pixels in the square annulus surrounding the 9 32 peak pixel. 10 33 11 We simply create a subSet image and mask the inner pixels, then call 12 psImageStats on that subImage+mask. 13 14 XXX: The subImage has width of 1+2*outerRadius. Verify with IfA. 15 16 XXX: Use static data structures for: 17 subImage 18 subImageMask 19 myStats 20 21 XXX: ensure that the inner and out radius fit in the actual image. Should 22 we generate an error, or warning? Currently an error. 23 24 XXX: Sync with IfA on whether the peak x/y coords are data structure coords, 25 or they use the image row/column offsets. 26 XXX EAM : peak->x,y uses parent coordinates 27 28 XXX: Should we simply set pmSource->peak = peak? If so, should we increase 29 the reference counter? Or, should we copy the data structure? 30 31 XXX: Currently the subimage always has an even number of rows/columns. Is 32 this correct? Since there is a center pixel, maybe it should have an 33 odd number of rows/columns. 34 35 XXX: Use psTrace() for the print statements. 36 37 XXX: Don't use separate structs for the subimage and mask. Use the source-> 38 members. 34 The source.pixels and source.mask must already exist 39 35 *****************************************************************************/ 40 36 … … 60 56 srcRegion = psRegionForImage(mask, srcRegion); 61 57 62 psImageMaskRegion(mask, srcRegion, "OR", P SPHOT_MASK_MARKED);58 psImageMaskRegion(mask, srcRegion, "OR", PM_SOURCE_MASK_MARKED); 63 59 psStats *myStats = psStatsAlloc(statsOptions); 64 60 myStats = psImageStats(myStats, image, mask, 0xff); 65 psImageMaskRegion(mask, srcRegion, "AND", ~P SPHOT_MASK_MARKED);61 psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED); 66 62 67 63 psF64 tmpF64; … … 103 99 srcRegion = psRegionForImage(mask, srcRegion); 104 100 105 psImageMaskRegion(mask, srcRegion, "OR", P SPHOT_MASK_MARKED);101 psImageMaskRegion(mask, srcRegion, "OR", PM_SOURCE_MASK_MARKED); 106 102 psStats *myStats = psStatsAlloc(statsOptions); 107 103 myStats = psImageStats(myStats, image, mask, 0xff); 108 psImageMaskRegion(mask, srcRegion, "AND", ~P SPHOT_MASK_MARKED);104 psImageMaskRegion(mask, srcRegion, "AND", ~PM_SOURCE_MASK_MARKED); 109 105 110 106 psF64 tmpF64;
Note:
See TracChangeset
for help on using the changeset viewer.
