IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 6, 2011, 1:34:52 PM (15 years ago)
Author:
eugene
Message:

fix the mags of input stars and galaxies (prove we inserted the amount of flux we expected); realistic galaxy luminosity function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimInsertStars.c

    r31449 r32350  
    66    PTR = NULL;
    77
     8float imageSum (psImage *image);
    89
    910bool ppSimInsertStars (pmReadout *readout, psImage *expCorr, psArray *stars, pmConfig *config) {
     
    111112        float radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
    112113        radius = PS_MAX (radius, 1.0);
     114        radius = 20.0;
    113115
    114116        // construct a source, with model flux pixels set, based on the model
     
    117119        // XXX set the mag & err values (should this be done in pmSourceFromModel?)
    118120        // XXX i should be applying the gain and the correct effective area
    119         psEllipseAxes axes = pmPSF_ModelToAxes (model->params->data.F32, 20.0);
     121        psEllipseAxes axes = pmPSF_ModelToAxes (model->params->data.F32, 20.0, model->type);
    120122        float Area = 2.0 * M_PI * axes.major * axes.minor;
    121123
     
    127129
    128130        float par8 = (model->params->n == 8) ? model->params->data.F32[7] : 0.0;
    129         fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f\n", star->x, star->y, star->flux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8);
     131        float starFlux = 0.0;
    130132
    131133        // if psfConvolve is TRUE, we will (elsewhere) convolve the image we a PSF
     
    135137        } else {
    136138            // insert the source flux in the image
     139            float sum1 = imageSum(source->pixels);
    137140            pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
     141            float sum2 = imageSum(source->pixels);
     142            starFlux = sum2 - sum1;
    138143           
    139144            // insert the source flux in the noise image
     
    149154            RESET(source->blends);
    150155        }
     156        fprintf (outfile, "%8.3f %8.3f %10.2f  %2d  %7.3f %5.3f  %5.3f %5.3f %5.3f %5.3f  :  %f %f\n", star->x, star->y, starFlux, 0, source->psfMag, source->psfMagErr, axes.major, axes.minor, axes.theta, par8, model->params->data.F32[PM_PAR_I0], radius);
    151157
    152158        // add the sources to the source array
Note: See TracChangeset for help on using the changeset viewer.