- Timestamp:
- Jul 17, 2014, 2:28:55 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ppSub/src/ppSubMatchPSFs.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSub/src/ppSubMatchPSFs.c
r36581 r37080 167 167 } 168 168 169 // we need to register the FWHM values for use downstream 169 // we need to register the FWHM values for use downstream 170 170 pmSubtractionSetFWHMs(inFWHM, refFWHM); 171 171 … … 220 220 bool noConvolve = psMetadataLookupBool(&mdok, recipe, "NOCONVOLVE"); // Do not use convolved images. 221 221 if (noConvolve) { 222 psWarning("not matching PSFs because NOCONVOLVE is TRUE\n");223 return true;222 psWarning("not matching PSFs because NOCONVOLVE is TRUE\n"); 223 return true; 224 224 } 225 225 … … 235 235 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.INPUT.CONV"); // Cell for convolved input 236 236 inConv = pmReadoutAlloc(cell); 237 psFree(inConv);237 psFree(inConv); 238 238 } 239 239 pmReadout *refConv = pmFPAfileThisReadout(config->files, view, "PPSUB.REF.CONV"); // Reference convolved … … 241 241 pmCell *cell = pmFPAfileThisCell(config->files, view, "PPSUB.REF.CONV"); // Cell for convolved ref. 242 242 refConv = pmReadoutAlloc(cell); 243 psFree(refConv);243 psFree(refConv); 244 244 } 245 245 … … 269 269 lists->data[0] = psMemIncrRefCounter(inSources); 270 270 lists->data[1] = psMemIncrRefCounter(refSources); 271 // XXX MEH changed to get only match (true to cull single), no apparent need of unmatched sources and can cause trouble271 // XXX MEH changed to get only match (true to cull single), no apparent need of unmatched sources and can cause trouble 272 272 detections->allSources = pmSourceMatchMerge(lists, radius, true); 273 273 psFree(lists); … … 365 365 subMode = PM_SUBTRACTION_MODE_DUAL; 366 366 } else { 367 char *convolveName = psMetadataLookupStr(&mdok, recipe, "CONVOLVE.TARGET"); // recipe value for target367 char *convolveName = psMetadataLookupStr(&mdok, recipe, "CONVOLVE.TARGET"); // recipe value for target 368 368 int convolve = psMetadataLookupS32(&mdok, config->arguments, "-convolve"); // override with command-line option 369 switch (convolve) {370 case 0:371 // convolve is 0 if it is not supplied on the command line372 subMode = subModeFromString(convolveName);373 break;374 case 1:375 subMode = PM_SUBTRACTION_MODE_1;376 break;377 case 2:378 subMode = PM_SUBTRACTION_MODE_2;379 break;380 default:381 psError(PPSUB_ERR_ARGUMENTS, false, "Invalid value for -convolve");382 return false;383 }369 switch (convolve) { 370 case 0: 371 // convolve is 0 if it is not supplied on the command line 372 subMode = subModeFromString(convolveName); 373 break; 374 case 1: 375 subMode = PM_SUBTRACTION_MODE_1; 376 break; 377 case 2: 378 subMode = PM_SUBTRACTION_MODE_2; 379 break; 380 default: 381 psError(PPSUB_ERR_ARGUMENTS, false, "Invalid value for -convolve"); 382 return false; 383 } 384 384 } 385 385 … … 397 397 psKernel *truncated = psImageCovarianceTruncate(inRO->covariance, COVAR_FRAC); 398 398 psFree(inRO->covariance); 399 inRO->covariance = truncated;399 inRO->covariance = truncated; 400 400 } 401 401 if (refRO->covariance) { 402 402 psKernel *truncated = psImageCovarianceTruncate(refRO->covariance, COVAR_FRAC); 403 403 psFree(refRO->covariance); 404 refRO->covariance = truncated;404 refRO->covariance = truncated; 405 405 } 406 406 … … 458 458 ppSubDataQuality(data, error, PPSUB_FILES_ALL); 459 459 return true; 460 // XX } else if (error == PM_ERR_DATA) { 461 // XX psErrorStackPrint(stderr, "Unable to solve for the kernel to match images"); 462 // XX psWarning("Failed to find PSF match kernel --- suspect bad data quality."); 463 // XX ppSubDataQuality(data, error, PPSUB_FILES_ALL); 464 // XX return true; 460 465 } else { 461 466 psError(PPSUB_ERR_DATA, false, "Unable to match images."); … … 515 520 psKernel *truncated = psImageCovarianceTruncate(inConv->covariance, COVAR_FRAC); 516 521 psFree(inConv->covariance); 517 inConv->covariance = truncated;522 inConv->covariance = truncated; 518 523 } 519 524 if (refConv->covariance) { 520 525 psKernel *truncated = psImageCovarianceTruncate(refConv->covariance, COVAR_FRAC); 521 526 psFree(refConv->covariance); 522 refConv->covariance = truncated;527 refConv->covariance = truncated; 523 528 } 524 529
Note:
See TracChangeset
for help on using the changeset viewer.
