Changeset 5862 for trunk/ppMerge/src/ppMergeLoop.c
- Timestamp:
- Dec 30, 2005, 6:32:45 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeLoop.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeLoop.c
r5860 r5862 3 3 bool ppMergeLoop (ppData *data, ppOptions *options, ppConfig *config) { 4 4 5 ppDetrend detrend;6 7 p pFPA *sampleFPA = data->input->data[0];5 char name[128]; 6 ppFPA *sample = data->input->data[0]; 7 pmFPA *sampleFPA = sample->fpa; 8 8 9 9 psArray *cellList = psArrayAlloc (data->input->n); … … 20 20 // iterate over all chips, using sampleFPA as reference 21 21 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 22 24 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 image24 25 if (! sampleChip->valid) { continue; } 25 26 … … 35 36 // iterate over all cells, using sampleChip as reference 36 37 for (int j = 0; j < sampleChip->cells->n; j++) { 38 pmCell *maskCell = maskChip->cells->data[j]; 39 pmCell *outputCell = outputChip->cells->data[j]; 37 40 pmCell *sampleCell = sampleChip->cells->data[j]; 38 pmCell *maskCell = maskChip->cells->data[j];39 41 if (! sampleCell->valid) { continue; } 40 42 … … 50 52 // build an array of the cells of interest 51 53 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; 53 56 pmChip *thisChip = thisFPA->chips->data[i]; 54 57 cellList->data[k] = thisChip->cells->data[j]; … … 56 59 57 60 // 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 59 76 } 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 60 84 } 61 85 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
