Changeset 5862 for trunk/ppMerge/src/ppMergeCell.c
- Timestamp:
- Dec 30, 2005, 6:32:45 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeCell.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeCell.c
r5860 r5862 1 1 # include "ppMerge.h" 2 3 // mask, bias, dark, flat are defined per Cell4 // pedestal is constructed for each readout, which may have different exposure times5 2 6 3 pmReadout *ppDetrendSelectFirst (pmCell *cell, char *name, bool doThis) { … … 19 16 } 20 17 21 bool ppMergeCell (p sArray *cellList, pmCell *maskCell, ppOptions *options, ppConfig *config) {18 bool ppMergeCell (pmCell *outputCell, pmCell *maskCell, psArray *cellList, ppOptions *options, ppConfig *config) { 22 19 23 20 pmCell *sample = cellList->data[0]; 24 pmReadout *mask = ppDetrendSelectFirst (maskCell, "mask", options->doMask); 21 // pmReadout *mask = ppDetrendSelectFirst (maskCell, "mask", options->doMask); 22 23 // list to carry readouts for processing 24 psArray *inputs = psArrayAlloc (cellList->n); 25 inputs->n = 0; 26 27 psVector *combineZero = psVectorAlloc (128, PS_TYPE_F32); 28 combineZero->n = 0; 29 30 psVector *combineScale = psVectorAlloc (128, PS_TYPE_F32); 31 combineScale->n = 0; 32 33 int nVal = 0; 25 34 26 35 // push all readouts from each image onto the list 27 36 // not clear that this is the right process -- how to merge readouts? 28 37 // are all readouts from this cell equivalent? (ie, across images?) 29 // XXX need to set / carry the zero,scale values 30 31 readouts = psListAlloc (); 32 38 // XXX need to set the zero,scale values correctly for each readout 33 39 for (int i = 0; i < cellList->n; i++) { 34 40 pmCell *cell = cellList->data[i]; 35 41 for (int j = 0; j < cell->readouts->n; j++) { 36 psListAdd (cell->readouts->data[j], PS_LIST_TAIL); 42 psArrayAdd (inputs, 16, cell->readouts->data[j]); 43 44 combineZero->data.F32[nVal] = 0.0; 45 combineScale->data.F32[nVal] = 1.0; 46 psVectorExtend (combineZero, 100, 1); 47 psVectorExtend (combineScale, 100, 1); 48 nVal ++; 37 49 } 38 50 } 39 51 40 // XXX : need to consider the output41 42 psImage *output = pmReadoutCombine (NULL, readouts, params,...);52 // XXX : need to assign these correctly 53 float combineGain = 1.0; 54 float combineNoise = 0.0; 43 55 56 // XXX somehow need to transfer the input cell concepts to the 57 // the output cell. this is weak: are the concepts fixed 58 // or not for a collection of images... 59 outputCell->concepts = sample->concepts; 60 61 // XXX where is the output readouts array allocated? 62 pmReadout *outputReadout = pmReadoutAlloc (outputCell); 63 outputReadout->image = pmReadoutCombine (NULL, inputs, 64 combineZero, 65 combineScale, 66 options->combineParams, 67 options->applyZeroScale, 68 combineGain, combineNoise); 44 69 return true; 45 70 } 71 72 73 // XXX a psList does not make sense here: we are using the fixed length psVectors 74 // to carry bzero and bscale, a psArray should be used for the images
Note:
See TracChangeset
for help on using the changeset viewer.
