IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 11, 2006, 5:27:13 PM (20 years ago)
Author:
eugene
Message:

major revisions to use the new pmFPAfile,view I/O handling

File:
1 edited

Legend:

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

    r6522 r6571  
    22
    33// XXX 2006.02.07 : no leaks!
    4 bool psphotReadout (pmReadout *readout, psMetadata *config) {
     4// XXX change 'config' to 'recipe' eventually
     5bool psphotReadout (pmConfig *config, pmFPAview *view) {
    56
    67    psArray     *sources  = NULL;
    78    psArray     *peaks    = NULL;
    8     psImage     *skymodel = NULL;
    99    pmPSF       *psf      = NULL;
    1010    bool         status;
    1111
     12    // find the currently selected readout
     13    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
     14    pmFPA *input = psMetadataLookupPtr (&status, config->files, "PSPHOT.INPUT");
     15    pmReadout  *readout = pmFPAviewThisReadout (view, input);
     16
    1217    // generate a background model (median, smoothed image)
    13     skymodel = psphotImageMedian (readout, config);
    14 
    15     // optional output of background-subtracted image
    16     psphot
     18    psphotImageMedian (config, view);
    1719
    1820    // find the peaks in the image
    19     peaks = psphotFindPeaks (readout, config);
     21    peaks = psphotFindPeaks (readout, recipe);
    2022
    2123    // construct sources and measure basic stats
    2224    // limit moments analysis by S/N?
    23     sources = psphotSourceStats (readout, config, peaks);
     25    sources = psphotSourceStats (readout, recipe, peaks);
    2426
    2527    // classify sources based on moments, brightness
    2628    // faint sources not classified?
    27     psphotRoughClass (sources, config);
     29    psphotRoughClass (sources, recipe);
    2830
    2931    // mark blended peaks PS_SOURCE_BLEND
    30     psphotBasicDeblend (sources, config);
     32    psphotBasicDeblend (sources, recipe);
    3133
    3234    // use bright stellar objects to measure PSF
    33     psf = psphotChoosePSF (config, sources);
     35    psf = psphotChoosePSF (sources, recipe);
    3436
    3537    // linear PSF fit to peaks
    36     psphotEnsemblePSF (readout, config, sources, psf, FALSE);
     38    psphotEnsemblePSF (readout, sources, recipe, psf, FALSE);
    3739
    3840    // non-linear PSF and EXT fit to brighter sources
    39     psphotBlendFit (readout, config, sources, psf);
     41    psphotBlendFit (readout, sources, recipe, psf);
    4042
    4143    // replace fitted sources
     
    4648
    4749    // linear PSF fit to remaining peaks
    48     psphotEnsemblePSF (readout, config, sources, psf, TRUE);
     50    psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
    4951
    5052    // measure aperture photometry corrections
    51     psphotApResid (readout, sources, config, psf);
     53    psphotApResid (readout, sources, recipe, psf);
    5254
    5355    // calculate source magnitudes
    54     psphotMagnitudes (config, sources, psf);
     56    psphotMagnitudes (sources, recipe, psf);
    5557
    5658    // update the header with stats results
     59    // XXX need to do this conditionally?
    5760    psMetadata *header = pmReadoutGetHeader (readout);
    5861    psphotUpdateHeader (header, config);
     
    6063    // XXX make this an option?
    6164    // replace background in residual image
    62     psphotSkyReplace (readout, skymodel);
     65    psphotSkyReplace (config, view);
    6366
    6467    // need to do something with the sources, psf, and sky
     
    6770    // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.MEAN",  PS_DATA_F32,     "psphot sky mean", sky->sampleMean);
    6871    // XXX : replace? status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SKY.SIGMA", PS_DATA_F32,     "psphot sky stdev", sky->sampleStdev);
    69     // XXX : what should I do with the skymodel image?
    7072
    7173    // free up the local copies of the data
     
    7375    psFree (sources);
    7476    psFree (peaks);
    75     psFree (skymodel);
    7677    return true;
    7778}
Note: See TracChangeset for help on using the changeset viewer.