Changeset 4251 for trunk/psphot/src/LocalSky.c
- Timestamp:
- Jun 14, 2005, 3:23:24 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/LocalSky.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/LocalSky.c
r4216 r4251 7 7 psF32 Radius) 8 8 { 9 psRegion *srcRegion; 10 9 11 // Grab a subimage of the original image of size (2 * outerRadius). 10 12 srcRegion = psRegionSquare (x, y, Radius); 11 srcRegion = psRegionForImage (srcRegion, imdata->image );13 srcRegion = psRegionForImage (srcRegion, imdata->image, srcRegion); 12 14 13 psImage *subImage = psImageSubset(imdata->image, srcRegion); 14 psImage *subImageMask = psImageSubset(imdata->mask, srcRegion); 15 psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion); 15 // psImage *subImage = psImageSubset(imdata->image, srcRegion); 16 // psImage *subImageMask = psImageSubset(imdata->mask, srcRegion); 17 // psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion); 18 19 psImage *subImage = psImageSubset(imdata->image, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1); 20 psImage *subImageMask = psImageSubset(imdata->mask, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1); 21 psImage *subImageNoise = psImageSubset(imdata->noise, srcRegion->x0, srcRegion->y0, srcRegion->x1, srcRegion->y1); 16 22 17 23 mySource->pixels = subImage; … … 30 36 psImage *image = source->pixels; 31 37 psImage *mask = source->mask; 32 psImage *peak = source->peak; 38 psPeak *peak = source->peak; 39 psRegion *srcRegion; 33 40 34 41 srcRegion = psRegionSquare (peak->x, peak->y, Radius); 35 srcRegion = psRegionForImage (srcRegion, imdata->mask);36 psImageMaskRegion ( imdata->mask, region, OR, 0x80);42 srcRegion = psRegionForImage (srcRegion, mask, srcRegion); 43 psImageMaskRegion (mask, srcRegion, OR, 0x80); 37 44 38 45 psStats *myStats = psStatsAlloc(statsOptions); 39 46 myStats = psImageStats(myStats, image, mask, 0xff); 40 psImageMaskRegion ( imdata->mask, region, AND, 0x7f);47 psImageMaskRegion (mask, srcRegion, AND, 0x7f); 41 48 42 mySource->moments = pmMomentsAlloc();49 source->moments = pmMomentsAlloc(); 43 50 psF64 tmpF64; 44 51 p_psGetStatValue(myStats, &tmpF64); 45 mySource->moments->Sky = (psF32) tmpF64;52 source->moments->Sky = (psF32) tmpF64; 46 53 47 54 return (true); 48 55 } 49 56 50 // define a square region centered on the given coordinate51 psRegion *psRegionSquare (psF32 x, psF32 y, psF32 radius) {52 region = psRegionAlloc (x - Radius, y - Radius, x + Radius + 1, y + Radius + 1);53 return (region);54 }
Note:
See TracChangeset
for help on using the changeset viewer.
