Changeset 6117 for trunk/psphot/src/psphot.c
- Timestamp:
- Jan 20, 2006, 8:57:16 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphot.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.c
r6056 r6117 1 1 # include "psphot.h" 2 2 3 // XXX need a better structure for handling optional sequence 3 // XXX need a better structure for handling optional sequences 4 4 int main (int argc, char **argv) { 5 6 psMetadata *config = NULL;7 psMetadata *header = NULL;8 pmReadout *readout = NULL;9 psArray *sources = NULL;10 psArray *peaks = NULL;11 pmPSF *psf = NULL;12 psStats *sky = NULL;13 bool status;14 5 15 6 psTimerStart ("complete"); 16 7 17 // load command-line arguments and options 18 config = psphotArguments (&argc, argv); 8 // load implementation-specific models 9 psphotModelGroupInit (); 10 11 // load command-line arguments, options, and system config data 12 ppConfig *config = psphotArguments (&argc, argv); 19 13 20 14 // load input data (config and images (signal, noise, mask) 21 readout = psphotSetup (config, &header);15 ppFile *input = psphotParseCamera (config); 22 16 23 // run a single-model test if desired 24 psphotModelTest (readout, config);17 // run a single-model test if desired - XXX push in psphotImageLoop? 18 // psphotModelTest (input, options); 25 19 26 // measure image stats for initial guess27 sky = psphotImageStats (readout, config);20 // call psphot for each readout 21 psphotImageLoop (input, config); 28 22 29 // generate a background model (currently, 2D polynomial)30 // XXX this should be available to be re-added to the original image31 psphotImageBackground (readout, config, sky);32 33 // find the peaks in the image34 peaks = psphotFindPeaks (readout, config, sky);35 36 // construct sources and measure basic stats37 sources = psphotSourceStats (readout, config, peaks);38 39 // classify sources based on moments, brightness40 psphotRoughClass (sources, config);41 42 // mark blended peaks PS_SOURCE_BLEND43 psphotBasicDeblend (sources, config, sky);44 45 // use bright stellar objects to measure PSF46 psf = psphotChoosePSF (config, sources, sky);47 48 // XXX change FITMODE to a string49 int FITMODE = psMetadataLookupS32 (&status, config, "FIT_MODE");50 switch (FITMODE) {51 case 0:52 psphotEnsemblePSF (readout, config, sources, psf, sky);53 break;54 55 case 1:56 psphotEnsemblePSF (readout, config, sources, psf, sky);57 psphotFullFit (readout, config, sources, psf, sky);58 psphotReplaceUnfit (sources);59 psphotApResid (readout, sources, config, psf);60 break;61 62 case 2:63 psphotEnsemblePSF (readout, config, sources, psf, sky);64 psphotBlendFit (readout, config, sources, psf, sky);65 psphotReplaceUnfit (sources);66 psphotApResid (readout, sources, config, psf);67 break;68 69 case 3:70 psphotApplyPSF (readout, config, sources, psf, sky);71 break;72 73 case 4:74 psphotApplyPSF (readout, config, sources, psf, sky);75 psphotFitExtended (readout, config, sources, sky);76 break;77 }78 79 // write out data in appropriate format80 psphotOutput (readout, header, config, sources, psf, sky);81 psLogMsg ("psphot", 3, "wrote output: %f sec\n", psTimerMark ("psphot"));82 23 psLogMsg ("psphot", 3, "complete psphot run: %f sec\n", psTimerMark ("complete")); 83 24 exit (0);
Note:
See TracChangeset
for help on using the changeset viewer.
