Changeset 7758 for trunk/psphot/src/psphotReadout.c
- Timestamp:
- Jun 29, 2006, 10:50:09 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadout.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadout.c
r7731 r7758 8 8 // find the currently selected readout 9 9 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT"); 10 11 // optional break-point for processing 12 char *breakPt = psMetadataLookupStr (NULL, recipe, "BREAK_POINT"); 10 13 11 14 // XXX does this need to invoke I/O? … … 34 37 // limit moments analysis by S/N? 35 38 psArray *sources = psphotSourceStats (readout, recipe, peaks); 39 psFree (peaks); 40 41 if (!strcasecmp (breakPt, "PEAKS")) { 42 psphotReadoutCleanup (config, readout, recipe, NULL, sources); 43 return true; 44 } 36 45 37 46 // classify sources based on moments, brightness 38 47 // faint sources not classified? 39 48 if (!psphotRoughClass (sources, recipe)) { 40 psFree (peaks);41 49 psFree (sources); 42 50 psLogMsg ("psphot", 3, "failed to find a valid PSF clump for image"); … … 44 52 pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 45 53 return false; 54 } 55 if (!strcasecmp (breakPt, "MOMENTS")) { 56 psphotReadoutCleanup (config, readout, recipe, NULL, sources); 57 return true; 46 58 } 47 59 … … 51 63 // use bright stellar objects to measure PSF 52 64 pmPSF *psf = psphotChoosePSF (readout, sources, recipe); 53 psphotPSFstats (readout, recipe, psf); 65 if (!strcasecmp (breakPt, "PSFMODEL")) { 66 psphotReadoutCleanup (config, readout, recipe, psf, sources); 67 return true; 68 } 54 69 55 70 // linear PSF fit to peaks 56 71 psphotEnsemblePSF (readout, sources, recipe, psf, FALSE); 72 if (!strcasecmp (breakPt, "ENSEMBLE")) { 73 psphotReadoutCleanup (config, readout, recipe, psf, sources); 74 return true; 75 } 57 76 58 77 // non-linear PSF and EXT fit to brighter sources … … 80 99 psphotMagnitudes (sources, recipe, psf); 81 100 82 // create an output header with stats results83 psMetadata *header = psphotDefineHeader (recipe);84 85 101 // replace background in residual image 86 102 psphotSkyReplace (config, view); … … 89 105 psphotSourceFreePixels (sources); 90 106 // psphotSaveImage (NULL, readout->image, "resid.fits"); 107 108 // create the exported-metadata and free local data 109 psphotReadoutCleanup (config, readout, recipe, psf, sources); 110 return true; 111 } 112 113 bool psphotReadoutCleanup (pmConfig *config, pmReadout *readout, psMetadata *recipe, pmPSF *psf, psArray *sources) { 114 115 // use the psf-model to measure FWHM stats 116 if (psf) { 117 psphotPSFstats (readout, recipe, psf); 118 } else { 119 psphotMomentsStats (readout, recipe, sources); 120 } 121 122 // create an output header with stats results 123 psMetadata *header = psphotDefineHeader (recipe); 91 124 92 125 // save the results of the analysis … … 99 132 pmFPAfileDropInternal (config->files, "PSPHOT.BACKGND"); 100 133 101 // free up the local copies of the data102 psFree (peaks);103 psFree (sources);104 134 psFree (psf); 105 135 psFree (header); 136 psFree (sources); 137 106 138 return true; 107 139 }
Note:
See TracChangeset
for help on using the changeset viewer.
