Changeset 6571 for trunk/psphot/src/psphotReadout.c
- Timestamp:
- Mar 11, 2006, 5:27:13 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadout.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadout.c
r6522 r6571 2 2 3 3 // XXX 2006.02.07 : no leaks! 4 bool psphotReadout (pmReadout *readout, psMetadata *config) { 4 // XXX change 'config' to 'recipe' eventually 5 bool psphotReadout (pmConfig *config, pmFPAview *view) { 5 6 6 7 psArray *sources = NULL; 7 8 psArray *peaks = NULL; 8 psImage *skymodel = NULL;9 9 pmPSF *psf = NULL; 10 10 bool status; 11 11 12 // find the currently selected readout 13 psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, "PSPHOT"); 14 pmFPA *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT"); 15 pmReadout *readout = pmFPAviewThisReadout (view, input); 16 12 17 // generate a background model (median, smoothed image) 13 skymodel = psphotImageMedian (readout, config); 14 15 // optional output of background-subtracted image 16 psphot 18 psphotImageMedian (config, view); 17 19 18 20 // find the peaks in the image 19 peaks = psphotFindPeaks (readout, config);21 peaks = psphotFindPeaks (readout, recipe); 20 22 21 23 // construct sources and measure basic stats 22 24 // limit moments analysis by S/N? 23 sources = psphotSourceStats (readout, config, peaks);25 sources = psphotSourceStats (readout, recipe, peaks); 24 26 25 27 // classify sources based on moments, brightness 26 28 // faint sources not classified? 27 psphotRoughClass (sources, config);29 psphotRoughClass (sources, recipe); 28 30 29 31 // mark blended peaks PS_SOURCE_BLEND 30 psphotBasicDeblend (sources, config);32 psphotBasicDeblend (sources, recipe); 31 33 32 34 // use bright stellar objects to measure PSF 33 psf = psphotChoosePSF ( config, sources);35 psf = psphotChoosePSF (sources, recipe); 34 36 35 37 // linear PSF fit to peaks 36 psphotEnsemblePSF (readout, config, sources, psf, FALSE);38 psphotEnsemblePSF (readout, sources, recipe, psf, FALSE); 37 39 38 40 // non-linear PSF and EXT fit to brighter sources 39 psphotBlendFit (readout, config, sources, psf);41 psphotBlendFit (readout, sources, recipe, psf); 40 42 41 43 // replace fitted sources … … 46 48 47 49 // linear PSF fit to remaining peaks 48 psphotEnsemblePSF (readout, config, sources, psf, TRUE);50 psphotEnsemblePSF (readout, sources, recipe, psf, TRUE); 49 51 50 52 // measure aperture photometry corrections 51 psphotApResid (readout, sources, config, psf);53 psphotApResid (readout, sources, recipe, psf); 52 54 53 55 // calculate source magnitudes 54 psphotMagnitudes ( config, sources, psf);56 psphotMagnitudes (sources, recipe, psf); 55 57 56 58 // update the header with stats results 59 // XXX need to do this conditionally? 57 60 psMetadata *header = pmReadoutGetHeader (readout); 58 61 psphotUpdateHeader (header, config); … … 60 63 // XXX make this an option? 61 64 // replace background in residual image 62 psphotSkyReplace ( readout, skymodel);65 psphotSkyReplace (config, view); 63 66 64 67 // need to do something with the sources, psf, and sky … … 67 70 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN", PS_DATA_F32, "psphot sky mean", sky->sampleMean); 68 71 // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32, "psphot sky stdev", sky->sampleStdev); 69 // XXX : what should I do with the skymodel image?70 72 71 73 // free up the local copies of the data … … 73 75 psFree (sources); 74 76 psFree (peaks); 75 psFree (skymodel);76 77 return true; 77 78 }
Note:
See TracChangeset
for help on using the changeset viewer.
