Changeset 7254
- Timestamp:
- May 31, 2006, 12:51:15 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 2 edited
-
camera/pmHDUGenerate.c (modified) (3 diffs)
-
imcombine/pmReadoutCombine.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmHDUGenerate.c
r7168 r7254 26 26 for (int i = 0; i < cells->n; i++) { 27 27 pmCell *cell = cells->data[i]; // A cell 28 result |= psListAdd(list, PS_LIST_TAIL, cell); 28 if (!cell->hdu) { // Don't add cells that have their own HDU 29 result |= psListAdd(list, PS_LIST_TAIL, cell); 30 } 29 31 } 30 32 … … 44 46 for (int i = 0; i < chips->n; i++) { 45 47 pmChip *chip = chips->data[i]; // A chip 46 result |= addCellsFromChip(list, chip); 48 if (! chip->hdu) { // Don't add chips that have their own HDU 49 result |= addCellsFromChip(list, chip); 50 } 47 51 } 48 52 … … 263 267 } 264 268 if (numReadouts == 0 || type == 0) { 265 psError(PS_ERR_IO, true, "Unable to find images within HDU.\n");269 // Nothing from which to create an HDU 266 270 psFree(cells); 267 271 return false; -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r7204 r7254 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-05- 25 04:06:28$7 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-05-31 22:51:15 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 26 26 27 #if 1 27 28 // Return the statistic of interest 28 29 static double getStat(const psStats *stats, // Statistics structure … … 58 59 return NAN; 59 60 } 61 #endif 60 62 61 63 // Mask for combination --- used only locally … … 140 142 long minInputCols = LONG_MAX; // The smallest input column value 141 143 long minInputRows = LONG_MAX; // The smallest input row value 142 psVector *rowLower = psVectorAlloc(inputs->n, PS_TYPE_U32); // The lower y bound for each image143 psVector *rowUpper = psVectorAlloc(inputs->n, PS_TYPE_U32); // The upper y bound for each image144 psVector *colLower = psVectorAlloc(inputs->n, PS_TYPE_U32); // The lower x bound for each image145 psVector *colUpper = psVectorAlloc(inputs->n, PS_TYPE_U32); // The upper x bound for each image146 rowLower->n = inputs->n;147 rowUpper->n = inputs->n;148 colLower->n = inputs->n;149 colUpper->n = inputs->n;150 144 psVector *mask = psVectorAlloc(inputs->n, PS_TYPE_U8); // Mask for stack 151 145 mask->n = inputs->n; … … 181 175 psTrace(__func__, 7, "Readout %d: offset %d,%d; size %dx%d\n", i, 182 176 readout->col0, readout->row0, readout->image->numCols, readout->image->numRows); 183 // Bounds of input image184 rowLower->data.U32[i] = readout->row0;185 colLower->data.U32[i] = readout->col0;186 rowUpper->data.U32[i] = readout->row0 + readout->image->numRows;187 colUpper->data.U32[i] = readout->col0 + readout->image->numCols;188 177 } 189 178 if (!valid) { … … 270 259 psMaskType maskVal = params->maskVal; // The mask value 271 260 272 psTrace(__func__, 3, "Iterating %d --> %d, %d --> %d\n",261 psTrace(__func__, 3, "Iterating output: %d --> %d, %d --> %d\n", 273 262 minInputCols - output->col0, maxInputCols - output->col0, 274 263 minInputRows - output->row0, maxInputRows - output->row0); 264 if (psTraceGetLevel(__func__) >= 3) { 265 for (int r = 0; r < inputs->n; r++) { 266 pmReadout *readout = inputs->data[r]; // Input readout 267 psTrace(__func__, 3, "Iterating input %d: %d --> %d, %d --> %d\n", r, 268 minInputCols - readout->col0, maxInputCols - readout->col0, 269 minInputRows - readout->row0, maxInputRows - readout->row0); 270 } 271 } 275 272 276 273 for (int i = minInputRows; i < maxInputRows; i++) { 274 if (psTraceGetLevel(__func__) > 9) { 275 printf("Processing row %d\r", i); 276 fflush(stdout); 277 } 277 278 for (int j = minInputCols; j < maxInputCols; j++) { 278 279 279 280 int numValid = 0; // Number of valid pixels in the stack 280 281 for (int r = 0; r < inputs->n; r++) { 281 // Check existence and bounds282 if (mask->data.U8[r] & PM_READOUT_COMBINE_NO_IMAGE ||283 i < colLower->data.U32[r] ||284 i >= colUpper->data.U32[r] ||285 j < rowLower->data.U32[r] ||286 j >= rowUpper->data.U32[r]) {287 continue;288 }289 290 282 pmReadout *readout = inputs->data[r]; // Input readout 291 283 int yIn = i - readout->row0; // y position on input readout 292 284 int xIn = j - readout->col0; // x position on input readout 285 286 // Check existence and bounds 287 if (mask->data.U8[r] & PM_READOUT_COMBINE_NO_IMAGE || 288 xIn < 0 || xIn >= readout->image->numCols || 289 yIn < 0 || yIn >= readout->image->numRows) { 290 continue; 291 } 292 293 // Check mask 293 294 if (readout->mask && readout->mask->data.U8[yIn][xIn] & maskVal) { 294 295 mask->data.U8[r] &= PM_READOUT_COMBINE_MASKED; … … 317 318 int yOut = i - output->row0; // y position on output readout 318 319 int xOut = j - output->col0; // x position on output readout 319 psTrace(__func__, 10, "Output pixel: %d %d\n", xOut, yOut);320 320 321 321 if (numValid == 0) { 322 322 output->mask->data.U8[yOut][xOut] = PM_MASK_FLAT; 323 output->image->data.F32[yOut][xOut] = NAN; 323 324 continue; 324 325 } 325 326 326 327 // Apply fracLow,fracHigh if there are enough pixels 327 if (numValid * keepFrac >= params->nKeep ) {328 if (numValid * keepFrac >= params->nKeep && keepFrac != 1.0) { 328 329 index = psVectorSortIndex(index, pixels); 329 330 int numLow = numValid * params->fracLow; // Number of low pixels to clip … … 359 360 } 360 361 } 362 if (psTraceGetLevel(__func__) > 9) { 363 printf("\n"); 364 } 361 365 362 366 psFree(index); 363 psFree(rowLower);364 psFree(rowUpper);365 psFree(colLower);366 psFree(colUpper);367 367 psFree(pixels); 368 368 psFree(mask);
Note:
See TracChangeset
for help on using the changeset viewer.
