Changeset 13593
- Timestamp:
- Jun 1, 2007, 6:16:29 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
ppImage/src/ppImageDetrendReadout.c (modified) (2 diffs)
-
ppImage/src/ppImageOptions.c (modified) (2 diffs)
-
ppImage/src/ppImageOptions.h (modified) (1 diff)
-
ppMerge/src/ppMergeCombine.c (modified) (1 diff)
-
ppMerge/src/ppMergeOptions.c (modified) (5 diffs)
-
ppMerge/src/ppMergeOptions.h (modified) (1 diff)
-
ppStack/src/ppStackArguments.c (modified) (2 diffs)
-
ppSub/src/ppSubArguments.c (modified) (2 diffs)
-
ppSub/src/ppSubReadout.c (modified) (2 diffs)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotMaskReadout.c (modified) (2 diffs)
-
psphot/src/psphotReadout.c (modified) (2 diffs)
-
pswarp/src/pswarpArguments.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppImage/src/ppImageDetrendReadout.c
r13506 r13593 18 18 // Masking on the basis of pixel value needs to be done before anything else, so the values are pristine. 19 19 if (options->doMask || options->doShutter || options->doFlat || options->doPhotom) { 20 pmReadoutGenerateMask(input );20 pmReadoutGenerateMask(input, options->satMask, options->badMask); 21 21 } 22 22 // apply the externally supplied mask to the input->mask pixels … … 68 68 if (options->doFlat) { 69 69 pmReadout *flat = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.FLAT"); 70 if (!pmFlatField(input, flat )) {70 if (!pmFlatField(input, flat, options->flatMask)) { 71 71 return false; 72 72 } -
trunk/ppImage/src/ppImageOptions.c
r10214 r13593 24 24 // default flags for various activities 25 25 options->doMask = false; // Mask bad pixels 26 options->maskValue = 0xff; // Default mask value 26 options->maskValue = 0x00; // Default mask value 27 options->satMask = 0x00; // Saturated pixels 28 options->badMask = 0x00; // Bad pixels 29 options->flatMask = 0x00; // Bad flat pixels 27 30 28 31 options->doNonLin = false; // Non-linearity correction … … 163 166 // Mask recipe options 164 167 options->doMask = psMetadataLookupBool(NULL, recipe, "MASK"); 165 psMaskType maskValue = psMetadataLookupU8(&status, recipe, "MASK.VALUE");168 const char *masks = psMetadataLookupStr(&status, recipe, "MASK.VALUE"); 166 169 if (status) { 167 options->maskValue = maskValue; 168 } 170 options->maskValue = pmConfigMask(masks, config); 171 } 172 options->satMask = pmConfigMask("SAT", config); 173 options->badMask = pmConfigMask("BAD", config); 174 options->flatMask = pmConfigMask("FLAT", config); 175 169 176 170 177 options->doBias = psMetadataLookupBool(NULL, recipe, "BIAS"); -
trunk/ppImage/src/ppImageOptions.h
r9857 r13593 6 6 bool doMask; // Mask bad pixels 7 7 psMaskType maskValue; // apply this bit-mask to choose masked bits 8 psMaskType satMask; // Mask value to give saturated pixels 9 psMaskType badMask; // Mask value to give bad pixels 10 psMaskType flatMask; // Mask value to give bad flat pixels 8 11 9 12 bool doBias; // Bias subtraction -
trunk/ppMerge/src/ppMergeCombine.c
r12991 r13593 165 165 // If the mask value is set, we want to generate a mask 166 166 if (options->combine->maskVal) { 167 pmReadoutSetMask(stack->data[i] );167 pmReadoutSetMask(stack->data[i], options->satMask, options->badMask); 168 168 } 169 169 -
trunk/ppMerge/src/ppMergeOptions.c
r13246 r13593 59 59 options->combine->maskVal = 0xff; 60 60 options->combine->weights = false; 61 options->satMask = 0x00; 62 options->badMask = 0x00; 61 63 62 64 return options; … … 141 143 OPTION_PARSE(options->combine->fracLow, recipe, "FRACLOW", F32); 142 144 OPTION_PARSE(options->combine->nKeep, recipe, "NKEEP", S32); 143 OPTION_PARSE(options->combine->maskVal, recipe, "MASKVAL", S32);144 145 OPTION_PARSE(options->combine->weights, recipe, "WEIGHTS", Bool); 145 146 OPTION_PARSE(options->fringeNum, recipe, "FRINGE.NUM", S32); … … 153 154 OPTION_PARSE(options->maskBad, recipe, "MASK.BAD", F32); 154 155 156 const char *masks = psMetadataLookupStr(NULL, recipe, "MASKVAL"); 157 options->combine->maskVal = pmConfigMask(masks, config); 158 155 159 options->combine->combine = parseStat(recipe, "COMBINE"); 156 160 options->mean = parseStat(recipe, "MEAN"); … … 238 242 } 239 243 240 241 244 #if 0 242 245 // Or you can set them individually … … 249 252 OPTION_PARSE(options->onOff, config->arguments, "-onoff", S32); 250 253 254 // Masking options 255 options->satMask = pmConfigMask("SAT", config); 256 options->badMask = pmConfigMask("BAD", config); 257 251 258 return options; 252 259 } -
trunk/ppMerge/src/ppMergeOptions.h
r9996 r13593 39 39 ppOnOff onOff; // On/off pairs? 40 40 pmCombineParams *combine; // Combination parameters 41 psMaskType satMask; // Mask value for saturated pixels 42 psMaskType badMask; // Mask value for bad (low) pixels 41 43 } ppMergeOptions; 42 44 -
trunk/ppStack/src/ppStackArguments.c
r13557 r13593 64 64 } 65 65 66 // Get a mask value from the command-line or recipe, and add it to the arguments 67 #define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \ 68 bool mdok; \ 69 const char *name = psMetadataLookupStr(&mdok, arguments, ARGNAME); \ 70 if (!mdok || !name || strlen(name) == 0) { \ 71 name = psMetadataLookupStr(NULL, recipe, RECIPENAME); \ 72 if (!name) { \ 73 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find %s in recipe %s", \ 74 RECIPENAME, PPSTACK_RECIPE); \ 75 goto ERROR; \ 76 } \ 77 } \ 78 psMaskType value = pmConfigMask(name, config); \ 79 psMetadataAddU8(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \ 80 } 81 66 82 // Get a string value from the command-line and add it to the target 67 83 static bool valueArgStr(pmConfig *config, // Configuration … … 119 135 VALUE_ARG_RECIPE_FLOAT("-convolve-rej", "CONVOLVE.REJ", F32); 120 136 VALUE_ARG_RECIPE_FLOAT("-extent", "EXTENT", F32); 121 VALUE_ARG_RECIPE_ INT("-mask-bad", "MASK.BAD", U8, 0);122 VALUE_ARG_RECIPE_ INT("-mask-blank", "MASK.BLANK", U8, 0);137 VALUE_ARG_RECIPE_MASK("-mask-bad", "MASK.BAD"); 138 VALUE_ARG_RECIPE_MASK("-mask-blank", "MASK.BLANK"); 123 139 124 140 psTrace("ppStack", 1, "Done reading command-line arguments\n"); -
trunk/ppSub/src/ppSubArguments.c
r13509 r13593 57 57 } \ 58 58 psMetadataAdd##TYPE(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \ 59 } 60 61 // Get a mask value from the command-line or recipe, and add it to the arguments 62 #define VALUE_ARG_RECIPE_MASK(ARGNAME, RECIPENAME) { \ 63 bool mdok; \ 64 const char *name = psMetadataLookupStr(&mdok, arguments, ARGNAME); \ 65 if (!mdok || !name || strlen(name) == 0) { \ 66 name = psMetadataLookupStr(NULL, recipe, RECIPENAME); \ 67 if (!name) { \ 68 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Unable to find %s in recipe %s", \ 69 RECIPENAME, PPSUB_RECIPE); \ 70 goto ERROR; \ 71 } \ 72 } \ 73 psMaskType value = pmConfigMask(name, config); \ 74 psMetadataAddU8(config->arguments, PS_LIST_TAIL, RECIPENAME, 0, NULL, value); \ 59 75 } 60 76 … … 200 216 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, 0); 201 217 VALUE_ARG_RECIPE_FLOAT("-rej", "REJ", F32); 202 VALUE_ARG_RECIPE_ INT("-mask-bad", "MASK.BAD", U8, 0);203 VALUE_ARG_RECIPE_ INT("-mask-blank", "MASK.BLANK", U8, 0);218 VALUE_ARG_RECIPE_MASK("-mask-bad", "MASK.BAD"); 219 VALUE_ARG_RECIPE_MASK("-mask-blank", "MASK.BLANK"); 204 220 205 221 vectorArgRecipe(config, arguments, "-isis-widths", recipe, "ISIS.WIDTHS", config->arguments, PS_TYPE_F32); -
trunk/ppSub/src/ppSubReadout.c
r13508 r13593 42 42 psMaskType maskBlank = psMetadataLookupU8(NULL, config->arguments, "MASK.BLANK"); // Mask for blank reg. 43 43 44 if (!inRO->mask && !pmReadoutGenerateMask(inRO)) { 44 psMaskType maskSat = pmConfigMask("SAT", config); // Mask for saturated pixels 45 psMaskType maskLow = pmConfigMask("BAD", config); // Mask for bad (low) pixels 46 47 if (!inRO->mask && !pmReadoutGenerateMask(inRO, maskSat, maskLow)) { 45 48 psError(PS_ERR_UNKNOWN, false, "Unable to generate mask for input image"); 46 49 return false; … … 50 53 return false; 51 54 } 52 if (!refRO->mask && !pmReadoutGenerateMask(refRO )) {55 if (!refRO->mask && !pmReadoutGenerateMask(refRO, maskSat, maskLow)) { 53 56 psError(PS_ERR_UNKNOWN, false, "Unable to generate mask for reference image"); 54 57 return false; -
trunk/psphot/src/psphot.h
r13411 r13593 57 57 int pmSourceSortByY (const void **a, const void **b); 58 58 bool psphotGrowthCurve (pmReadout *readout, pmPSF *psf, bool ignore); 59 bool psphotMaskReadout (pmReadout *readout, psMetadata *recipe );59 bool psphotMaskReadout (pmReadout *readout, psMetadata *recipe, pmConfig *config); 60 60 void psphotSourceFreePixels (psArray *sources); 61 61 -
trunk/psphot/src/psphotMaskReadout.c
r12792 r13593 1 1 # include "psphotInternal.h" 2 2 3 bool psphotMaskReadout (pmReadout *readout, psMetadata *recipe ) {4 3 bool psphotMaskReadout (pmReadout *readout, psMetadata *recipe, pmConfig *config) { 4 5 5 bool status; 6 6 … … 19 19 20 20 // psImageKeepRegion assumes the region refers to the parent coordinates 21 psImageKeepRegion (readout->mask, keep, "OR", PM_MASK_BAD);21 psImageKeepRegion (readout->mask, keep, "OR", pmConfigMask("BAD", config)); 22 22 23 23 return true; -
trunk/psphot/src/psphotReadout.c
r13411 r13593 24 24 25 25 // generate mask & weight images if they don't already exit 26 if ((!readout->mask && !pmReadoutGenerateMask(readout)) || 26 if ((!readout->mask && !pmReadoutGenerateMask(readout, pmConfigMask("SAT", config), 27 pmConfigMask("BAD", config))) || 27 28 (!readout->weight && !pmReadoutGenerateWeight(readout, true))) { 28 29 psError (PSPHOT_ERR_CONFIG, false, "trouble creating mask and/or weight"); … … 37 38 38 39 // I have a valid mask, now mask in the analysis region of interest 39 psphotMaskReadout (readout, recipe );40 psphotMaskReadout (readout, recipe, config); 40 41 41 42 // run a single-model test if desired -
trunk/pswarp/src/pswarpArguments.c
r13104 r13593 102 102 103 103 // Get mask parameters 104 psMaskType maskIn = psMetadataLookupU8(&status, recipe, "MASK.IN"); // Mask for input data 105 if (!status) { 104 psMaskType maskIn, maskPoor, maskBad; // Mask values for input, "poor" and "bad" pixels 105 106 psString maskNames = psMetadataLookupStr(&status, recipe, "MASK.IN"); 107 if (!status) { 106 108 maskIn = 0x00; 107 109 psWarning("MASK.IN is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskIn); 108 110 } 109 psMaskType maskPoor = psMetadataLookupU8(&status, recipe, "MASK.POOR"); // Mask for "poor" warped data 111 maskIn = pmConfigMask(maskNames, config); // Mask for input data 112 113 maskNames = psMetadataLookupStr(&status, recipe, "MASK.POOR"); 110 114 if (!status) { 111 115 maskPoor = 0x00; 112 116 psWarning("MASK.POOR is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskPoor); 113 117 } 114 psMaskType maskBad = psMetadataLookupU8(&status, recipe, "MASK.IN"); // Mask for bad warped data 118 maskPoor = pmConfigMask(maskNames, config); // Mask for "poor" warped data 119 120 maskNames = psMetadataLookupStr(&status, recipe, "MASK.BAD"); 115 121 if (!status) { 116 122 maskBad = 0x00; 117 123 psWarning("MASK.BAD is not set in the %s recipe --- defaulting to %x.", PSWARP_RECIPE, maskBad); 118 124 } 125 maskBad = pmConfigMask(maskNames, config); // Mask for bad warped data 126 119 127 float poorFrac = psMetadataLookupF32(&status, recipe, "POOR.FRAC"); // Frac of bad flux for a "poor" 120 128 if (!status) {
Note:
See TracChangeset
for help on using the changeset viewer.
