Changeset 19172
- Timestamp:
- Aug 22, 2008, 2:05:48 PM (18 years ago)
- Location:
- trunk/ppStack/src
- Files:
-
- 4 edited
-
ppStackArguments.c (modified) (2 diffs)
-
ppStackLoop.c (modified) (1 diff)
-
ppStackMatch.c (modified) (7 diffs)
-
ppStackReadout.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackArguments.c
r19123 r19172 145 145 psMetadataAddF32(arguments, PS_LIST_TAIL, "-combine-rej", 0, 146 146 "Combination rejection thresold (sigma)", NAN); 147 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value for bad pixels", 0); 148 psMetadataAddU8(arguments, PS_LIST_TAIL, "-mask-blank", 0, "Mask value for blank region", 0); 147 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-val", 0, "Mask value of input bad pixels", NULL); 148 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-bad", 0, "Mask value to give bad pixels", NULL); 149 psMetadataAddStr(arguments, PS_LIST_TAIL, "-mask-poor", 0, "Mask value to give poor pixels", NULL); 149 150 psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold-mask", 0, "Threshold for mask deconvolution", NAN); 150 151 psMetadataAddF32(arguments, PS_LIST_TAIL, "-image-rej", 0, … … 219 220 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, 0); 220 221 VALUE_ARG_RECIPE_FLOAT("-combine-rej", "COMBINE.REJ", F32); 221 VALUE_ARG_RECIPE_MASK("-mask-bad", "MASK.BAD");222 VALUE_ARG_RECIPE_MASK("-mask-blank", "MASK.BLANK");223 222 VALUE_ARG_RECIPE_FLOAT("-threshold-mask", "THRESHOLD.MASK", F32); 224 223 VALUE_ARG_RECIPE_FLOAT("-image-rej", "IMAGE.REJ", F32); 225 224 VALUE_ARG_RECIPE_INT("-rows", "ROWS", S32, 0); 225 226 valueArgRecipeStr(arguments, recipe, "-mask-val", "MASK.VAL", recipe); 227 valueArgRecipeStr(arguments, recipe, "-mask-bad", "MASK.BAD", recipe); 228 valueArgRecipeStr(arguments, recipe, "-mask-poor", "MASK.POOR", recipe); 226 229 227 230 VALUE_ARG_RECIPE_FLOAT("-source-radius", "SOURCE.RADIUS", F32); -
trunk/ppStack/src/ppStackLoop.c
r19072 r19172 803 803 if (stats) { 804 804 psTrace("ppStack", 1, "Gathering statistics on stacked image....\n"); 805 ppStatsFPA(stats, outCell->parent->parent, view, pmConfigMaskGet("BLANK", config), config); 805 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad 806 psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 807 808 ppStatsFPA(stats, outCell->parent->parent, view, maskBad, config); 806 809 } 807 810 -
trunk/ppStack/src/ppStackMatch.c
r19123 r19172 34 34 int size = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size 35 35 36 psMaskType maskIn = pmConfigMaskGet("MASK.VALUE", config); // Bits to mask going in to pmSubtractionMatch 37 psMaskType maskOut = pmConfigMaskGet("BLANK", config); // Bits to mask after pmSubtractionMatch 36 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 37 psMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 38 psString maskPoorStr = psMetadataLookupStr(NULL, recipe, "MASK.POOR"); // Name of bits to mask for poor 39 psMaskType maskPoor = pmConfigMaskGet(maskPoorStr, config); // Bits to mask for poor pixels 40 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 41 psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 38 42 39 43 bool mdok; // Status of MD lookup … … 45 49 int threads = psMetadataLookupS32(NULL, config->arguments, "-threads"); // Number of threads 46 50 47 if (!pmReadoutMaskNonfinite(readout, mask In)) {51 if (!pmReadoutMaskNonfinite(readout, maskVal)) { 48 52 psError(PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in readout."); 49 53 return false; … … 75 79 float optThresh = psMetadataLookupF32(&mdok, ppsub, "OPTIMUM.TOL"); // Tolerance for search 76 80 int optOrder = psMetadataLookupS32(&mdok, ppsub, "OPTIMUM.ORDER"); // Order for search 81 float poorFrac = psMetadataLookupF32(&mdok, ppsub, "POOR.FRACTION"); // Fraction for "poor" 77 82 78 83 // These values are specified specifically for stacking … … 87 92 { 88 93 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for bg 89 if (!psImageBackground(bg, NULL, readout->image, readout->mask, mask In, rng)) {94 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal, rng)) { 90 95 psWarning("Can't measure background for image."); 91 96 psErrorClear(); … … 136 141 sources, stampsName, type, size, order, widths, orders, inner, ringsOrder, 137 142 binning, penalty, optimum, optWidths, optOrder, optThresh, iter, rej, 138 mask In, maskOut, badFrac, PM_SUBTRACTION_MODE_1)) {143 maskVal, maskBad, maskPoor, poorFrac, badFrac, PM_SUBTRACTION_MODE_1)) { 139 144 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 140 145 psFree(fake); … … 226 231 if (renorm) { 227 232 psLogMsg("ppStack", PS_LOG_INFO, "Renormalising variance map."); 228 if (!pmReadoutWeightRenorm(readout, mask Out, renormMean, renormStdev, renormWidth, rng)) {233 if (!pmReadoutWeightRenorm(readout, maskBad, renormMean, renormStdev, renormWidth, rng)) { 229 234 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 230 235 psFree(output); … … 235 240 // Ensure the background value is zero 236 241 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background 237 if (!psImageBackground(bg, NULL, readout->image, readout->mask, mask Out, rng)) {242 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 238 243 psWarning("Can't measure background for image."); 239 244 psErrorClear(); -
trunk/ppStack/src/ppStackReadout.c
r18918 r19172 10 10 #include "ppStack.h" 11 11 12 //#define REJECTION_FILES // Write rejection mask?13 //#define INSPECTION_FILES // Write inspection mask?14 //#define COMBINED_FILES // Write combined images?12 #define REJECTION_FILES // Write rejection mask? 13 #define INSPECTION_FILES // Write inspection mask? 14 #define COMBINED_FILES // Write combined images? 15 15 16 16 … … 34 34 int iter = psMetadataLookupS32(NULL, recipe, "ITER"); // Rejection iterations 35 35 float combineRej = psMetadataLookupF32(NULL, recipe, "COMBINE.REJ"); // Combination threshold 36 psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask37 36 bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection? 38 37 bool safe = psMetadataLookupBool(&mdok, recipe, "SAFE"); // Be safe when combining small numbers of pixels … … 40 39 psMetadata *ppsub = psMetadataLookupMetadata(NULL, config->recipes, "PPSUB"); // PPSUB recipe 41 40 int kernelSize = psMetadataLookupS32(NULL, ppsub, "KERNEL.SIZE"); // Kernel half-size 41 42 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 43 psMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 44 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 45 psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 42 46 43 47 int num = readouts->n; // Number of inputs … … 67 71 } 68 72 69 if (!pmStackCombine(outRO, stack, maskVal , maskVal, kernelSize, iter, combineRej, true,73 if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, kernelSize, iter, combineRej, true, 70 74 useVariance, safe)) { 71 75 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts with rejection."); … … 93 97 psRegionSet(0, outRO->image->numCols - 1, 94 98 0, outRO->image->numRows - 1), 95 mask Val);99 maskBad); 96 100 psString name = NULL; // Name of image 97 101 psStringAppend(&name, "inspect_%03d_%03d.fits", sectionNum, i); … … 143 147 144 148 bool mdok; // Status of MD lookup 145 psMaskType maskVal = pmConfigMaskGet("BLANK", config); // Value to mask146 149 bool useVariance = psMetadataLookupBool(&mdok, recipe, "VARIANCE"); // Use variance for rejection? 150 151 psString maskValStr = psMetadataLookupStr(NULL, recipe, "MASK.VAL"); // Name of bits to mask going in 152 psMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask going in to pmSubtractionMatch 153 psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad 154 psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels 147 155 148 156 int num = readouts->n; // Number of inputs … … 210 218 psRegionSet(0, outRO->image->numCols - 1, 211 219 0, outRO->image->numRows - 1), 212 mask Val);220 maskBad); 213 221 psString name = NULL; // Name of image 214 222 psStringAppend(&name, "reject_%03d.fits", i); … … 222 230 #endif 223 231 224 if (!pmStackCombine(outRO, stack, maskVal, maskVal, 0, 0, NAN, numGood != num, useVariance, false)) { 232 if (!pmStackCombine(outRO, stack, maskVal | maskBad, maskBad, 0, 0, NAN, 233 numGood != num, useVariance, false)) { 225 234 psError(PS_ERR_UNKNOWN, false, "Unable to combine input readouts."); 226 235 psFree(fpaList);
Note:
See TracChangeset
for help on using the changeset viewer.
