Changeset 18591 for trunk/ppStack
- Timestamp:
- Jul 16, 2008, 5:36:56 PM (18 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 3 edited
-
ppStackLoop.c (modified) (3 diffs)
-
ppStackMatch.c (modified) (6 diffs)
-
ppStackReadout.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r18508 r18591 204 204 205 205 bool mdok; // Status of MD lookup 206 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg.207 206 bool tempDelete = psMetadataLookupBool(&mdok, config->arguments, "TEMP.DELETE"); // Delete temporary files? 208 207 const char *tempImage = psMetadataLookupStr(NULL, config->arguments, "TEMP.IMAGE"); // Suffix for temporary images … … 242 241 psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 243 242 int overlap = 2 * psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Overlap by kernel size between consecutive scans 243 244 if (!pmConfigMaskSetBits(NULL, NULL, config)) { 245 psError(PS_ERR_UNKNOWN, false, "Unable to determine mask value."); 246 return false; 247 } 244 248 245 249 memDump("start"); … … 790 794 if (stats) { 791 795 psTrace("ppStack", 1, "Gathering statistics on stacked image....\n"); 792 ppStatsFPA(stats, outCell->parent->parent, view, maskBlank, config);796 ppStatsFPA(stats, outCell->parent->parent, view, pmConfigMaskGet("BLANK", config), config); 793 797 } 794 798 -
trunk/ppStack/src/ppStackMatch.c
r18559 r18591 30 30 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 31 31 int size = psMetadataLookupS32(NULL, recipe, "KERNEL.SIZE"); // Kernel half-size 32 psMaskType maskBad = pmConfigMaskGet(psMetadataLookupStr(NULL, recipe, "MASK.BAD"), config); // Value to mask 32 33 psMaskType maskIn = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask going in to pmSubtractionMatch 34 psMaskType maskOut = pmConfigMaskGet("BLANK", config); // Bits to mask after pmSubtractionMatch 35 33 36 bool mdok; // Status of MD lookup 34 37 bool renorm = psMetadataLookupBool(&mdok, config->arguments, "RENORM"); // Renormalise variances? … … 41 44 float penalty = psMetadataLookupF32(NULL, config->arguments, "PENALTY"); // Penalty for wideness 42 45 43 if (!pmReadoutMaskNonfinite(readout, mask Bad)) {46 if (!pmReadoutMaskNonfinite(readout, maskIn)) { 44 47 psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in readout."); 45 48 return false; … … 64 67 int ringsOrder = psMetadataLookupS32(NULL, recipe, "RINGS.ORDER"); // RINGS polynomial order 65 68 int binning = psMetadataLookupS32(NULL, recipe, "SPAM.BINNING"); // Binning for SPAM kernel 66 psMaskType maskBlank = pmConfigMaskGet(psMetadataLookupStr(NULL, recipe, "MASK.BLANK"),67 config); // Mask for blank reg.68 69 float badFrac = psMetadataLookupF32(NULL, recipe, "BADFRAC"); // Maximum bad fraction 69 70 bool optimum = psMetadataLookupBool(&mdok, recipe, "OPTIMUM"); // Derive optimum parameters? … … 114 115 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder, 115 116 binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, 116 mask Bad, maskBlank, badFrac, PM_SUBTRACTION_MODE_1)) {117 maskIn, maskOut, badFrac, PM_SUBTRACTION_MODE_1)) { 117 118 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 118 119 psFree(fake); … … 200 201 if (renorm) { 201 202 psLogMsg("ppStack", PS_LOG_INFO, "Renormalising variance map."); 202 if (!pmReadoutWeightRenorm(readout, mask Bad, renormMean, renormStdev, renormWidth, rng)) {203 if (!pmReadoutWeightRenorm(readout, maskOut, renormMean, renormStdev, renormWidth, rng)) { 203 204 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 204 205 psFree(output); … … 209 210 // Ensure the background value is zero 210 211 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background 211 if (!psImageBackground(bg, NULL, readout->image, readout->mask, mask Bad, rng)) {212 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskOut, rng)) { 212 213 psWarning("Can't measure background for image."); 213 214 psErrorClear(); -
trunk/ppStack/src/ppStackReadout.c
r18435 r18591 32 32 int iter = psMetadataLookupS32(NULL, config->arguments, "ITER"); // Rejection iterations 33 33 float combineRej = psMetadataLookupF32(NULL, config->arguments, "COMBINE.REJ"); // Combination threshold 34 psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask 35 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 36 // float threshold = psMetadataLookupF32(NULL, config->arguments, "THRESHOLD.MASK"); // Threshold for mask deconvolution 34 psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask 37 35 bool useVariance = psMetadataLookupBool(&mdok, config->arguments, "VARIANCE"); // Use variance for rejection? 38 36 bool safe = psMetadataLookupBool(&mdok, config->arguments, "SAFE"); // Play safe when combining small numbers of pixels? … … 67 65 } 68 66 69 if (!pmStackCombine(outRO, stack, mask Bad, maskBlank, kernelSize, iter, combineRej, true,67 if (!pmStackCombine(outRO, stack, maskVal, maskVal, kernelSize, iter, combineRej, true, 70 68 useVariance, safe)) { 71 69 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection."); … … 93 91 psRegionSet(0, outRO->image->numCols - 1, 94 92 0, outRO->image->numRows - 1), 95 mask Blank);93 maskVal); 96 94 psString name = NULL; // Name of image 97 95 psStringAppend(&name, "inspect_%03d_%03d.fits", sectionNum, i); … … 140 138 // Get the recipe values 141 139 bool mdok; // Status of MD lookup 142 psMaskType maskBad = psMetadataLookupU8(NULL, config->arguments, "MASK.BAD"); // Value to mask 143 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 140 psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask 144 141 bool useVariance = psMetadataLookupBool(&mdok, config->arguments, "VARIANCE"); // Use variance for rejection? 145 142 … … 208 205 psRegionSet(0, outRO->image->numCols - 1, 209 206 0, outRO->image->numRows - 1), 210 mask Blank);207 maskVal); 211 208 psString name = NULL; // Name of image 212 209 psStringAppend(&name, "reject_%03d.fits", i); … … 220 217 #endif 221 218 222 if (!pmStackCombine(outRO, stack, mask Bad, maskBlank, 0, 0, NAN, numGood != num, useVariance, false)) {219 if (!pmStackCombine(outRO, stack, maskVal, maskVal, 0, 0, NAN, numGood != num, useVariance, false)) { 223 220 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts."); 224 221 psFree(fpaList);
Note:
See TracChangeset
for help on using the changeset viewer.
