Changeset 20554 for trunk/ppSub/src/ppSubReadout.c
- Timestamp:
- Nov 5, 2008, 2:01:21 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubReadout.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubReadout.c
r20523 r20554 118 118 bool dual = psMetadataLookupBool(&mdok, recipe, "DUAL"); // Dual convolution? 119 119 120 // Statistics for renormalisation 121 psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "RENORM.MEAN")); 122 psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe, "RENORM.STDEV")); 123 if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) { 124 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 125 "Unable to parse renormalisation statistics from recipe."); 126 return false; 127 } 128 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples for renormalisation 129 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 130 120 131 psString interpModeStr = psMetadataLookupStr(&mdok, recipe, "INTERPOLATION"); // Interpolation mode 121 132 psImageInterpolateMode interpMode = psImageInterpolateModeFromString(interpModeStr); // Interp … … 356 367 357 368 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) { 358 // Statistics for renormalisation359 psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,360 "RENORM.MEAN"));361 psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,362 "RENORM.STDEV"));363 if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {364 psError(PS_ERR_BAD_PARAMETER_VALUE, false,365 "Unable to parse renormalisation statistics from recipe.");366 psFree(outRO);367 return false;368 }369 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples370 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot371 369 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 372 370 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, … … 439 437 outRO->mask = (psImage*)psBinaryOp(outRO->mask, inConv->mask, "|", refConv->mask); 440 438 441 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true;442 443 pmReadoutMaskApply(outRO, maskBad);444 445 439 psFree(inConv); 446 440 psFree(refConv); 441 442 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true; 443 444 pmReadoutMaskApply(outRO, maskBad); 447 445 448 446 #ifdef TESTING … … 460 458 psFree(outRO); 461 459 return false; 462 }463 464 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) {465 // Statistics for renormalisation466 psStatsOptions renormMean = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,467 "RENORM.MEAN"));468 psStatsOptions renormStdev = psStatsOptionFromString(psMetadataLookupStr(NULL, recipe,469 "RENORM.STDEV"));470 if (renormMean == PS_STAT_NONE || renormStdev == PS_STAT_NONE) {471 psError(PS_ERR_BAD_PARAMETER_VALUE, false,472 "Unable to parse renormalisation statistics from recipe.");473 psFree(outRO);474 return false;475 }476 int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples477 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot478 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask479 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,480 renormMean, renormStdev, NULL)) {481 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");482 psFree(outRO);483 return false;484 }485 460 } 486 461 … … 562 537 } 563 538 539 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) { 540 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 541 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, 542 renormMean, renormStdev, NULL)) { 543 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 544 psFree(outRO); 545 return false; 546 } 547 } 548 564 549 // Need to ensure aperture residual is not calculated 565 550 psMetadata *psphotRecipe = psMetadataLookupMetadata(NULL, config->recipes, PSPHOT_RECIPE); // Recipe … … 636 621 } 637 622 623 // Renormalising for pixels, because that's what magic desires 624 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) { 625 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 626 if (!pmReadoutWeightRenormPixels(outRO, maskValue, renormMean, renormStdev, NULL)) { 627 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 628 psFree(outRO); 629 return false; 630 } 631 } 632 638 633 // Copy astrometry over 639 634 pmFPA *refFPA = refRO->parent->parent->parent; // Reference FPA
Note:
See TracChangeset
for help on using the changeset viewer.
