Changeset 10477
- Timestamp:
- Dec 5, 2006, 10:30:01 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/imcombine/pmReadoutCombine.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/imcombine/pmReadoutCombine.c
r10248 r10477 9 9 10 10 #include "pmFPA.h" 11 #include "pmHDUUtils.h" 11 12 #include "pmFPAMaskWeight.h" 12 13 #include "pmConceptsAverage.h" … … 64 65 } 65 66 67 bool first = !output->image || (output->row0 == 0 && output->col0 == 0); // First pass through? 68 69 pmHDU *hdu = pmHDUFromReadout(output); // Output HDU 70 if (!hdu) { 71 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find HDU for readout.\n"); 72 return false; 73 } 74 75 if (first) { 76 psString comment = NULL; // Comment to add to header 77 psStringAppend(&comment, "Combining using statistic: %x", params->combine); 78 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); 79 psFree(comment); 80 } 81 66 82 psStats *stats = psStatsAlloc(params->combine); // The statistics to use in the combination 67 83 if (params->combine == PS_STAT_CLIPPED_MEAN) { 68 84 stats->clipSigma = params->rej; 69 85 stats->clipIter = params->iter; 86 87 if (first) { 88 psString comment = NULL; // Comment to add to header 89 psStringAppend(&comment, "Combination clipping: %d iter, %f rej", params->iter, params->rej); 90 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); 91 psFree(comment); 92 } 70 93 } 71 94 … … 165 188 psFree(output->weight); 166 189 output->weight = newWeight; 190 } 191 192 if (first) { 193 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, 194 "Using input weights to combine images", ""); 167 195 } 168 196 … … 210 238 211 239 float keepFrac = 1.0 - params->fracLow - params->fracHigh; // Fraction of pixels to keep 240 if (keepFrac != 1.0 && first) { 241 psString comment = NULL; // Comment to add to header 242 psStringAppend(&comment, "Min/max rejection: %f high, %f low, keep %d", 243 params->fracHigh, params->fracLow, params->nKeep); 244 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); 245 psFree(comment); 246 } 247 212 248 psMaskType maskVal = params->maskVal; // The mask value 249 if (maskVal && first) { 250 psString comment = NULL; // Comment to add to header 251 psStringAppend(&comment, "Mask for combination: %x", maskVal); 252 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); 253 psFree(comment); 254 } 213 255 214 256 #ifndef PS_NO_TRACE 215 216 257 psTrace("psModules.imcombine", 3, "Iterating output: %d --> %d, %d --> %d\n", 217 258 minInputCols - output->col0, maxInputCols - output->col0,
Note:
See TracChangeset
for help on using the changeset viewer.
