Changeset 30619 for trunk/ppSub/src/ppSubMatchPSFs.c
- Timestamp:
- Feb 13, 2011, 11:43:27 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubMatchPSFs.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubMatchPSFs.c
r29937 r30619 78 78 return true; 79 79 } 80 81 80 psFree(view); 82 81 … … 127 126 if (!inSourceRO || !refSourceRO) { 128 127 psError(PPSUB_ERR_DATA, false, "Unable to scale kernel, since no sources were provided."); 128 psFree(view); 129 129 return false; 130 130 } … … 164 164 165 165 // is auto-scaling needed? 166 if (!psMetadataLookupBool(NULL, recipe, "SCALE")) { 167 // No scaling requested 168 psFree(view); 169 return true; 170 } 171 166 bool scale = psMetadataLookupBool(NULL, recipe, "SCALE"); 172 167 float scaleRef = psMetadataLookupF32(NULL, recipe, "SCALE.REF"); // Reference for scaling 173 168 float scaleMin = psMetadataLookupF32(NULL, recipe, "SCALE.MIN"); // Minimum for scaling 174 169 float scaleMax = psMetadataLookupF32(NULL, recipe, "SCALE.MAX"); // Maximum for scaling 175 if (!isfinite(scaleRef) || !isfinite(scaleMin) || !isfinite(scaleMax)) { 170 171 if (scale && (!isfinite(scaleRef) || !isfinite(scaleMin) || !isfinite(scaleMax))) { 176 172 psError(PPSUB_ERR_ARGUMENTS, false, 177 " Scale parameters (SCALE.REF=%f, SCALE.MIN=%f, SCALE.MAX=%f) not set in recipe.",173 "auto-scale selected but scale parameters (SCALE.REF=%f, SCALE.MIN=%f, SCALE.MAX=%f) not set in recipe.", 178 174 scaleRef, scaleMin, scaleMax); 179 175 return false; 180 176 } 181 177 182 if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths, scaleRef, scaleMin, scaleMax)) { 183 psError(PPSUB_ERR_DATA, false, "Unable to scale parameters."); 184 return false; 185 } 178 pmSubtractionParamScaleOptions(scale, scaleRef, scaleMin, scaleMax); 179 180 // if (!pmSubtractionParamsScale(kernelSize, stampSize, kernelWidths)) { 181 // psError(PPSUB_ERR_DATA, false, "Unable to scale parameters."); 182 // return false; 183 // } 186 184 187 185 return true; … … 221 219 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.INPUT.CONV"); // Cell for convolved input 222 220 inConv = pmReadoutAlloc(cell); 221 psFree(inConv); 223 222 } 224 223 pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference convolved … … 226 225 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.REF.CONV"); // Cell for convolved ref. 227 226 refConv = pmReadoutAlloc(cell); 227 psFree(refConv); 228 228 } 229 229 … … 380 380 381 381 if (inRO->covariance) { 382 psImageCovarianceTruncate(inRO->covariance, COVAR_FRAC); 382 psKernel *truncated = psImageCovarianceTruncate(inRO->covariance, COVAR_FRAC); 383 psFree(inRO->covariance); 384 inRO->covariance = truncated; 383 385 } 384 386 if (refRO->covariance) { 385 psImageCovarianceTruncate(refRO->covariance, COVAR_FRAC); 387 psKernel *truncated = psImageCovarianceTruncate(refRO->covariance, COVAR_FRAC); 388 psFree(refRO->covariance); 389 refRO->covariance = truncated; 386 390 } 387 391 … … 494 498 495 499 if (inConv->covariance) { 496 psImageCovarianceTruncate(inConv->covariance, COVAR_FRAC); 500 psKernel *truncated = psImageCovarianceTruncate(inConv->covariance, COVAR_FRAC); 501 psFree(inConv->covariance); 502 inConv->covariance = truncated; 497 503 } 498 504 if (refConv->covariance) { 499 psImageCovarianceTruncate(refConv->covariance, COVAR_FRAC); 505 psKernel *truncated = psImageCovarianceTruncate(refConv->covariance, COVAR_FRAC); 506 psFree(refConv->covariance); 507 refConv->covariance = truncated; 500 508 } 501 509
Note:
See TracChangeset
for help on using the changeset viewer.
