Changeset 37061
- Timestamp:
- Jul 17, 2014, 11:54:03 AM (12 years ago)
- File:
-
- 1 edited
-
tags/ipp-20130712/ppSub/src/ppSubMatchPSFs.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20130712/ppSub/src/ppSubMatchPSFs.c
r35922 r37061 160 160 } 161 161 162 // we need to register the FWHM values for use downstream 162 // we need to register the FWHM values for use downstream 163 163 pmSubtractionSetFWHMs(inFWHM, refFWHM); 164 164 … … 213 213 bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images. 214 214 if (noConvolve) { 215 psWarning("not matching PSFs because NOCONVOLVE is TRUE\n");216 return true;215 psWarning("not matching PSFs because NOCONVOLVE is TRUE\n"); 216 return true; 217 217 } 218 218 … … 228 228 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.INPUT.CONV"); // Cell for convolved input 229 229 inConv = pmReadoutAlloc(cell); 230 psFree(inConv);230 psFree(inConv); 231 231 } 232 232 pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference convolved … … 234 234 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.REF.CONV"); // Cell for convolved ref. 235 235 refConv = pmReadoutAlloc(cell); 236 psFree(refConv);236 psFree(refConv); 237 237 } 238 238 … … 262 262 lists->data[0] = psMemIncrRefCounter(inSources); 263 263 lists->data[1] = psMemIncrRefCounter(refSources); 264 // XXX MEH changed to get only match (true to cull single), no apparent need of unmatched sources and can cause trouble264 // XXX MEH changed to get only match (true to cull single), no apparent need of unmatched sources and can cause trouble 265 265 detections->allSources = pmSourceMatchMerge(lists, radius, true); 266 266 psFree(lists); … … 358 358 subMode = PM_SUBTRACTION_MODE_DUAL; 359 359 } else { 360 char *convolveName = psMetadataLookupStr(&mdok, recipe, "CONVOLVE.TARGET"); // recipe value for target360 char *convolveName = psMetadataLookupStr(&mdok, recipe, "CONVOLVE.TARGET"); // recipe value for target 361 361 int convolve = psMetadataLookupS32(&mdok, config->arguments, "-convolve"); // override with command-line option 362 switch (convolve) {363 case 0:364 // convolve is 0 if it is not supplied on the command line365 subMode = subModeFromString(convolveName);366 break;367 case 1:368 subMode = PM_SUBTRACTION_MODE_1;369 break;370 case 2:371 subMode = PM_SUBTRACTION_MODE_2;372 break;373 default:374 psError(PPSUB_ERR_ARGUMENTS, false, "Invalid value for -convolve");375 return false;376 }362 switch (convolve) { 363 case 0: 364 // convolve is 0 if it is not supplied on the command line 365 subMode = subModeFromString(convolveName); 366 break; 367 case 1: 368 subMode = PM_SUBTRACTION_MODE_1; 369 break; 370 case 2: 371 subMode = PM_SUBTRACTION_MODE_2; 372 break; 373 default: 374 psError(PPSUB_ERR_ARGUMENTS, false, "Invalid value for -convolve"); 375 return false; 376 } 377 377 } 378 378 … … 390 390 psKernel *truncated = psImageCovarianceTruncate(inRO->covariance, COVAR_FRAC); 391 391 psFree(inRO->covariance); 392 inRO->covariance = truncated;392 inRO->covariance = truncated; 393 393 } 394 394 if (refRO->covariance) { 395 395 psKernel *truncated = psImageCovarianceTruncate(refRO->covariance, COVAR_FRAC); 396 396 psFree(refRO->covariance); 397 refRO->covariance = truncated;397 refRO->covariance = truncated; 398 398 } 399 399 … … 451 451 ppSubDataQuality(data, error, PPSUB_FILES_ALL); 452 452 return true; 453 // XX } else if (error == PM_ERR_DATA) { 454 // XX psErrorStackPrint(stderr, "Unable to solve for the kernel to match images"); 455 // XX psWarning("Failed to find PSF match kernel --- suspect bad data quality."); 456 // XX ppSubDataQuality(data, error, PPSUB_FILES_ALL); 457 // XX return true; 453 458 } else { 454 459 psError(PPSUB_ERR_DATA, false, "Unable to match images."); … … 508 513 psKernel *truncated = psImageCovarianceTruncate(inConv->covariance, COVAR_FRAC); 509 514 psFree(inConv->covariance); 510 inConv->covariance = truncated;515 inConv->covariance = truncated; 511 516 } 512 517 if (refConv->covariance) { 513 518 psKernel *truncated = psImageCovarianceTruncate(refConv->covariance, COVAR_FRAC); 514 519 psFree(refConv->covariance); 515 refConv->covariance = truncated;520 refConv->covariance = truncated; 516 521 } 517 522
Note:
See TracChangeset
for help on using the changeset viewer.
