IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 20, 2010, 12:09:48 PM (16 years ago)
Author:
eugene
Message:

save galaxy params in output file; fix convolved image construction; fix galaxy shapes; add galaxy grid option

File:
1 edited

Legend:

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

    r28127 r29002  
    105105        float flux = star->flux * expCorr->data.F32[(int)yCell][(int)xCell];
    106106
    107         // if psfConvolve is TRUE, we will (elsewhere) convolve the image we a PSF
    108         // in this case, simply place delta functions in the image
    109         if (psfConvolve) {
    110             readout->image->data.F32[(int)(yCell)][(int)(xCell)] += flux;
    111             continue;
    112         }
    113 
    114107        // instantiate a model for the PSF at this location, set desired flux
    115108        pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0);
     
    125118        // XXX i should be applying the gain and the correct effective area
    126119        psEllipseAxes axes = pmPSF_ModelToAxes (model->params->data.F32, 20.0);
    127         psF64 Area = 2.0 * M_PI * axes.major * axes.minor;
     120        float Area = 2.0 * M_PI * axes.major * axes.minor;
    128121
    129         // this value is the pure (input) flux, and is saved in the output source cmf files
    130122        source->psfMag = -2.5*log10(star->flux);
    131123        source->errMag = sqrt(Area*PS_SQR(roughNoise) + flux) / flux;
     124       
     125        // set the expected model errors
     126        model->dparams->data.F32[PM_PAR_I0] = source->errMag * model->params->data.F32[PM_PAR_I0];
    132127
    133         fprintf (outfile, "%8.3f %8.3f  %10.2f  %7.3f %5.3f\n", star->x, star->y, star->flux, source->psfMag, source->errMag);
     128        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->errMag, axes.major, axes.minor, axes.theta, par8);
    134130
    135         // insert the source flux in the image
    136         pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
    137 
    138         // insert the source flux in the noise image
    139         pmSourceAddWithOffset (source, PM_MODEL_OP_FULL | PM_MODEL_OP_NOISE, 0xff, dX, dY);
    140 
    141         // Blow away the image parts of the source, which makes the memory explode
    142         RESET(source->pixels);
    143         RESET(source->variance);
    144         RESET(source->maskObj);
    145         RESET(source->maskView);
    146         RESET(source->modelFlux);
    147         RESET(source->psfImage);
    148         RESET(source->blends);
     131        // if psfConvolve is TRUE, we will (elsewhere) convolve the image we a PSF
     132        // in this case, simply place delta functions in the image
     133        if (psfConvolve) {
     134            readout->image->data.F32[(int)(yCell)][(int)(xCell)] += flux;
     135        } else {
     136            // insert the source flux in the image
     137            pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
     138           
     139            // insert the source flux in the noise image
     140            pmSourceAddWithOffset (source, PM_MODEL_OP_FULL | PM_MODEL_OP_NOISE, 0xff, dX, dY);
     141           
     142            // Blow away the image parts of the source, which makes the memory explode
     143            RESET(source->pixels);
     144            RESET(source->variance);
     145            RESET(source->maskObj);
     146            RESET(source->maskView);
     147            RESET(source->modelFlux);
     148            RESET(source->psfImage);
     149            RESET(source->blends);
     150        }
    149151
    150152        // add the sources to the source array
Note: See TracChangeset for help on using the changeset viewer.