Changeset 5986 for trunk/psphot/src/psphot.c
- Timestamp:
- Jan 13, 2006, 9:03:34 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphot.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphot.c
r5980 r5986 1 1 # include "psphot.h" 2 2 3 // XXX need a better structure for handling optional sequence 3 4 int main (int argc, char **argv) { 4 5 … … 9 10 pmPSF *psf = NULL; 10 11 psStats *sky = NULL; 11 pmPSFClump psfClump;12 12 bool status; 13 13 14 14 psTimerStart ("complete"); 15 15 16 psphotModelGroupInit (); 17 16 // load command-line arguments and options 18 17 config = psphotArguments (&argc, argv); 19 18 20 19 // load input data (config and images (signal, noise, mask) 21 // XXX we have memory leaks here -- may be from psMetadata22 20 imdata = psphotSetup (config); 23 21 24 char *breakPt = psMetadataLookupPtr (&status, config, "BREAK_POINT"); 25 if (!status) breakPt = psStringCopy ("NONE"); 26 27 int FITMODE = psMetadataLookupS32 (&status, config, "FIT_MODE"); 28 if (!status) FITMODE = 2; 29 30 // run model fitting tests on a single source 31 if (psMetadataLookupBool (&status, config, "TEST_FIT")) { 32 psphotModelTest (imdata, config); 33 exit (0); 34 } 22 // run a single-model test if desired 23 psphotModelTest (imdata, config); 35 24 36 25 // measure image stats for initial guess … … 42 31 43 32 // find the peaks in the image 44 peaks = pmPeaksSigmaLimit (imdata, config, sky); 45 if (!strcasecmp (breakPt, "PEAKS")) exit (0); 33 peaks = psphotFindPeaks (imdata, config, sky); 46 34 47 35 // construct sources and measure basic stats 48 36 sources = psphotSourceStats (imdata, config, peaks); 49 if (!strcasecmp (breakPt, "STATS")) exit (0);50 37 51 38 // classify sources based on moments, brightness 52 // XXX - this has 1 leak 53 psfClump = pmSourcePSFClump (sources, config); 54 55 // group into STAR, COSMIC, GALAXY, SATURATED, etc. 56 pmSourceRoughClass (sources, config, psfClump); 39 psphotRoughClass (sources, config); 57 40 58 41 // mark blended peaks PS_SOURCE_BLEND 59 42 psphotBasicDeblend (sources, config, sky); 60 if (!strcasecmp (breakPt, "DEBLEND")) exit (0);61 62 // source analysis is done in S/N order (brightest first)63 sources = psArraySort (sources, psphotSortBySN);64 psphotDumpMoments (config, sources);65 if (!strcasecmp (breakPt, "CLASS")) exit (0);66 43 67 44 // use bright stellar objects to measure PSF 68 45 psf = psphotChoosePSF (config, sources, sky); 69 if (!strcasecmp (breakPt, "PSFFIT")) exit (0);70 46 47 // XXX change FITMODE to a string 48 int FITMODE = psMetadataLookupS32 (&status, config, "FIT_MODE"); 71 49 switch (FITMODE) { 72 50 case 0: … … 101 79 102 80 // write out data in appropriate format 103 psphotSamplePSFs (config, psf, imdata->image);104 81 psphotOutput (imdata, config, sources, psf, sky); 105 82 psLogMsg ("psphot", 3, "wrote output: %f sec\n", psTimerMark ("psphot"));
Note:
See TracChangeset
for help on using the changeset viewer.
