IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2012, 6:15:21 AM (14 years ago)
Author:
eugene
Message:

why are inserted mags varying (and trending) for the PS1_V1 model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120601/ppSim/src/ppSimInsertStars.c

    r32350 r34054  
    7979    FILE *outfile = fopen (outname, "w");
    8080
     81    float radius = -1.0;
     82
    8183    // add sources to the readout image & variance
    8284    psTrace("ppSim", 1, "Inserting %ld stars...\n", stars->n);
     
    9092        float xChip = PM_FPA_TO_CHIP(star->x, x0Chip, xParityChip);
    9193        float yChip = PM_FPA_TO_CHIP(star->y, y0Chip, yParityChip);
     94        xChip = (int) xChip;
     95        yChip = (int) yChip;
    9296
    9397        // Position on the cell and peak flux
     
    106110        float flux = star->flux * expCorr->data.F32[(int)yCell][(int)xCell];
    107111
     112        // XXX test:
     113        flux = star->flux * expCorr->data.F32[0][0];
     114
    108115        // instantiate a model for the PSF at this location, set desired flux
    109116        pmModel *model = pmModelFromPSFforXY (psf, xChip, yChip, 1.0);
    110117        pmModelSetFlux (model, flux);
    111118
    112         float radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
    113         radius = PS_MAX (radius, 1.0);
    114         radius = 20.0;
     119        // we will set the radius on the first object, and leave it there for everyone else
     120        if (radius < 0) {
     121          radius = model->modelRadius (model->params, nSigmaLim * roughNoise);
     122          radius = PS_MIN (radius, 50.0);
     123        }
    115124
    116125        // construct a source, with model flux pixels set, based on the model
     
    137146        } else {
    138147            // insert the source flux in the image
    139             float sum1 = imageSum(source->pixels);
     148            double sum1 = imageSum(source->pixels);
    140149            pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
    141             float sum2 = imageSum(source->pixels);
     150            double sum2 = imageSum(source->pixels);
    142151            starFlux = sum2 - sum1;
    143152           
     
    154163            RESET(source->blends);
    155164        }
    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);
     165        fprintf (outfile, "%8.3f %8.3f %10.5f  %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);
    157166
    158167        // add the sources to the source array
Note: See TracChangeset for help on using the changeset viewer.