- Timestamp:
- Jul 30, 2009, 5:20:29 PM (17 years ago)
- Location:
- branches/czw_branch/cleanup
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ppImage/src/ppImageDetrendFringe.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/cleanup
- Property svn:mergeinfo changed
/trunk (added) merged: 24714-24742,24744-24784,24786-24798,24801-24824,24827-24834,24836-24859,24861-24901,24903-24912,24914-24939
- Property svn:mergeinfo changed
-
branches/czw_branch/cleanup/ppImage/src/ppImageDetrendFringe.c
r18969 r24951 11 11 PS_ASSERT_PTR_NON_NULL(options, false); 12 12 13 // Reference fringe measurements 14 psArray *references = psMemIncrRefCounter(psMetadataLookupPtr(NULL, fringe->analysis, 15 "FRINGE.MEASUREMENTS")); 13 // Reference fringe measurements (stored on the reference cell->analysis) 14 psArray *references = psMemIncrRefCounter(psMetadataLookupPtr(NULL, fringe->analysis, "FRINGE.MEASUREMENTS")); 16 15 if (!references) { 17 references = pmFringesParse(fringe); // Reference fringes 18 if (!references) { 19 psError(PS_ERR_IO, false, "Unable to find fringe references.\n"); 20 return false; 21 } 22 psMetadataAdd(fringe->analysis, PS_LIST_TAIL, "FRINGE.MEASUREMENTS", PS_DATA_UNKNOWN, 23 "Fringe measurements", references); 16 psError(PS_ERR_IO, false, "Unable to find fringe references.\n"); 17 return false; 24 18 } 25 19 … … 75 69 } 76 70 77 psMetadataAdd(readout->parent->analysis, PS_LIST_TAIL, scienceFringes, 78 PS_DATA_UNKNOWN | PS_META_REPLACE, "Fringe measurements", measurements); 71 psMetadataAdd(readout->parent->analysis, PS_LIST_TAIL, scienceFringes, PS_DATA_UNKNOWN | PS_META_REPLACE, "Fringe measurements", measurements); 79 72 psFree(measurements); 80 73 psFree(scienceFringes); … … 92 85 psArray *fringes = psArrayAlloc(cells->n); // Fringes, to return 93 86 for (int i = 0; i < cells->n; i++) { 87 fringes->data[i] = NULL; 88 94 89 pmCell *cell = cells->data[i]; // Cell of interest 95 90 96 91 // XXX for now, skip the video cells (cell->readouts->n > 1) 97 92 if (cell->readouts->n > 1) { 98 psWarning ("Skipping Video Cell for ppImageDetrendFringe.c:getFringes");99 continue;93 psWarning ("Skipping Video Cell (%d) for ppImageDetrendFringe.c:getFringes", i); 94 continue; 100 95 } 101 96 … … 197 192 } 198 193 assert(fringes->readouts->n == solution->nFringeFrames); 194 195 psImageMaskType maskVal = options->flatMask; 199 196 200 197 bool mdok; // Status of MD lookup … … 262 259 } 263 260 261 // subtract fringe and update mask if fringe value is NAN 262 for (int iy = 0; iy < readout->image->numRows; iy++) { 263 for (int ix = 0; ix < readout->image->numCols; ix++) { 264 readout->image->data.F32[iy][ix] -= sumFringe->data.F32[iy][ix]; 265 if (!isfinite(sumFringe->data.F32[iy][ix]) && readout->mask) { 266 readout->mask->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix] |= maskVal; 267 } 268 } 269 } 270 264 271 // XXX: Make generic, so subregions may be subtracted as well 265 if (!psBinaryOp(readout->image, readout->image, "-", sumFringe)) {266 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to subtract fringe.\n");267 return false;268 }272 // if (!psBinaryOp(readout->image, readout->image, "-", sumFringe)) { 273 // psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to subtract fringe.\n"); 274 // return false; 275 // } 269 276 270 277 // measure residual fringe amplitude. results go to FRINGE.RESIDUALS
Note:
See TracChangeset
for help on using the changeset viewer.
