IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 13, 2006, 8:26:56 PM (19 years ago)
Author:
magnier
Message:

adding error checks and forcing image limits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/camera/pmFPAMosaic.c

    r10517 r10713  
    996996            hdu = source->parent->hdu;
    997997        }
    998         mosaicImage = psMemIncrRefCounter(psImageSubset(hdu->images->data[0], *chipRegion));
     998        // force limits to land on chip
     999        psRegion bounds = psRegionForImage (hdu->images->data[0], *chipRegion);
     1000        mosaicImage = psMemIncrRefCounter(psImageSubset(hdu->images->data[0], bounds));
     1001        if (!mosaicImage) {
     1002            psError(PS_ERR_UNKNOWN, false, "Unable to select image pixels.\n");
     1003            return false;
     1004        }
    9991005        if (hdu->masks) {
    1000             mosaicMask = psMemIncrRefCounter(psImageSubset(hdu->masks->data[0], *chipRegion));
     1006            mosaicMask = psMemIncrRefCounter(psImageSubset(hdu->masks->data[0], bounds));
     1007            if (!mosaicMask) {
     1008                psError(PS_ERR_UNKNOWN, false, "Unable to select mask pixels.\n");
     1009                return false;
     1010            }
    10011011        }
    10021012        if (hdu->weights) {
    1003             mosaicWeights = psMemIncrRefCounter(psImageSubset(hdu->weights->data[0], *chipRegion));
     1013            mosaicWeights = psMemIncrRefCounter(psImageSubset(hdu->weights->data[0], bounds));
     1014            if (!mosaicWeights) {
     1015                psError(PS_ERR_UNKNOWN, false, "Unable to select weight pixels.\n");
     1016                return false;
     1017            }
    10041018        }
    10051019    } else {
Note: See TracChangeset for help on using the changeset viewer.