Changeset 5462 for trunk/archive/scripts/src/phase2/pmFlatField.c
- Timestamp:
- Nov 2, 2005, 3:30:32 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/archive/scripts/src/phase2/pmFlatField.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/phase2/pmFlatField.c
r5107 r5462 18 18 * @author Ross Harman, MHPCC 19 19 * 20 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $21 * @date $Date: 2005- 09-23 02:58:30$20 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 21 * @date $Date: 2005-11-03 01:30:32 $ 22 22 * 23 23 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 24 24 */ 25 25 26 #include <stdio.h> 26 #if HAVE_CONFIG_H 27 #include <config.h> 28 #endif 29 30 #include<stdio.h> 31 #include<math.h> 27 32 #include <string.h> 33 28 34 #include "pslib.h" 29 30 #include "pmFPA.h"31 35 #include "pmFlatField.h" 32 36 #include "pmMaskBadPixels.h" … … 34 38 35 39 36 bool pmFlatField(pmReadout *in, const pmReadout *flat)40 bool pmFlatField(pmReadout *in, pmReadout *mask, const pmReadout *flat) 37 41 { 42 // XXX: Not sure if this is correct. Must consult with IfA. 43 PS_ASSERT_PTR_NON_NULL(mask, false); 38 44 int i = 0; 39 45 int j = 0; … … 67 73 PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE); 68 74 return false; 69 } else if(in->mask == NULL) {70 in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);71 memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));72 75 } 73 inMask = in->mask;76 inMask = mask->image; 74 77 75 78 // Check input image and its mask are not larger than flat image 76 if(inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) { 79 80 if (inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) { 77 81 psError( PS_ERR_BAD_PARAMETER_SIZE, true, 78 82 PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE, 79 83 inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols); 80 84 return false; 81 } else if(inMask->numRows>flatImage->numRows || inMask->numCols > flatImage->numCols) { 85 } 86 if (inMask->numRows > flatImage->numRows || inMask->numCols > flatImage->numCols) { 82 87 psError( PS_ERR_BAD_PARAMETER_SIZE, true, 83 88 PS_ERRORTEXT_pmFlatField_SIZE_MASK_IMAGE,
Note:
See TracChangeset
for help on using the changeset viewer.
