Changeset 25467 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Sep 21, 2009, 3:19:36 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r25447 r25467 15 15 #define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \ 16 16 PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply to input sources 17 #define FAINT_SOURCE_FRAC 1.0e-4 // Set minimum flux to this fraction of faintest source flux17 #define NOISE_FRACTION 0.01 // Set minimum flux to this fraction of noise 18 18 #define COVAR_FRAC 0.01 // Truncation fraction for covariance matrix 19 19 … … 319 319 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF 320 320 321 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_STDEV); // Statistics for background 322 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 323 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskVal | maskBad, rng)) { 324 psError(PS_ERR_UNKNOWN, false, "Can't measure background for image."); 325 psFree(fake); 326 psFree(optWidths); 327 psFree(conv); 328 psFree(bg); 329 psFree(rng); 330 return false; 331 } 332 float minFlux = NOISE_FRACTION * bg->robustStdev; // Minimum flux level for fake image 333 psFree(rng); 334 psFree(bg); 335 321 336 // For the sake of stamps, remove nearby sources 322 337 psArray *stampSources = stackSourcesFilter(options->sourceLists->data[index], … … 325 340 if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows, 326 341 stampSources, SOURCE_MASK, NULL, NULL, options->psf, 327 NAN, footprint + size, false, true)) {342 minFlux, footprint + size, false, true)) { 328 343 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF."); 329 344 psFree(fake); … … 371 386 PM_SUBTRACTION_ANALYSIS_KERNEL); // Conv kernel 372 387 if (kernel) { 373 if (!pmSubtractionMatchPrecalc( conv, NULL, readout, fake, readout->analysis,388 if (!pmSubtractionMatchPrecalc(NULL, conv, fake, readout, readout->analysis, 374 389 stride, sysError, maskVal, maskBad, maskPoor, 375 390 poorFrac, badFrac)) { … … 385 400 } 386 401 } else { 387 if (!pmSubtractionMatch( conv, NULL, readout, fake, footprint, stride, regionSize, spacing,402 if (!pmSubtractionMatch(NULL, conv, fake, readout, footprint, stride, regionSize, spacing, 388 403 threshold, stampSources, stampsName, type, size, order, widths, 389 404 orders, inner, ringsOrder, binning, penalty, 390 405 optimum, optWidths, optOrder, optThresh, iter, rej, sysError, 391 406 maskVal, maskBad, maskPoor, poorFrac, badFrac, 392 PM_SUBTRACTION_MODE_ 1)) {407 PM_SUBTRACTION_MODE_2)) { 393 408 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 394 409 psFree(fake);
Note:
See TracChangeset
for help on using the changeset viewer.
