Changeset 19475 for trunk/ppStack/src/ppStackReadout.c
- Timestamp:
- Sep 10, 2008, 2:59:24 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackReadout.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackReadout.c
r19346 r19475 196 196 psArray *stack = psArrayAlloc(num); // Array for stacking 197 197 198 pmCell *outCell = outRO->parent; // Output cell199 pmChip *outChip = outCell->parent; // Output chip200 pmFPA *outFPA = outChip->parent; // Output FPA201 202 float totExposure = 0.0; // Total exposure time203 psList *fpaList = psListAlloc(NULL); // List of input FPAs, for concept averaging204 psList *cellList = psListAlloc(NULL); // List of input cells, for concept averaging205 198 int numGood = num; // Number of good inputs: images that haven't been completely rejected 206 199 for (int i = 0; i < num; i++) { … … 222 215 } 223 216 224 float exposure = psMetadataLookupF32(NULL, ro->parent->concepts, "CELL.EXPOSURE"); // Exposure time225 if (!isfinite(exposure)) {226 psError(PS_ERR_BAD_PARAMETER_VALUE, true,227 "CELL.EXPOSURE is not set for input file %ld", stack->n);228 psFree(fpaList);229 psFree(cellList);230 psFree(stack);231 return false;232 }233 totExposure += exposure; // Total exposure time234 235 217 // Ensure there is a mask, or pmStackCombine will complain 236 218 if (!ro->mask) { … … 239 221 } 240 222 241 psListAdd(fpaList, PS_LIST_TAIL, fpa);242 psListAdd(cellList, PS_LIST_TAIL, ro->parent);243 244 223 pmStackData *data = pmStackDataAlloc(ro, weighting); 245 224 data->reject = psMemIncrRefCounter(rejected->data[i]); … … 250 229 numGood != num, useVariance, false)) { 251 230 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts."); 252 psFree(fpaList);253 psFree(cellList);254 231 psFree(stack); 255 232 return false; … … 267 244 #endif 268 245 269 psMetadataAddF32(outCell->concepts, PS_LIST_TAIL, "CELL.EXPOSURE", PS_META_REPLACE, 270 "Summed exposure time (sec)", totExposure); 271 psMetadataAddF32(outCell->parent->parent->concepts, PS_LIST_TAIL, "FPA.EXPOSURE", PS_META_REPLACE, 272 "Summed exposure time (sec)", totExposure); 246 pmCell *outCell = outRO->parent; // Output cell 247 pmChip *outChip = outCell->parent; // Output chip 273 248 274 249 outRO->data_exists = true; 275 250 outCell->data_exists = true; 276 outCell->parent->data_exists = true; 277 278 // Copy other concepts 279 pmConceptsAverageFPAs(outFPA, fpaList); 280 pmConceptsAverageCells(outCell, cellList, NULL, NULL, true); 281 psFree(fpaList); 282 psFree(cellList); 251 outChip->data_exists = true; 283 252 284 253 psFree(stack);
Note:
See TracChangeset
for help on using the changeset viewer.
