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/ppMergeLoop.c

    r5860 r5862  
    33bool ppMergeLoop (ppData *data, ppOptions *options, ppConfig *config) {
    44
    5     ppDetrend detrend;
    6 
    7     ppFPA *sampleFPA = data->input->data[0];
     5    char name[128];
     6    ppFPA *sample = data->input->data[0];
     7    pmFPA *sampleFPA = sample->fpa;
    88
    99    psArray *cellList = psArrayAlloc (data->input->n);
     
    2020    // iterate over all chips, using sampleFPA as reference
    2121    for (int i = 0; i < sampleFPA->chips->n; i++) {
     22        pmChip *maskChip = data->mask->fpa->chips->data[i]; // Chip of interest in input image
     23        pmChip *outputChip = data->output->fpa->chips->data[i]; // Chip of interest in input image
    2224        pmChip *sampleChip = sampleFPA->chips->data[i]; // Chip of interest in input image
    23         pmChip *maskChip = data->mask->fpa->chips->data[i]; // Chip of interest in input image
    2425        if (! sampleChip->valid) { continue; }
    2526
     
    3536        // iterate over all cells, using sampleChip as reference
    3637        for (int j = 0; j < sampleChip->cells->n; j++) {
     38            pmCell *maskCell = maskChip->cells->data[j];
     39            pmCell *outputCell = outputChip->cells->data[j];
    3740            pmCell *sampleCell = sampleChip->cells->data[j];
    38             pmCell *maskCell = maskChip->cells->data[j];
    3941            if (! sampleCell->valid) { continue; }
    4042
     
    5052            // build an array of the cells of interest
    5153            for (int k = 0; k < cellList->n; k++) {
    52                 pmFPA *thisFPA = data->input->data[k];
     54                ppFPA *thisFrame = data->input->data[k];
     55                pmFPA *thisFPA = thisFrame->fpa;
    5356                pmChip *thisChip = thisFPA->chips->data[i];
    5457                cellList->data[k] = thisChip->cells->data[j];
     
    5659
    5760            // run the merge function
    58             ppMergeCell (cellList, maskCell, options, config);
     61            ppMergeCell (outputCell, maskCell, cellList, options, config);
     62
     63            sprintf (name, "test.%d.%d.fits", i, j);
     64            psFits *fits = psFitsOpen (name, "w");
     65            pmReadout *readout = outputCell->readouts->data[0];
     66            psFitsWriteImage (fits, NULL, readout->image, 0);
     67            psFitsClose (fits);
     68
     69# if (0)
     70            if (sampleCell->hdu) {
     71                outputCell->hdu = sampleCell->hdu;
     72                outputCell->hdu->images = psArrayAlloc (1);
     73                outputCell->hdu->images->data[0] = outputCell->readouts->data[0];
     74            }
     75# endif
    5976        }
     77# if (0)       
     78        if (sampleChip->hdu) {
     79            outputChip->hdu = sampleChip->hdu;
     80            outputChip->hdu->images = psArrayAlloc (1);
     81            // outputChip->hdu->images->data[0] = outputChip->readouts->data[0];
     82        }
     83# endif
    6084    }
    6185    return true;
Note: See TracChangeset for help on using the changeset viewer.