Changeset 13873 for trunk/ppMerge/src/ppMergeCombine.c
- Timestamp:
- Jun 18, 2007, 5:59:32 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeCombine.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeCombine.c
r13769 r13873 83 83 bool ppMergeCombine(psImage *scales, // Scales for each cell of each integration, or NULL 84 84 psImage *zeros, // Zeros for each cell of each integration, or NULL 85 psArray *shutters, // Shutter correction data for each cell, or NULL 85 86 ppMergeData *data, // Data 86 87 ppMergeOptions *options, // Options … … 100 101 zeros->numCols == data->numCells && 101 102 zeros->numRows == filenames->n)); 103 assert(!options->shutter || shutters); 104 assert(!shutters || (shutters->n == data->numCells)); 102 105 103 106 // Iterate over the FPA … … 143 146 } 144 147 148 float shutterRef; // Reference shutter correction 149 if (options->shutter) { 150 shutterRef = pmShutterCorrectionReference(shutters->data[cellNum]); 151 } 152 145 153 do { 146 154 numRead = 0; … … 162 170 163 171 // Only reading and writing the first readout in each cell (plane 0) 164 bool readOK;172 bool readOK; 165 173 if (pmReadoutReadNext(&readOK, stack->data[i], fits, 0, options->rows)) { 166 if (!readOK) {167 psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n");168 psErrorStackPrint(stderr, "trouble reading data!\n");169 exit (1);170 }174 if (!readOK) { 175 psError(PS_ERR_IO, false, "Failed to read concepts for cell.\n"); 176 psErrorStackPrint(stderr, "trouble reading data!\n"); 177 exit (1); 178 } 171 179 // If we're creating a bias or a dark, we don't want to generate a mask 172 180 if ((options->zero || options->scale || options->shutter || options->mask) && … … 198 206 199 207 if (options->shutter) { 200 pmShutterCorrectionMeasure(readout, stack, options->shutterSize, 201 options->mean, options->stdev, 202 options->shutterIter, 203 options->shutterRej, 204 options->combine->maskVal); 208 pmShutterCorrectionGenerate(readout, NULL, stack, shutterRef, shutters->data[cellNum], 209 options->shutterIter, options->shutterRej, 210 options->combine->maskVal); 205 211 } else { 206 212 pmReadoutCombine(readout, stack, cellZeros, cellScales, options->combine); … … 271 277 // Statistics on the merged cell 272 278 if (data->statsFile) { 273 if (!data->stats) { 274 data->stats = psMetadataAlloc(); 275 } 276 if (!ppStats(data->stats, 277 data->out, 278 view, 279 options->combine->maskVal, 280 config)) { 279 if (!data->stats) { 280 data->stats = psMetadataAlloc(); 281 } 282 if (!ppStats(data->stats, data->out, view, options->combine->maskVal, config)) { 281 283 psError(PS_ERR_UNEXPECTED_NULL, true, "Unable to generate stats for image.\n"); 282 return false;283 }284 }284 return false; 285 } 286 } 285 287 286 288 // We threw away the bias sections --- record this
Note:
See TracChangeset
for help on using the changeset viewer.
