Changeset 20523
- Timestamp:
- Nov 3, 2008, 5:24:25 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubReadout.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubReadout.c
r20519 r20523 355 355 outRO->data_exists = outCell->data_exists = outCell->parent->data_exists = true; 356 356 357 if (psMetadataLookupBool(&mdok, recipe, "RENORM")) { 358 // Statistics for renormalisation 359 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 samples 370 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 371 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 372 if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth, 373 renormMean, renormStdev, NULL)) { 374 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 375 psFree(outRO); 376 return false; 377 } 378 } 379 357 380 pmFPAfile *photFile = psMetadataLookupPtr(NULL, config->files, "PSPHOT.INPUT"); 358 381 pmFPACopy(photFile->fpa, outRO->parent->parent->parent); … … 362 385 // scratch. 363 386 387 if (psMetadataLookupBool(&mdok, recipe, "PSPHOT.VISUAL")) { 388 psphotSetVisual(true); 389 } 390 364 391 // Need to ensure aperture residual is not calculated 365 psMetadata * recipe = psMetadataLookupMetadata(NULL, config->recipes, PSPHOT_RECIPE); // Recipe366 if (! recipe) {392 psMetadata *psphotRecipe = psMetadataLookupMetadata(NULL, config->recipes, PSPHOT_RECIPE); // Recipe 393 if (!psphotRecipe) { 367 394 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find %s recipe.", PSPHOT_RECIPE); 368 395 return false; 369 396 } 370 const char *breakpoint = psMetadataLookupStr(&mdok, recipe, "BREAK_POINT"); // Current break point371 psMetadataAddStr( recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE,397 const char *breakpoint = psMetadataLookupStr(&mdok, psphotRecipe, "BREAK_POINT"); // Current break point 398 psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, 372 399 "ALTERED break point for psphot operations", "PSFMODEL"); 373 400 … … 375 402 psMaskType maskValue = maskVal; 376 403 psMaskType markValue = pmConfigMaskGet("MARK.VALUE", config); // Bits to use for marking 377 psMetadataAddU8( recipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "Bits to mask", maskValue);378 psMetadataAddU8( recipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "Bits to use for marking",404 psMetadataAddU8(psphotRecipe, PS_LIST_TAIL, "MASK.PSPHOT", PS_META_REPLACE, "Bits to mask", maskValue); 405 psMetadataAddU8(psphotRecipe, PS_LIST_TAIL, "MARK.PSPHOT", PS_META_REPLACE, "Bits to use for marking", 379 406 markValue); 380 407 … … 386 413 387 414 if (breakpoint) { 388 psMetadataAddStr( recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE,415 psMetadataAddStr(psphotRecipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_REPLACE, 389 416 "RESTORED break point for psphot operations", breakpoint); 390 417 }
Note:
See TracChangeset
for help on using the changeset viewer.
