IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 6, 2008, 3:02:43 AM (18 years ago)
Author:
eugene
Message:

psf output table now contains only PSF measurements (error and positions were from EXT); PSF_CHISQ now uses chisq from the model fit, rather than the value calculated in psphotSourceSized using the top 9 pixels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c

    r17396 r19904  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2008-04-08 18:35:38 $
     5 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2008-10-06 13:02:43 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6161    psF32 xPos, yPos;
    6262    psF32 xErr, yErr;
     63    psF32 errMag;
    6364
    6465    // let's write these out in S/N order
     
    6768    table = psArrayAllocEmpty (sources->n);
    6869
    69     // we write out all sources, regardless of quality.  the source flags tell us the state
     70    // we write out PSF-fits for all sources, regardless of quality.  the source flags tell us the state
    7071    for (i = 0; i < sources->n; i++) {
    7172        pmSource *source = (pmSource *) sources->data[i];
     
    7374
    7475        // no difference between PSF and non-PSF model
    75         pmModel *model = pmSourceGetModel (NULL, source);
     76        pmModel *model = source->modelPSF;
    7677
    7778        if (model != NULL) {
     
    8283            xErr = dPAR[PM_PAR_XPOS];
    8384            yErr = dPAR[PM_PAR_YPOS];
    84 
    8585            axes = pmPSF_ModelToAxes (PAR, 20.0);
     86
     87            // need to determine the PSF photometry error: source->errMag is the error on the 'best' model mag.
     88            errMag = model->dparams->data.F32[PM_PAR_I0] / model->params->data.F32[PM_PAR_I0];
    8689        } else {
    8790            xPos = source->peak->xf;
     
    8992            xErr = source->peak->dx;
    9093            yErr = source->peak->dy;
    91             axes.major = 0.0;
    92             axes.minor = 0.0;
    93             axes.theta = 0.0;
     94            axes.major = NAN;
     95            axes.minor = NAN;
     96            axes.theta = NAN;
     97            errMag = NAN;
    9498        }
    9599
     
    104108        psMetadataAdd (row, PS_LIST_TAIL, "X_PSF_SIG",        PS_DATA_F32, "Sigma in PSF x coordinate",                  xErr);
    105109        psMetadataAdd (row, PS_LIST_TAIL, "Y_PSF_SIG",        PS_DATA_F32, "Sigma in PSF y coordinate",                  yErr);
    106         psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG",     PS_DATA_F32, "PSF fit instrumental magnitude",             PS_MIN (99.0, source->psfMag));
    107         psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude",        PS_MIN (99.0, source->errMag));
    108         psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude",           PS_MIN (99.0, peakMag));
     110        psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG",     PS_DATA_F32, "PSF fit instrumental magnitude",             source->psfMag);
     111        psMetadataAdd (row, PS_LIST_TAIL, "PSF_INST_MAG_SIG", PS_DATA_F32, "Sigma of PSF instrumental magnitude",        source->errMag);
     112        psMetadataAdd (row, PS_LIST_TAIL, "PEAK_FLUX_AS_MAG", PS_DATA_F32, "Peak flux expressed as magnitude",           peakMag);
    109113        psMetadataAdd (row, PS_LIST_TAIL, "SKY",              PS_DATA_F32, "Sky level",                                  source->sky);
    110114        psMetadataAdd (row, PS_LIST_TAIL, "SKY_SIGMA",        PS_DATA_F32, "Sigma of sky level",                         source->skyErr);
    111115
    112         psMetadataAdd (row, PS_LIST_TAIL, "PSF_CHISQ",        PS_DATA_F32,  "Chisq of PSF-fit to top 9 pixels",          source->psfChisq);
     116        psMetadataAdd (row, PS_LIST_TAIL, "PSF_CHISQ",        PS_DATA_F32,  "Chisq of PSF-fit",                          model->chisq);
    113117        psMetadataAdd (row, PS_LIST_TAIL, "CR_NSIGMA",        PS_DATA_F32,  "Nsigma deviations from PSF to CF",          source->crNsigma);
    114118        psMetadataAdd (row, PS_LIST_TAIL, "EXT_NSIGMA",       PS_DATA_F32,  "Nsigma deviations from PSF to EXT",         source->extNsigma);
     119
     120        // EXT_NSIGMA will be NAN if: 1) contour ellipse is imaginary; 2) source is not
     121        // subtracted
     122
     123        // CR_NSIGMA will be NAN if: 1) source is not subtracted; 2) source is on the image
     124        // edge; 3) any pixels in the 3x3 peak region are masked;
     125
     126        // CR_NSIGMA and
    115127
    116128        // XXX these should be major and minor, not 'x' and 'y'
Note: See TracChangeset for help on using the changeset viewer.