Changeset 20492
- Timestamp:
- Oct 31, 2008, 4:04:13 PM (18 years ago)
- Location:
- trunk/ppSub/src
- Files:
-
- 2 edited
-
ppSubArguments.c (modified) (2 diffs)
-
ppSubReadout.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubArguments.c
r19962 r20492 230 230 psMetadataAddS32(arguments, PS_LIST_TAIL, "-opt-order", 0, "Maximum order for optimum kernel search", -1); 231 231 psMetadataAddBool(arguments, PS_LIST_TAIL, "-dual", 0, "Dual convolution", false); 232 psMetadataAddBool(arguments, PS_LIST_TAIL, "-renorm", 0, "Renormalise weights?", false); 233 psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Renormalisation width", 0); 232 psMetadataAddBool(arguments, PS_LIST_TAIL, "-renorm", 0, "Renormalise variance maps?", false); 233 psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-mean", 0, 234 "Statistic for mean in renormalisation", NULL); 235 psMetadataAddStr(arguments, PS_LIST_TAIL, "-renorm-stdev", 0, 236 "Statistic for stdev in renormalisation", NULL); 237 psMetadataAddF32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Gaussian width for renormalisation", NAN); 238 psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-num", 0, "Number of samples for renormalisation", 0); 234 239 psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Perform photometry?", false); 235 240 psMetadataAddS32(arguments, PS_LIST_TAIL, "-threads", 0, "Number of threads", 0); … … 336 341 if (psMetadataLookupBool(NULL, arguments, "-renorm") || 337 342 psMetadataLookupBool(NULL, recipe, "RENORM")) { 338 psMetadataAddBool(recipe, PS_LIST_TAIL, "RENORM", PS_META_REPLACE, "Renormalise weights?", true); 339 VALUE_ARG_RECIPE_INT("-renorm-width", "RENORM.WIDTH", S32, 0); 340 } 343 psMetadataAddBool(arguments, PS_LIST_TAIL, "RENORM", 0, "Renormalise variance maps?", true); 344 } 345 VALUE_ARG_RECIPE_INT("-renorm-num", "RENORM.NUM", S32, 0); 346 VALUE_ARG_RECIPE_FLOAT("-renorm-width", "RENORM.WIDTH", F32); 347 valueArgRecipeStr(arguments, recipe, "-renorm-mean", "RENORM.MEAN", recipe); 348 valueArgRecipeStr(arguments, recipe, "-renorm-stdev", "RENORM.STDEV", recipe); 341 349 342 350 // Need to update this because it could have been overwritten by the camera's own recipe -
trunk/ppSub/src/ppSubReadout.c
r20126 r20492 116 116 int optOrder = psMetadataLookupS32(&mdok, recipe, "OPTIMUM.ORDER"); // Order for search 117 117 bool dual = psMetadataLookupBool(&mdok, recipe, "DUAL"); // Dual convolution? 118 bool renorm = psMetadataLookupBool(&mdok, recipe, "RENORM"); // Renormalise weights?119 int renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width for renormalise120 118 121 119 psString interpModeStr = psMetadataLookupStr(&mdok, recipe, "INTERPOLATION"); // Interpolation mode … … 433 431 } 434 432 435 if (renorm) { 436 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS, 0); // Random number generator 437 if (!pmReadoutWeightRenorm(outRO, maskBad, PS_STAT_ROBUST_MEDIAN, PS_STAT_ROBUST_STDEV, 438 renormWidth, rng)) { 439 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise weights for photometry."); 433 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) { 434 // Statistics for renormalisation 435 psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe, 436 "RENORM.MEAN")); 437 psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(&mdok, recipe, 438 "RENORM.STDEV")); 439 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples 440 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 441 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 442 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, 443 renormMean, renormStdev, NULL)) { 444 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 440 445 psFree(outRO); 441 446 return false; 442 447 } 443 psFree(rng);444 448 } 445 449
Note:
See TracChangeset
for help on using the changeset viewer.
