Changeset 6427 for trunk/psphot/src/psphotReadout.c
- Timestamp:
- Feb 14, 2006, 6:33:17 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadout.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadout.c
r6399 r6427 4 4 bool psphotReadout (pmReadout *readout, psMetadata *config) { 5 5 6 psArray *sources = NULL;7 psArray *peaks = NULL;8 p mPSF *psf= NULL;9 p sStats *sky= NULL;6 psArray *sources = NULL; 7 psArray *peaks = NULL; 8 psImage *skymodel = NULL; 9 pmPSF *psf = NULL; 10 10 bool status; 11 psPolynomial2D *model = NULL;12 11 13 psphotImageMedian (readout, config, sky); 14 15 // measure image stats for initial guess 16 sky = psphotImageStats (readout, config); 17 18 // generate a background model (currently, 2D polynomial) 19 // XXX this should be available to be re-added to the original image 20 model = psphotImageBackground (readout, config, sky); 12 // generate a background model (median, smoothed image) 13 skymodel = psphotImageMedian (readout, config); 21 14 22 15 // find the peaks in the image 23 peaks = psphotFindPeaks (readout, config , sky);16 peaks = psphotFindPeaks (readout, config); 24 17 25 18 // construct sources and measure basic stats … … 30 23 31 24 // mark blended peaks PS_SOURCE_BLEND 32 psphotBasicDeblend (sources, config , sky);25 psphotBasicDeblend (sources, config); 33 26 34 27 // use bright stellar objects to measure PSF 35 psf = psphotChoosePSF (config, sources , sky);28 psf = psphotChoosePSF (config, sources); 36 29 37 // XXX change FITMODE to a string30 // select analysis method 38 31 char *FITMODE = psMetadataLookupStr (&status, config, "FITMODE"); 39 32 if (!strcasecmp(FITMODE, "ENSEMBLE")) { 40 psphotEnsemblePSF (readout, config, sources, psf, sky); 41 } 42 43 if (!strcasecmp(FITMODE, "FULL")) { 44 psphotEnsemblePSF (readout, config, sources, psf, sky); 45 psphotFullFit (readout, config, sources, psf, sky); 46 psphotReplaceUnfit (sources); 47 psphotApResid (readout, sources, config, psf); 33 psphotEnsemblePSF (readout, config, sources, psf); 48 34 } 49 35 50 36 if (!strcasecmp(FITMODE, "BLEND")) { 51 psphotEnsemblePSF (readout, config, sources, psf , sky);52 psphotBlendFit (readout, config, sources, psf , sky);37 psphotEnsemblePSF (readout, config, sources, psf); 38 psphotBlendFit (readout, config, sources, psf); 53 39 psphotReplaceUnfit (sources); 54 40 psphotApResid (readout, sources, config, psf); 55 }56 57 if (!strcasecmp(FITMODE, "BASIC")) {58 psphotApplyPSF (readout, config, sources, psf, sky);59 psphotFitExtended (readout, config, sources, sky);60 41 } 61 42 … … 65 46 psphotUpdateHeader (header, config); 66 47 48 // psphotSkyReplace (readout, skymodel); 49 67 50 // need to do something with the sources, psf, and sky 68 51 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources); 69 52 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf); 70 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean);71 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev);53 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean); 54 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev); 72 55 73 56 // free up the local copies of the data 74 57 psFree (psf); 75 psFree (sky);76 psFree (model);77 58 psFree (peaks); 78 59 psFree (sources); 60 psFree (skymodel); 79 61 80 62 return true; 81 63 } 64 65 66 // XXX Deprecate or allow these versions? 67 # if (0) 68 if (!strcasecmp(FITMODE, "FULL")) { 69 psphotEnsemblePSF (readout, config, sources, psf); 70 psphotFullFit (readout, config, sources, psf); 71 psphotReplaceUnfit (sources); 72 psphotApResid (readout, sources, config, psf); 73 } 74 75 if (!strcasecmp(FITMODE, "BASIC")) { 76 psphotApplyPSF (readout, config, sources, psf); 77 psphotFitExtended (readout, config, sources); 78 } 79 80 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
