IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 14, 2005, 3:23:24 AM (21 years ago)
Author:
eugene
Message:

mask/noise are working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/LocalSky.c

    r4216 r4251  
    77                          psF32 Radius)
    88{
     9    psRegion *srcRegion;
     10
    911    // Grab a subimage of the original image of size (2 * outerRadius).
    1012    srcRegion = psRegionSquare (x, y, Radius);
    11     srcRegion = psRegionForImage (srcRegion, imdata->image);
     13    srcRegion = psRegionForImage (srcRegion, imdata->image, srcRegion);
    1214
    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);
    1622
    1723    mySource->pixels = subImage;
     
    3036    psImage *image = source->pixels;
    3137    psImage *mask  = source->mask;
    32     psImage *peak  = source->peak;
     38    psPeak *peak  = source->peak;
     39    psRegion *srcRegion;
    3340
    3441    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);
    3744
    3845    psStats *myStats = psStatsAlloc(statsOptions);
    3946    myStats = psImageStats(myStats, image, mask, 0xff);
    40     psImageMaskRegion (imdata->mask, region, AND, 0x7f);
     47    psImageMaskRegion (mask, srcRegion, AND, 0x7f);
    4148
    42     mySource->moments = pmMomentsAlloc();
     49    source->moments = pmMomentsAlloc();
    4350    psF64 tmpF64;
    4451    p_psGetStatValue(myStats, &tmpF64);
    45     mySource->moments->Sky = (psF32) tmpF64;
     52    source->moments->Sky = (psF32) tmpF64;
    4653
    4754    return (true);
    4855}
    4956
    50 // define a square region centered on the given coordinate
    51 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.