IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 20, 2006, 8:57:16 PM (20 years ago)
Author:
eugene
Message:

modifications to support psphot on pmReadout with full IPP config files

File:
1 edited

Legend:

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

    r6056 r6117  
    11# include "psphot.h"
    22
    3 // XXX need a better structure for handling optional sequence
     3// XXX need a better structure for handling optional sequences
    44int 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;
    145
    156    psTimerStart ("complete");
    167
    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);
    1913
    2014    // load input data (config and images (signal, noise, mask)
    21     readout = psphotSetup (config, &header);
     15    ppFile *input = psphotParseCamera (config);
    2216
    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);
    2519
    26     // measure image stats for initial guess
    27     sky = psphotImageStats (readout, config);
     20    // call psphot for each readout
     21    psphotImageLoop (input, config);
    2822
    29     // generate a background model (currently, 2D polynomial)
    30     // XXX this should be available to be re-added to the original image
    31     psphotImageBackground (readout, config, sky);
    32 
    33     // find the peaks in the image
    34     peaks = psphotFindPeaks (readout, config, sky);
    35 
    36     // construct sources and measure basic stats
    37     sources = psphotSourceStats (readout, config, peaks);
    38 
    39     // classify sources based on moments, brightness
    40     psphotRoughClass (sources, config);
    41 
    42     // mark blended peaks PS_SOURCE_BLEND
    43     psphotBasicDeblend (sources, config, sky);
    44 
    45     // use bright stellar objects to measure PSF
    46     psf = psphotChoosePSF (config, sources, sky);
    47 
    48     // XXX change FITMODE to a string
    49     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 format
    80     psphotOutput (readout, header, config, sources, psf, sky);
    81     psLogMsg ("psphot", 3, "wrote output: %f sec\n", psTimerMark ("psphot"));
    8223    psLogMsg ("psphot", 3, "complete psphot run: %f sec\n", psTimerMark ("complete"));
    8324    exit (0);
Note: See TracChangeset for help on using the changeset viewer.