IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 19, 2006, 4:38:28 PM (21 years ago)
Author:
Paul Price
Message:

Getting a working ppImage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_rel9_p0/psModules/src/detrend/pmFlatField.c

    r5795 r6062  
    2424 *  @author Ross Harman, MHPCC
    2525 *
    26  *  @version $Revision: 1.4.8.1 $ $Name: not supported by cvs2svn $
    27  *  @date $Date: 2005-12-17 03:18:39 $
     26 *  @version $Revision: 1.4.8.1.2.1 $ $Name: not supported by cvs2svn $
     27 *  @date $Date: 2006-01-20 02:38:28 $
    2828 *
    2929 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4444
    4545
    46 bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat)
     46bool pmFlatField(pmReadout *in, const pmReadout *flat)
    4747{
    48     // XXX: Not sure if this is correct.  Must consult with IfA.
    49     PS_ASSERT_PTR_NON_NULL(mask, false);
    5048    int i = 0;
    5149    int j = 0;
     
    8078        return false;
    8179    }
    82     inMask = mask->image;
     80    inMask = in->mask;
    8381
    8482    // Check input image and its mask are not larger than flat image
     
    9088        return false;
    9189    }
    92     if (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols) {
     90    if (inMask && (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols)) {
    9391        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    9492                 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE,
     
    112110                 totOffRow, totOffCol, inImage->numRows, inImage->numCols);
    113111        return false;
    114     } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {
     112    } else if(inMask && (totOffRow>=inMask->numRows || totOffCol>=inMask->numCols)) {
    115113        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    116114                 PS_ERRORTEXT_pmFlatField_OFFSET_MASK_IMAGE,
     
    122120    inType = inImage->type.type;
    123121    flatType = flatImage->type.type;
    124     maskType = inMask->type.type;
    125122    if(PS_IS_PSELEMTYPE_COMPLEX(inType)) {
    126123        psError( PS_ERR_BAD_PARAMETER_TYPE, true,
     
    133130                 flatType);
    134131        return false;
    135     } else if(maskType != PS_TYPE_MASK) {
     132    } else if(inMask && inMask->type.type != PS_TYPE_MASK) {
    136133        psError( PS_ERR_BAD_PARAMETER_TYPE, true,
    137134                 PS_ERRORTEXT_pmFlatField_TYPE_MASK_IMAGE,
     
    153150            if(flatImage->data.TYPE[j][i] <= 0.0) {                                                          \
    154151                /* Negative or zero flat pixels shall be masked in input image as  PM_MASK_FLAT */           \
    155                 inMask->data.PS_TYPE_MASK_DATA[j][i] |= PM_MASK_FLAT;                                        \
     152                if (inMask) {                                                                                \
     153                    inMask->data.PS_TYPE_MASK_DATA[j][i] |= PM_MASK_FLAT;                                    \
     154                }                                                                                            \
    156155                flatImage->data.TYPE[j][i] = 0.0;                                                            \
    157156            }                                                                                                \
     
    160159    for(j = totOffRow; j < inImage->numRows; j++) {                                                          \
    161160        for(i = totOffCol; i < inImage->numCols; i++) {                                                      \
    162             if(!inMask->data.PS_TYPE_MASK_DATA[j][i]) {                                                      \
     161            if(inMask && !inMask->data.PS_TYPE_MASK_DATA[j][i]) {                                            \
    163162                /* Module shall divide the input image by the flat-fielded image */                          \
    164163                inImage->data.TYPE[j][i] /= flatImage->data.TYPE[j][i];                                      \
Note: See TracChangeset for help on using the changeset viewer.