- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotReadoutMinimal.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_branches/psphot
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psphot merged eligible /branches/eam_branches/stackphot.20100406/psphot 27622-27655 /branches/pap_delete/psphot 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/simmosaic_branches/psphot/src
- Property svn:ignore
-
old new 18 18 psphotVersionDefinitions.h 19 19 psphotMomentsStudy 20 psphotPetrosianStudy 21 psphotForced 22 psphotMakePSF 23 psphotStack
-
- Property svn:ignore
-
branches/simmosaic_branches/psphot/src/psphotReadoutMinimal.c
r24274 r27839 1 1 # include "psphotInternal.h" 2 2 3 // this badly-named function performs photometry assuming (a) a supplied PSF, (b) 4 // background subtraction, (c) linear psf-model fits only. it is currently only being5 // used by ppSub.3 // this badly-named function performs photometry assuming (a) a supplied PSF, (b) background 4 // subtraction, (c) linear psf-model fits only, (d) a prior analysis has supplied the moments 5 // window parameters. It is currently only being used by ppSub. 6 6 7 7 // NOTE: ppSub needs to perform extended source analysis for comets and trails. … … 15 15 psTimerStart ("psphotReadout"); 16 16 17 // select the current recipe 18 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 19 if (!recipe) { 20 psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE); 21 return false; 22 } 17 pmModelClassSetLimits(PM_MODEL_LIMITS_LAX); 23 18 24 19 // set the photcode for this image 25 if (!psphotAddPhotcode( recipe, config, view, "PSPHOT.INPUT")) {20 if (!psphotAddPhotcode(config, view)) { 26 21 psError(PSPHOT_ERR_CONFIG, false, "trouble defining the photcode"); 27 22 return false; 28 23 } 29 24 30 // find the currently selected readout 31 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 32 PS_ASSERT_PTR_NON_NULL (readout, false); 25 // Generate the mask and weight images, including the user-defined analysis region of interest 26 psphotSetMaskAndVariance (config, view); 33 27 34 // Generate the mask and weight images, including the user-defined analysis region of interest 35 psphotSetMaskAndVariance (config, readout, recipe); 36 37 // display the image, weight, mask (ch 1,2,3) 38 psphotVisualShowImage (readout); 39 40 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved in the recipe 41 pmPSF *psf = psphotLoadPSF (config, view, recipe); 42 if (!psf) { 28 // load the psf model, if suppled. FWHM_X,FWHM_Y,etc are saved on readout->analysis 29 if (!psphotLoadPSF (config, view)) { 43 30 psError (PSPHOT_ERR_CONFIG, false, "missing psf model"); 44 return psphotReadoutCleanup (config, readout, recipe, NULL, NULL, NULL);31 return psphotReadoutCleanup (config, view); 45 32 } 46 33 47 // find the detections (by peak and/or footprint) in the image. 48 pmDetections *detections = pmDetectionsAlloc(); // New detections; allocated to ensure pass=2 49 detections = psphotFindDetections(detections, readout, recipe); 50 if (!detections) { 51 psLogMsg ("psphot", 3, "unable to find detections in this image"); 52 return psphotReadoutCleanup (config, readout, recipe, detections, psf, NULL); 34 // find the detections (by peak and/or footprint) in the image. (final pass) 35 if (!psphotFindDetections(config, view, false)) { 36 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 37 return psphotReadoutCleanup (config, view); 53 38 } 54 39 55 // construct sources and measure basic stats 56 psArray *sources = psphotSourceStats (config, readout, detections); 57 if (!sources) return false; 40 // construct sources and measure basic stats (saved on detections->newSources) 41 if (!psphotSourceStats (config, view, false)) { // pass 1 42 psError(PSPHOT_ERR_UNKNOWN, false, "failure to generate sources"); 43 return psphotReadoutCleanup (config, view); 44 } 58 45 59 46 // find blended neighbors of very saturated stars 60 // XXX merge this with Basic Deblend? 61 psphotDeblendSatstars (sources, recipe); 47 psphotDeblendSatstars (config, view); 62 48 63 49 // mark blended peaks PS_SOURCE_BLEND 64 if (!psphotBasicDeblend ( sources, recipe)) {50 if (!psphotBasicDeblend (config, view)) { 65 51 psLogMsg ("psphot", 3, "failed on deblend analysis"); 66 return psphotReadoutCleanup (config, readout, recipe, detections, psf, sources);52 return psphotReadoutCleanup (config, view); 67 53 } 68 54 69 55 // classify sources based on moments, brightness (use supplied psf shape parameters) 70 if (!psphotRoughClass ( readout, sources, recipe, true)) {56 if (!psphotRoughClass (config, view)) { 71 57 psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image"); 72 return psphotReadoutCleanup (config, readout, recipe, detections, psf, sources);58 return psphotReadoutCleanup (config, view); 73 59 } 74 60 75 61 // construct an initial model for each object 76 psphotGuessModels (config, readout, sources, psf); 62 psphotGuessModels (config, view); 63 64 // merge the newly selected sources into the existing list 65 psphotMergeSources (config, view); 77 66 78 67 // linear PSF fit to source peaks 79 psphotFitSourcesLinear (readout, sources, recipe, psf, FALSE); 80 81 // We have to place these visualizations here because the models are not realized until 82 // psphotGuessModels or fitted until psphotFitSourcesLinear. 83 psphotVisualShowPSFStars (recipe, psf, sources); 84 psphotVisualShowSatStars (recipe, psf, sources); 68 psphotFitSourcesLinear (config, view, false); 85 69 86 70 // XXX eventually, add the extended source fits here 87 71 # if (0) 88 72 // measure source size for the remaining sources 89 psphotSourceSize (config, readout, sources, recipe, 0);73 psphotSourceSize (config, view); 90 74 91 psphotExtendedSourceAnalysis ( readout, sources, recipe);75 psphotExtendedSourceAnalysis (config, view); 92 76 93 psphotExtendedSourceFits ( readout, sources, recipe);77 psphotExtendedSourceFits (config, view); 94 78 # endif 95 79 96 80 // calculate source magnitudes 97 psphotMagnitudes(config, readout, view, sources, psf); 81 psphotMagnitudes(config, view); 82 83 // XXX ensure this is measured if the analysis succeeds (even if quality is low) 84 if (!psphotEfficiency(config, view)) { 85 psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources"); 86 psErrorClear(); 87 } 98 88 99 89 // drop the references to the image pixels held by each source 100 psphotSourceFreePixels ( sources);90 psphotSourceFreePixels (config, view); 101 91 102 92 // create the exported-metadata and free local data 103 return psphotReadoutCleanup(config, readout, recipe, detections, psf, sources);93 return psphotReadoutCleanup(config, view); 104 94 }
Note:
See TracChangeset
for help on using the changeset viewer.
