Changeset 18591 for trunk/ppSub/src/ppSubReadout.c
- Timestamp:
- Jul 16, 2008, 5:36:56 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubReadout.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubReadout.c
r18559 r18591 77 77 int binning = psMetadataLookupS32(NULL, config->arguments, "SPAM.BINNING"); // Binning for SPAM kernel 78 78 float penalty = psMetadataLookupF32(NULL, config->arguments, "PENALTY"); // Penalty for wideness 79 psMaskType maskBad = pmConfigMaskGet(psMetadataLookupStr(NULL, config->arguments, "MASK.BAD"), 80 config); // Value to mask 81 psMaskType maskBlank = pmConfigMaskGet(psMetadataLookupStr(NULL, config->arguments, "MASK.BLANK"), 82 config); // Mask for blank reg. 79 psMaskType maskIn = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask going in to pmSubtractionMatch 80 psMaskType maskOut = pmConfigMaskGet("BLANK", config); // Bits to mask after pmSubtractionMatch 83 81 float badFrac = psMetadataLookupF32(NULL, config->arguments, "BADFRAC"); // Maximum bad fraction 84 82 const char *stampsName = psMetadataLookupStr(&mdok, config->arguments, "STAMPS"); // Filename for stamps … … 115 113 } 116 114 117 if (!pmReadoutMaskNonfinite(inRO, mask Bad)) {115 if (!pmReadoutMaskNonfinite(inRO, maskIn)) { 118 116 psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in input."); 119 117 return false; 120 118 } 121 if (!pmReadoutMaskNonfinite(refRO, mask Bad)) {119 if (!pmReadoutMaskNonfinite(refRO, maskIn)) { 122 120 psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in reference."); 123 121 return false; … … 136 134 if (!pmSubtractionMatch(inConv, refConv, inRO, refRO, footprint, regionSize, spacing, threshold, sources, 137 135 stampsName, type, size, order, widths, orders, inner, ringsOrder, binning, 138 penalty, optimum, optWidths, optOrder, optThresh, iter, rej, mask Bad,139 mask Blank, badFrac, mode)) {136 penalty, optimum, optWidths, optOrder, optThresh, iter, rej, maskIn, 137 maskOut, badFrac, mode)) { 140 138 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 141 139 psFree(inConv); … … 200 198 #ifdef TESTING 201 199 { 202 pmReadoutMaskApply(minuend, mask Blank);200 pmReadoutMaskApply(minuend, maskOut); 203 201 psFits *fits = psFitsOpen("minuend.fits", "w"); 204 202 psFitsWriteImage(fits, NULL, minuend->image, 0, NULL); … … 206 204 } 207 205 { 208 pmReadoutMaskApply(subtrahend, mask Blank);206 pmReadoutMaskApply(subtrahend, maskOut); 209 207 psFits *fits = psFitsOpen("subtrahend.fits", "w"); 210 208 psFitsWriteImage(fits, NULL, subtrahend->image, 0, NULL); … … 278 276 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true; 279 277 280 pmReadoutMaskApply(outRO, mask Blank);278 pmReadoutMaskApply(outRO, maskOut); 281 279 282 280 psFree(inConv); … … 286 284 for (int y = 0; y < outRO->image->numRows; y++) { 287 285 for (int x = 0; x < outRO->image->numCols; x++) { 288 if (isnan(outRO->image->data.F32[y][x]) && !(outRO->mask->data.U8[y][x] & mask Blank)) {286 if (isnan(outRO->image->data.F32[y][x]) && !(outRO->mask->data.U8[y][x] & maskOut)) { 289 287 printf("Unmasked NAN at %d %d --> %d\n", x, y, outRO->mask->data.U8[y][x]); 290 288 } … … 301 299 if (renorm) { 302 300 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 303 if (!pmReadoutWeightRenorm(outRO, mask Blank, PS_STAT_ROBUST_MEDIAN, PS_STAT_ROBUST_STDEV,301 if (!pmReadoutWeightRenorm(outRO, maskOut, PS_STAT_ROBUST_MEDIAN, PS_STAT_ROBUST_STDEV, 304 302 renormWidth, rng)) { 305 303 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise weights for photometry.");
Note:
See TracChangeset
for help on using the changeset viewer.
