Changeset 2287
- Timestamp:
- Nov 4, 2004, 6:49:47 PM (22 years ago)
- Location:
- trunk/psModules
- Files:
-
- 1 added
- 4 edited
-
src/pmReadoutCombine.c (modified) (10 diffs)
-
test/Makefile.am (modified) (2 diffs)
-
test/Makefile.in (modified) (8 diffs)
-
test/tst_pmReadoutCombine.c (added)
-
test/tst_pmSubtractBias.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmReadoutCombine.c
r2286 r2287 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2004-11-05 0 2:45:42$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2004-11-05 04:49:47 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 65 65 psListElem *tmpInput = NULL; 66 66 int numInputs = 0; 67 psReadout *tmpReadout ;67 psReadout *tmpReadout = NULL; 68 68 float tmpF; 69 69 … … 135 135 // 136 136 if (output == NULL) { 137 output = psImageAlloc( 1+maxInputCols-minInputCols,138 1+maxInputRows-minInputRows, PS_TYPE_F32);137 output = psImageAlloc(maxInputCols-minInputCols, 138 maxInputRows-minInputRows, PS_TYPE_F32); 139 139 *(int *) &(output->col0) = minInputCols; 140 140 *(int *) &(output->row0) = minInputRows; … … 168 168 psReadout **tmpReadouts = (psReadout **) psAlloc(numInputs * sizeof(psReadout *)); 169 169 170 171 170 // For each input readout, we create a pointer to that readout in 172 171 // "tmpReadouts[]", and we store the min/max pixel indices for that … … 174 173 // (outRowLower, outColLower, outRowUpper, outColUpper). 175 174 i = 0; 175 tmpInput = (psListElem *) inputs->head; 176 176 while (NULL != tmpInput) { 177 177 tmpReadouts[i] = (psReadout *) tmpInput->data; 178 outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadout ->image->row0;179 outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadout ->image->col0;178 outRowLower->data.U32[i] = tmpReadouts[i]->row0 + tmpReadouts[i]->image->row0; 179 outColLower->data.U32[i] = tmpReadouts[i]->col0 + tmpReadouts[i]->image->col0; 180 180 outRowUpper->data.U32[i] = tmpReadouts[i]->row0 + 181 181 tmpReadouts[i]->image->row0 + … … 185 185 tmpReadouts[i]->image->numCols; 186 186 187 // printf("Bounds: [%d][%d] to [%d][%d]\n", outRowLower->data.U32[i], outColLower->data.U32[i], outRowUpper->data.U32[i], outColUpper->data.U32[i]); 188 189 187 190 tmpInput = tmpInput->next; 188 191 i++; 189 190 192 } 191 193 … … 197 199 // stats routine on those pixels/mask. Then we set the output pixel value 198 200 // to the result of the stats call. 199 for (i = output->row0; i < output->numRows ; i++) { 200 for (j = output->col0; j < output->numCols ; j++) { 201 202 for (i = output->row0; i < (output->row0 + output->numRows) ; i++) { 203 for (j = output->col0; j < (output->col0 + output->numCols) ; j++) { 201 204 for (int r = 0; r < numInputs ; r++) { 205 // printf("[%d][%d]: [%d][%d] to [%d][%d]\n", i, j, outRowLower->data.U32[r], outColLower->data.U32[r], outRowUpper->data.U32[r], outColUpper->data.U32[r]); 202 206 if ((outRowLower->data.U32[r] <= i) && 203 207 (outColLower->data.U32[r] <= j) && … … 206 210 207 211 int imageRow = i - (tmpReadouts[r]->row0 + 208 tmpReadouts[ i]->image->row0);212 tmpReadouts[r]->image->row0); 209 213 int imageCol = j - (tmpReadouts[r]->col0 + 210 214 tmpReadouts[r]->image->col0); 211 if (!(maskVal && tmpReadouts[i]->mask->data.U8[imageRow][imageCol])) { 212 tmpPixels->data.F32[r] = tmpReadouts[i]->image->data.F32[imageRow][imageCol]; 215 216 if ((NULL == tmpReadouts[r]->mask) || 217 !(maskVal && tmpReadouts[r]->mask->data.U8[imageRow][imageCol])) { 218 tmpPixels->data.F32[r] = tmpReadouts[r]->image->data.F32[imageRow][imageCol]; 213 219 tmpPixelMask->data.U8[r] = 0; 214 220 } else { … … 220 226 tmpPixelMask->data.U8[r] = 1; 221 227 } 228 // printf("readout[%d], image [%d][%d] is %f\n", r, i, j, tmpPixels->data.F32[r]); 222 229 } 223 230 // At this point, we have scanned all input readouts for this … … 299 306 300 307 psFree(tmpPixels); 301 psFree(tmpPixels);302 308 psFree(tmpPixelMask); 303 309 psFree(tmpPixelMaskNKeep); -
trunk/psModules/test/Makefile.am
r2131 r2287 1 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias 1 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias tst_pmReadoutCombine 2 2 3 3 tst_pmFlatField_SOURCES = tst_pmFlatField.c … … 13 13 tst_pmSubtractBias_LDFLAGS = -L../src -lpsmodule 14 14 15 tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c 16 tst_pmReadoutCombine_LDFLAGS = -L../src -lpsmodule -
trunk/psModules/test/Makefile.in
r2164 r2287 94 94 am__quote = @am__quote@ 95 95 install_sh = @install_sh@ 96 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias 96 bin_PROGRAMS = tst_pmFlatField tst_pmMaskBadPixels tst_pmNonLinear tst_pmSubtractBias tst_pmReadoutCombine 97 97 98 98 tst_pmFlatField_SOURCES = tst_pmFlatField.c … … 107 107 tst_pmSubtractBias_SOURCES = tst_pmSubtractBias.c 108 108 tst_pmSubtractBias_LDFLAGS = -L../src -lpsmodule 109 110 tst_pmReadoutCombine_SOURCES = tst_pmReadoutCombine.c 111 tst_pmReadoutCombine_LDFLAGS = -L../src -lpsmodule 109 112 subdir = test 110 113 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs … … 112 115 CONFIG_CLEAN_FILES = 113 116 bin_PROGRAMS = tst_pmFlatField$(EXEEXT) tst_pmMaskBadPixels$(EXEEXT) \ 114 tst_pmNonLinear$(EXEEXT) tst_pmSubtractBias$(EXEEXT) 117 tst_pmNonLinear$(EXEEXT) tst_pmSubtractBias$(EXEEXT) \ 118 tst_pmReadoutCombine$(EXEEXT) 115 119 PROGRAMS = $(bin_PROGRAMS) 116 120 … … 127 131 tst_pmNonLinear_LDADD = $(LDADD) 128 132 tst_pmNonLinear_DEPENDENCIES = 133 am_tst_pmReadoutCombine_OBJECTS = tst_pmReadoutCombine.$(OBJEXT) 134 tst_pmReadoutCombine_OBJECTS = $(am_tst_pmReadoutCombine_OBJECTS) 135 tst_pmReadoutCombine_LDADD = $(LDADD) 136 tst_pmReadoutCombine_DEPENDENCIES = 129 137 am_tst_pmSubtractBias_OBJECTS = tst_pmSubtractBias.$(OBJEXT) 130 138 tst_pmSubtractBias_OBJECTS = $(am_tst_pmSubtractBias_OBJECTS) … … 142 150 @AMDEP_TRUE@ ./$(DEPDIR)/tst_pmMaskBadPixels.Po \ 143 151 @AMDEP_TRUE@ ./$(DEPDIR)/tst_pmNonLinear.Po \ 152 @AMDEP_TRUE@ ./$(DEPDIR)/tst_pmReadoutCombine.Po \ 144 153 @AMDEP_TRUE@ ./$(DEPDIR)/tst_pmSubtractBias.Po 145 154 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ … … 151 160 $(AM_LDFLAGS) $(LDFLAGS) -o $@ 152 161 DIST_SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) \ 153 $(tst_pmNonLinear_SOURCES) $(tst_pmSubtractBias_SOURCES) 162 $(tst_pmNonLinear_SOURCES) $(tst_pmReadoutCombine_SOURCES) \ 163 $(tst_pmSubtractBias_SOURCES) 154 164 DIST_COMMON = Makefile.am Makefile.in 155 SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) $(tst_pmNonLinear_SOURCES) $(tst_pm SubtractBias_SOURCES)165 SOURCES = $(tst_pmFlatField_SOURCES) $(tst_pmMaskBadPixels_SOURCES) $(tst_pmNonLinear_SOURCES) $(tst_pmReadoutCombine_SOURCES) $(tst_pmSubtractBias_SOURCES) 156 166 157 167 all: all-am … … 202 212 @rm -f tst_pmNonLinear$(EXEEXT) 203 213 $(LINK) $(tst_pmNonLinear_LDFLAGS) $(tst_pmNonLinear_OBJECTS) $(tst_pmNonLinear_LDADD) $(LIBS) 214 tst_pmReadoutCombine$(EXEEXT): $(tst_pmReadoutCombine_OBJECTS) $(tst_pmReadoutCombine_DEPENDENCIES) 215 @rm -f tst_pmReadoutCombine$(EXEEXT) 216 $(LINK) $(tst_pmReadoutCombine_LDFLAGS) $(tst_pmReadoutCombine_OBJECTS) $(tst_pmReadoutCombine_LDADD) $(LIBS) 204 217 tst_pmSubtractBias$(EXEEXT): $(tst_pmSubtractBias_OBJECTS) $(tst_pmSubtractBias_DEPENDENCIES) 205 218 @rm -f tst_pmSubtractBias$(EXEEXT) … … 215 228 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmMaskBadPixels.Po@am__quote@ 216 229 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmNonLinear.Po@am__quote@ 230 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmReadoutCombine.Po@am__quote@ 217 231 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tst_pmSubtractBias.Po@am__quote@ 218 232 -
trunk/psModules/test/tst_pmSubtractBias.c
r2147 r2287 1 /** @file tst_pm FlatField.c1 /** @file tst_pmSubtractBias.c 2 2 * 3 3 * @brief Contains the tests for pmSubtractBias.c: … … 11 11 * row in the input image. 12 12 * 13 *14 13 * @author GLG, MHPCC 15 14 * 16 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-1 0-15 02:15:34$15 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 16 * @date $Date: 2004-11-05 04:49:47 $ 18 17 * 19 18 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
Note:
See TracChangeset
for help on using the changeset viewer.
