Changeset 1852
- Timestamp:
- Sep 22, 2004, 1:58:20 PM (22 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 added
- 1 edited
-
pmFlatField.c (modified) (8 diffs)
-
pmFlatField.dat (added)
-
psErrorCodes.dat (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmFlatField.c
r1849 r1852 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $21 * @date $Date: 2004-09-22 19:58:57$20 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2004-09-22 23:58:20 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 #include "pmFlatField.h" 35 35 #include "pmMaskBadPixels.h" 36 #include "pmFlatFieldErrors.h" 37 36 38 37 39 bool pmFlatField(psReadout *in, const psReadout *flat) … … 53 55 return false; 54 56 } else if(flat==NULL) { 55 psError(__func__, " : Line %d - Null not allowed for flat readout", __LINE__); 57 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true, 58 PS_ERRORTEXT_pmFlatField_NULL_FLAT_READOUT); 56 59 return false; 57 60 } … … 60 63 flatImage = flat->image; 61 64 if (inImage == NULL) { 62 psError(__func__, " : Line %d - Null not allowed for input image", __LINE__); 65 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true, 66 PS_ERRORTEXT_pmFlatField_NULL_INPUT_IMAGE); 63 67 return false; 64 68 } else if(flatImage == NULL) { 65 psError(__func__, " : Line %d - Null not allowed for flat image", __LINE__); 69 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_NULL, true, 70 PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE); 66 71 return false; 67 72 } else if(in->mask == NULL) { … … 72 77 // Check input image and its mask are not larger than flat image 73 78 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); 79 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true, 80 PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE, 81 inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols); 76 82 return false; 77 83 } 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); 84 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true, 85 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE, 86 inMask->numRows, inMask->numCols, flatImage->numRows, flatImage->numCols); 80 87 return false; 81 88 } … … 87 94 // Check that offsets are within image limits 88 95 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); 96 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true, 97 PS_ERRORTEXT_pmFlatField_OFFSET_FLAT_IMAGE, 98 totOffRow, totOffCol, flatImage->numRows, flatImage->numCols); 91 99 return false; 92 100 } 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); 101 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true, 102 PS_ERRORTEXT_pmFlatField_OFFSET_INPUT_IMAGE, 103 totOffRow, totOffCol, inImage->numRows, inImage->numCols); 95 104 return false; 96 105 } 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); 106 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_SIZE, true, 107 PS_ERRORTEXT_pmFlatField_OFFSET_MASK_IMAGE, 108 totOffRow, totOffCol, inMask->numRows, inMask->numCols); 99 109 return false; 100 110 } … … 105 115 maskType = inMask->type.type; 106 116 if(PS_IS_PSELEMTYPE_COMPLEX(inType)) { 107 psError(__func__, " : Line %d - Complex types not allowed for input image. Type: %d", __LINE__, 108 inType); 117 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true, 118 PS_ERRORTEXT_pmFlatField_TYPE_INPUT_IMAGE, 119 inType); 109 120 return false; 110 121 } else if(PS_IS_PSELEMTYPE_COMPLEX(flatType)) { 111 psError(__func__, " : Line %d - Complex types not allowed for flat image. Type: %d", __LINE__, 112 flatType); 122 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true, 123 PS_ERRORTEXT_pmFlatField_TYPE_FLAT_IMAGE, 124 flatType); 113 125 return false; 114 126 } else if(maskType != PS_TYPE_MASK) { 115 psError(__func__, " : Line %d - Mask must be PS_TYPE_MASK type. Type: %d", __LINE__, maskType); 127 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true, 128 PS_ERRORTEXT_pmFlatField_TYPE_MASK_IMAGE, 129 maskType); 116 130 return false; 117 131 } else if(inType != flatType) { 118 psError(__func__, " : Line %d - Input and flat image types differ: (%d vs %d)", __LINE__, inType, 119 flatType); 132 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true, 133 PS_ERRORTEXT_pmFlatField_TYPE_MISMATCH, 134 inType, flatType); 120 135 return false; 121 136 } … … 155 170 PM_FLAT_DIVISION(F64); 156 171 default: 157 psError(__func__, "Unsupported image datatype. Type: %d", inType); 172 psErrorMsg(PS_ERRORNAME_DOMAIN "pmFlatField", PS_ERR_BAD_PARAMETER_TYPE, true, 173 PS_ERRORTEXT_pmFlatField_TYPE_UNSUPPORTED, 174 inType); 158 175 } 159 176
Note:
See TracChangeset
for help on using the changeset viewer.
