Changeset 1849 for trunk/psModules/src/pmFlatField.c
- Timestamp:
- Sep 22, 2004, 9:58:57 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmFlatField.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmFlatField.c
r1832 r1849 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $21 * @date $Date: 2004-09-2 0 20:36:46$20 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2004-09-22 19:58:57 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 31 31 #include<math.h> 32 32 33 #include "pslib.h" 33 34 #include "pmFlatField.h" 34 35 #include "pmMaskBadPixels.h" … … 50 51 // Check for nulls 51 52 if (in == NULL) { 52 psError(__func__, " : Line %d - Null not allowed for input readout", __LINE__);53 53 return false; 54 54 } else if(flat==NULL) { … … 71 71 72 72 // Check input image and its mask are not larger than flat image 73 if(inImage->numRows > flatImage->numRows) {74 psError(__func__, " : Line %d - Input image exceeds mask image in number of rows. (%d vs %d).",75 __LINE__, inImage->numRows, flatImage->numRows);73 if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) { 74 psError(__func__, " : Line %d - Input image size exceeds that of flat image: (%d, %d) vs (%d, %d)", 75 __LINE__, inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols); 76 76 return false; 77 } else if(inImage->numCols > flatImage->numCols) { 78 psError(__func__, " : Line %d - Input image exceeds mask image in number of columns. (%d vs %d).", 79 __LINE__, inImage->numCols, flatImage->numCols); 80 return false; 81 } else if(inMask->numRows > flatImage->numRows) { 82 psError(__func__, " : Line %d - Input image mask exceeds mask image in number of rows. (%d vs %d).", 83 __LINE__, inImage->numRows, flatImage->numRows); 84 return false; 85 } else if(inMask->numCols > flatImage->numCols) { 86 psError(__func__, " : Line %d - Input image mask exceeds mask image in number of columns. (%d vs %d).", 87 __LINE__, inImage->numCols, flatImage->numCols); 77 } else if(inMask->numRows>flatImage->numRows || inMask->numCols > flatImage->numCols) { 78 psError(__func__, " : Line %d - Input image mask size exceeds that of flat image: (%d, %d) vs (%d, %d)", 79 __LINE__, inMask->numRows, inMask->numCols, flatImage->numRows, flatImage->numCols); 88 80 return false; 89 81 } … … 94 86 95 87 // Check that offsets are within image limits 96 if(totOffRow > flatImage->numRows-1) {97 psError(__func__, " : Line %d - Initial row offset exceeds that of mask image. (%d vs %d).",98 __LINE__, totOffRow, flatImage->numRows);88 if(totOffRow>=flatImage->numRows || totOffCol>=flatImage->numCols) { 89 psError(__func__, " : Line %d - Total offset >= flat image size: (%d, %d) vs (%d, %d)", 90 __LINE__, totOffRow, totOffCol, flatImage->numRows, flatImage->numCols); 99 91 return false; 100 } else if(totOff Col > flatImage->numCols-1) {101 psError(__func__, " : Line %d - Initial column offset exceeds that of mask image. (%d vs %d).",102 __LINE__, totOff Col, flatImage->numCols);92 } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) { 93 psError(__func__, " : Line %d - Total offset >= input image: (%d, %d) vs (%d, %d)", 94 __LINE__, totOffRow, totOffCol, inImage->numRows, inImage->numCols); 103 95 return false; 104 } else if(totOffRow > inImage->numRows-1) { 105 psError(__func__, " : Line %d - Initial row offset exceeds that of input image. (%d vs %d).", 106 __LINE__, totOffRow, inImage->numRows); 107 return false; 108 } else if(totOffCol > inImage->numCols-1) { 109 psError(__func__, " : Line %d - Initial column offset exceeds that of input image. (%d vs %d).", 110 __LINE__, totOffCol, inImage->numCols); 111 return false; 112 } else if(totOffRow > inMask->numRows-1) { 113 psError(__func__, " : Line %d - Initial row offset exceeds that of input image mask. (%d vs %d).", 114 __LINE__, totOffRow, inMask->numRows); 115 return false; 116 } else if(totOffCol > inMask->numCols-1) { 117 psError(__func__, " : Line %d - Initial column offset exceeds that of input image mask. (%d vs %d).", 118 __LINE__, totOffCol, inMask->numCols); 96 } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) { 97 psError(__func__, " : Line %d - Total offset >= input image mask: (%d, %d) vs (%d, %d)", 98 __LINE__, totOffRow, totOffCol, inMask->numRows, inMask->numCols); 119 99 return false; 120 100 } … … 136 116 return false; 137 117 } else if(inType != flatType) { 138 psError(__func__, " : Line %d - Input and flat image types differ .(%d vs %d)", __LINE__, inType,118 psError(__func__, " : Line %d - Input and flat image types differ: (%d vs %d)", __LINE__, inType, 139 119 flatType); 140 120 return false; … … 149 129 if(flatImage->data.TYPE[j][i] <= 0.0) { \ 150 130 /* Negative or zero flat pixels shall be masked in input image as PM_MASK_FLAT */ \ 151 inMask->data.PS_TYPE_MASK_DATA[j][i] = PM_MASK_FLAT;\131 inMask->data.PS_TYPE_MASK_DATA[j][i] |= PM_MASK_FLAT; \ 152 132 } \ 153 133 } \ … … 178 158 } 179 159 180 printf("");181 160 return true; 182 161 }
Note:
See TracChangeset
for help on using the changeset viewer.
