Changeset 25376 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Sep 14, 2009, 4:32:08 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r25313 r25376 161 161 return unbinned; 162 162 } 163 164 // Renormalise a readout's variance map 165 bool stackRenormaliseReadout(const pmConfig *config, // Configuration 166 pmReadout *readout // Readout to renormalise 167 ) 168 { 169 bool mdok; // Status of metadata lookups 170 171 psMetadata *recipe = psMetadataLookupPtr(NULL, config->recipes, PPSTACK_RECIPE); // Recipe for ppStack 172 psAssert(recipe, "Need PPSTACK recipe"); 173 174 if (!psMetadataLookupBool(&mdok, recipe, "RENORM")) return true; 175 176 int num = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); 177 if (!mdok) { 178 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.NUM is not set in the recipe"); 179 return false; 180 } 181 float minValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MIN"); 182 if (!mdok) { 183 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MIN is not set in the recipe"); 184 return false; 185 } 186 float maxValid = psMetadataLookupF32(&mdok, recipe, "RENORM.MAX"); 187 if (!mdok) { 188 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "RENORM.MAX is not set in the recipe"); 189 return false; 190 } 191 192 psImageMaskType maskBad = pmConfigMaskGet("BLANK", config); // Bits to mask 193 194 return pmReadoutVarianceRenormalise(readout, maskBad, num, minValid, maxValid); 195 } 196 163 197 164 198 … … 502 536 } 503 537 538 if (!stackRenormaliseReadout(config, readout)) { 539 psFree(rng); 540 psFree(bg); 541 return false; 542 } 504 543 505 544 // Measure the variance level for the weighting
Note:
See TracChangeset
for help on using the changeset viewer.
