Changeset 25624 for branches/eam_branches/20090715/ppStack
- Timestamp:
- Sep 27, 2009, 11:34:07 AM (17 years ago)
- Location:
- branches/eam_branches/20090715/ppStack/src
- Files:
-
- 4 edited
-
ppStackCamera.c (modified) (2 diffs)
-
ppStackMatch.c (modified) (6 diffs)
-
ppStackPSF.c (modified) (2 diffs)
-
ppStackReject.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/ppStack/src/ppStackCamera.c
r23576 r25624 85 85 psFree(runVars); 86 86 87 psArray *runPSF = pmFPAfileDefineMultipleFromRun(&status, runImages, config,88 "PPSTACK.INPUT.PSF"); // Input PSFs89 if (!status) {90 psError(PS_ERR_UNKNOWN, false, "Unable to define input PSFs from RUN metadata.");91 psFree(runImages);92 return false;93 }94 if (runPSF) {95 havePSFs = true;96 }97 psFree(runPSF);98 99 87 psArray *runSrc = pmFPAfileDefineMultipleFromRun(&status, runImages, config, 100 88 "PPSTACK.INPUT.SOURCES"); // Input sources … … 112 100 113 101 if (convolve) { 114 psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config, 115 "PPSTACK.CONV.KERNEL"); // Convolution kernels 116 if (!status) { 117 psError(PS_ERR_UNKNOWN, false, "Unable to define convolution kernels from RUN metadata."); 118 psFree(runImages); 119 return false; 120 } 121 if (!runKernel) { 122 psError(PS_ERR_UNEXPECTED_NULL, true, 123 "Unable to define convolution kernels from RUN metadata."); 124 psFree(runImages); 125 return false; 126 } 127 psFree(runKernel); 102 { 103 psArray *runPSF = pmFPAfileDefineMultipleFromRun(&status, runImages, config, 104 "PPSTACK.INPUT.PSF"); // Input PSFs 105 if (!status) { 106 psError(PS_ERR_UNKNOWN, false, "Unable to define input PSFs from RUN metadata."); 107 psFree(runImages); 108 return false; 109 } 110 if (runPSF) { 111 havePSFs = true; 112 } 113 psFree(runPSF); 114 } 115 { 116 117 psArray *runKernel = pmFPAfileDefineMultipleFromRun(&status, runImages, config, 118 "PPSTACK.CONV.KERNEL"); // Conv'n kernels 119 if (!status) { 120 psError(PS_ERR_UNKNOWN, false, "Unable to define convolution kernels from RUN metadata."); 121 psFree(runImages); 122 return false; 123 } 124 if (!runKernel) { 125 psError(PS_ERR_UNEXPECTED_NULL, true, 126 "Unable to define convolution kernels from RUN metadata."); 127 psFree(runImages); 128 return false; 129 } 130 psFree(runKernel); 131 } 128 132 } 129 133 -
branches/eam_branches/20090715/ppStack/src/ppStackMatch.c
r25406 r25624 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 … … 266 266 psRegion *region = psMetadataLookupPtr(NULL, conv->analysis, 267 267 PM_SUBTRACTION_ANALYSIS_REGION); // Convolution region 268 269 pmSubtractionAnalysis(readout->analysis, kernels, region, 268 pmSubtractionKernels *kernels = psMetadataLookupPtr(NULL, conv->analysis, 269 PM_SUBTRACTION_ANALYSIS_KERNEL); 270 271 pmSubtractionAnalysis(readout->analysis, NULL, kernels, region, 270 272 readout->image->numCols, readout->image->numRows); 271 273 … … 317 319 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF 318 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 319 336 // For the sake of stamps, remove nearby sources 320 337 psArray *stampSources = stackSourcesFilter(options->sourceLists->data[index], … … 323 340 if (!pmReadoutFakeFromSources(fake, readout->image->numCols, readout->image->numRows, 324 341 stampSources, SOURCE_MASK, NULL, NULL, options->psf, 325 NAN, footprint + size, false, true)) {342 minFlux, footprint + size, false, true)) { 326 343 psError(PS_ERR_UNKNOWN, false, "Unable to generate fake image with target PSF."); 327 344 psFree(fake); … … 369 386 PM_SUBTRACTION_ANALYSIS_KERNEL); // Conv kernel 370 387 if (kernel) { 371 if (!pmSubtractionMatchPrecalc( conv, NULL, readout, fake, readout->analysis,388 if (!pmSubtractionMatchPrecalc(NULL, conv, fake, readout, readout->analysis, 372 389 stride, sysError, maskVal, maskBad, maskPoor, 373 390 poorFrac, badFrac)) { … … 383 400 } 384 401 } else { 385 if (!pmSubtractionMatch( conv, NULL, readout, fake, footprint, stride, regionSize, spacing,402 if (!pmSubtractionMatch(NULL, conv, fake, readout, footprint, stride, regionSize, spacing, 386 403 threshold, stampSources, stampsName, type, size, order, widths, 387 404 orders, inner, ringsOrder, binning, penalty, 388 405 optimum, optWidths, optOrder, optThresh, iter, rej, sysError, 389 406 maskVal, maskBad, maskPoor, poorFrac, badFrac, 390 PM_SUBTRACTION_MODE_ 1)) {407 PM_SUBTRACTION_MODE_2)) { 391 408 psError(PS_ERR_UNKNOWN, false, "Unable to match images."); 392 409 psFree(fake); -
branches/eam_branches/20090715/ppStack/src/ppStackPSF.c
r23192 r25624 9 9 #include "ppStack.h" 10 10 11 //#define TESTING 12 11 13 pmPSF *ppStackPSF(const pmConfig *config, int numCols, int numRows, 12 14 const psArray *psfs, const psVector *inputMask) 13 15 { 16 #ifndef TESTING 14 17 // Get the recipe values 15 18 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSTACK_RECIPE); // ppStack recipe … … 35 38 return NULL; 36 39 } 40 #else 41 // Dummy PSF 42 pmPSF *psf = pmPSFBuildSimple("PS_MODEL_PS1_V1", 4.0, 4.0, 0.0, 1.0); 43 if (!psf) { 44 psError(PS_ERR_UNKNOWN, false, "Unable to build dummy PSF."); 45 return NULL; 46 } 47 #endif 37 48 38 49 return psf; -
branches/eam_branches/20090715/ppStack/src/ppStackReject.c
r23573 r25624 9 9 #include "ppStack.h" 10 10 #include "ppStackLoop.h" 11 12 //#define TESTING 11 13 12 14 bool ppStackReject(ppStackOptions *options, pmConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
