IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 19913


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

get the local sky stdev from the background model image

File:
1 edited

Legend:

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

    r18555 r19913  
    11# include "psphotInternal.h"
    22
    3 bool psphotMagnitudes(psArray *sources, psMetadata *recipe, pmPSF *psf, pmReadout *background) {
     3bool psphotMagnitudes(pmConfig *config, const pmFPAview *view, psArray *sources, psMetadata *recipe, pmPSF *psf) {
    44
    55    bool status = false;
     
    77
    88    psTimerStart ("psphot");
     9
     10    pmReadout *backModel = psphotSelectBackground (config, view);
     11    pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);
     12
     13    // XXX require that we have a background model, or
     14    // allow it to be missing, setting local sky to 0.0?
     15    PS_ASSERT (backModel, false);
     16    PS_ASSERT (backStdev, false);
    917
    1018    // bit-masks to test for good/bad pixels
     
    2028
    2129    pmSourceMagnitudesInit (recipe);
    22 
    23     // XXX require that we have a background model, or
    24     // allow it to be missing, setting local sky to 0.0?
    25     PS_ASSERT (background, false);
    2630
    2731    // the binning details are saved on the analysis metadata
     
    4145        if (status) Nap ++;
    4246
    43         source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, background->image, binning);
     47        source->sky = psImageUnbinPixel(source->peak->x, source->peak->y, backModel->image, binning);
    4448        if (isnan(source->sky) && false) {
     49          psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky");
     50          psErrorStackPrint(NULL, " ");
     51          psErrorClear();
     52        }
     53
     54        source->skyErr = psImageUnbinPixel(source->peak->x, source->peak->y, backStdev->image, binning);
     55        if (isnan(source->skyErr) && false) {
    4556          psError(PSPHOT_ERR_SKY, false, "Setting pmSource.sky");
    4657          psErrorStackPrint(NULL, " ");
Note: See TracChangeset for help on using the changeset viewer.