Changeset 6062 for branches/eam_rel9_p0/psModules/src/detrend/pmFlatField.c
- Timestamp:
- Jan 19, 2006, 4:38:28 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/detrend/pmFlatField.c
r5795 r6062 24 24 * @author Ross Harman, MHPCC 25 25 * 26 * @version $Revision: 1.4.8.1 $ $Name: not supported by cvs2svn $27 * @date $Date: 200 5-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 $ 28 28 * 29 29 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 44 44 45 45 46 bool pmFlatField(pmReadout *in, pmReadout *mask,const pmReadout *flat)46 bool pmFlatField(pmReadout *in, const pmReadout *flat) 47 47 { 48 // XXX: Not sure if this is correct. Must consult with IfA.49 PS_ASSERT_PTR_NON_NULL(mask, false);50 48 int i = 0; 51 49 int j = 0; … … 80 78 return false; 81 79 } 82 inMask = mask->image;80 inMask = in->mask; 83 81 84 82 // Check input image and its mask are not larger than flat image … … 90 88 return false; 91 89 } 92 if (inMask ->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols) {90 if (inMask && (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols)) { 93 91 psError( PS_ERR_BAD_PARAMETER_SIZE, true, 94 92 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE, … … 112 110 totOffRow, totOffCol, inImage->numRows, inImage->numCols); 113 111 return false; 114 } else if( totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {112 } else if(inMask && (totOffRow>=inMask->numRows || totOffCol>=inMask->numCols)) { 115 113 psError( PS_ERR_BAD_PARAMETER_SIZE, true, 116 114 PS_ERRORTEXT_pmFlatField_OFFSET_MASK_IMAGE, … … 122 120 inType = inImage->type.type; 123 121 flatType = flatImage->type.type; 124 maskType = inMask->type.type;125 122 if(PS_IS_PSELEMTYPE_COMPLEX(inType)) { 126 123 psError( PS_ERR_BAD_PARAMETER_TYPE, true, … … 133 130 flatType); 134 131 return false; 135 } else if( maskType != PS_TYPE_MASK) {132 } else if(inMask && inMask->type.type != PS_TYPE_MASK) { 136 133 psError( PS_ERR_BAD_PARAMETER_TYPE, true, 137 134 PS_ERRORTEXT_pmFlatField_TYPE_MASK_IMAGE, … … 153 150 if(flatImage->data.TYPE[j][i] <= 0.0) { \ 154 151 /* 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 } \ 156 155 flatImage->data.TYPE[j][i] = 0.0; \ 157 156 } \ … … 160 159 for(j = totOffRow; j < inImage->numRows; j++) { \ 161 160 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]) { \ 163 162 /* Module shall divide the input image by the flat-fielded image */ \ 164 163 inImage->data.TYPE[j][i] /= flatImage->data.TYPE[j][i]; \
Note:
See TracChangeset
for help on using the changeset viewer.
