IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 13, 2006, 9:03:34 PM (21 years ago)
Author:
eugene
Message:

file cleanups, function renames

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.c

    r5980 r5986  
    11# include "psphot.h"
    22
     3// XXX need a better structure for handling optional sequence
    34int main (int argc, char **argv) {
    45
     
    910    pmPSF       *psf     = NULL;
    1011    psStats     *sky     = NULL;
    11     pmPSFClump   psfClump;
    1212    bool         status;
    1313
    1414    psTimerStart ("complete");
    1515
    16     psphotModelGroupInit ();
    17 
     16    // load command-line arguments and options
    1817    config = psphotArguments (&argc, argv);
    1918
    2019    // load input data (config and images (signal, noise, mask)
    21     // XXX we have memory leaks here -- may be from psMetadata
    2220    imdata = psphotSetup (config);
    2321
    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);
    3524
    3625    // measure image stats for initial guess
     
    4231
    4332    // 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);
    4634
    4735    // construct sources and measure basic stats
    4836    sources = psphotSourceStats (imdata, config, peaks);
    49     if (!strcasecmp (breakPt, "STATS")) exit (0);
    5037
    5138    // 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);
    5740
    5841    // mark blended peaks PS_SOURCE_BLEND
    5942    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);
    6643
    6744    // use bright stellar objects to measure PSF
    6845    psf = psphotChoosePSF (config, sources, sky);
    69     if (!strcasecmp (breakPt, "PSFFIT")) exit (0);
    7046
     47    // XXX change FITMODE to a string
     48    int FITMODE = psMetadataLookupS32 (&status, config, "FIT_MODE");
    7149    switch (FITMODE) {
    7250      case 0:
     
    10179
    10280    // write out data in appropriate format
    103     psphotSamplePSFs (config, psf, imdata->image);
    10481    psphotOutput (imdata, config, sources, psf, sky);
    10582    psLogMsg ("psphot", 3, "wrote output: %f sec\n", psTimerMark ("psphot"));
Note: See TracChangeset for help on using the changeset viewer.