IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12756


Ignore:
Timestamp:
Apr 5, 2007, 1:57:42 PM (19 years ago)
Author:
Paul Price
Message:

Only attempt variance or mask interpolation if the image is provided.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageInterpolate.c

    r12741 r12756  
    77 *  @author Paul Price, IfA
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-04-04 22:42:02 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-04-05 23:57:42 $
    1111 *
    1212 *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    9595                *imageValue = options->image->data.TYPE[yInt][xInt]; \
    9696            } \
    97             if (varianceValue) { \
     97            if (varianceValue && options->variance) { \
    9898                *varianceValue = options->variance->data.TYPE[yInt][xInt]; \
    9999            } \
     
    118118        }
    119119
    120         if (maskValue) {
     120        if (maskValue && options->mask) {
    121121            *maskValue = options->mask->data.PS_TYPE_MASK_DATA[yInt][xInt];
    122122        }
     
    256256
    257257    // Check the mask value
    258     if (maskValue) {
    259         const psImage *mask = options->mask; // Image mask
     258    const psImage *mask = options->mask; // Image mask
     259    if (maskValue && mask) {
    260260        psMaskType maskVal = options->maskVal; // Mask value
    261261        double badValue = 0.0;          // Amount of flux in bad pixels
     
    282282
    283283    // Finally, the variance
    284     if (varianceValue) {
    285         const psImage *variance = options->variance; // Image variance
     284    const psImage *variance = options->variance; // Image variance
     285    if (varianceValue && variance) {
    286286        *varianceValue = 0.0;
    287287
     
    469469
    470470    // Check the mask value
    471     if (maskValue) {
    472         const psImage *mask = options->mask; // Image mask
     471    const psImage *mask = options->mask; // Image mask
     472    if (maskValue && mask) {
    473473        psMaskType maskVal = options->maskVal; // Mask value
    474474        double badValue = 0.0;          // Amount of flux in bad pixels
     
    499499
    500500    // Finally, the variance
    501     if (varianceValue) {
    502         const psImage *variance = options->variance; // Image variance
     501    const psImage *variance = options->variance; // Image variance
     502    if (varianceValue && variance) {
    503503        *varianceValue = 0.0;
    504504
     
    549549
    550550    PS_ASSERT_IMAGE_NON_NULL(image, false);
    551     if (varianceValue) {
     551    if (varianceValue && variance) {
    552552        PS_ASSERT_IMAGE_NON_NULL(variance, false);
    553553        PS_ASSERT_IMAGE_TYPE(variance, image->type.type, false);
    554554        PS_ASSERT_IMAGES_SIZE_EQUAL(variance, image, false);
    555555    }
    556     if (maskValue) {
     556    if (maskValue && mask) {
    557557        PS_ASSERT_IMAGE_NON_NULL(mask, false);
    558558        PS_ASSERT_IMAGE_TYPE(mask, PS_TYPE_MASK, false);
Note: See TracChangeset for help on using the changeset viewer.