IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 11, 2011, 1:40:19 PM (15 years ago)
Author:
eugene
Message:

fix OFF_CHIP bit: was comparing chip position to the subraster, not the full image

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/psModules/src/objects/pmSourcePhotometry.c

    r32853 r32923  
    543543    int yChip = source->peak->y;
    544544
     545    // need to access the parent if we are looking at a subimage (likely)
     546    psImage *chipImage = (source->pixels == NULL) ? source->pixels : (psImage *) source->pixels->parent;
     547
    545548    bool onChip = true;
    546549    onChip &= (xChip >= 0);
    547     onChip &= (xChip < mask->numCols);
     550    onChip &= (xChip < chipImage->numCols);
    548551    onChip &= (yChip >= 0);
    549     onChip &= (yChip < mask->numRows);
     552    onChip &= (yChip < chipImage->numRows);
    550553    if (!onChip) {
    551554        // if the source is off the edge of the chip, raise a different bit?
    552555        source->mode |= PM_SOURCE_MODE_OFF_CHIP;
    553556    } else {
    554         psImageMaskType maskValue = mask->data.PS_TYPE_IMAGE_MASK_DATA[yChip][xChip];
     557        int xMask = xChip - mask->col0;
     558        int yMask = yChip - mask->row0;
     559        psImageMaskType maskValue = mask->data.PS_TYPE_IMAGE_MASK_DATA[yMask][xMask];
    555560        if (maskValue & maskGhost) {
    556561            source->mode |= PM_SOURCE_MODE_ON_GHOST;
Note: See TracChangeset for help on using the changeset viewer.