IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 30, 2005, 6:32:45 PM (21 years ago)
Author:
eugene
Message:

first pass on testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeCell.c

    r5860 r5862  
    11# include "ppMerge.h"
    2 
    3 // mask, bias, dark, flat are defined per Cell
    4 // pedestal is constructed for each readout, which may have different exposure times
    52
    63pmReadout *ppDetrendSelectFirst (pmCell *cell, char *name, bool doThis) {
     
    1916}
    2017
    21 bool ppMergeCell (psArray *cellList, pmCell *maskCell, ppOptions *options, ppConfig *config) {
     18bool ppMergeCell (pmCell *outputCell, pmCell *maskCell, psArray *cellList, ppOptions *options, ppConfig *config) {
    2219
    2320    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;
    2534
    2635    // push all readouts from each image onto the list
    2736    // not clear that this is the right process -- how to merge readouts?
    2837    // 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
    3339    for (int i = 0; i < cellList->n; i++) {
    3440        pmCell *cell = cellList->data[i];
    3541        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 ++;
    3749        }
    3850    }
    3951
    40     // XXX : need to consider the output
    41    
    42     psImage *output = pmReadoutCombine (NULL, readouts, params,...);
     52    // XXX : need to assign these correctly
     53    float combineGain = 1.0;
     54    float combineNoise = 0.0;
    4355
     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);
    4469    return true;
    4570}
     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.