IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 8, 2008, 4:03:31 PM (18 years ago)
Author:
eugene
Message:

update from changes on eam_branch_20080511 : adding photometry of fake sources, force photometry; major cleanups

File:
1 edited

Legend:

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

    r17557 r18011  
    1515
    1616    if (!stars->n) { return true; }
    17 
    18     // XXX is this needed?
    19     // pmFPAfile *simSources = psMetadataLookupPtr(NULL, config->files, "PPSIM.SOURCES"); // Output sources
    2017
    2118    pmCell *cell = readout->parent;
     
    4340    if (isnan(skyRate)) {
    4441        float zp      = psMetadataLookupF32(&mdok, recipe, "ZEROPOINT"); assert (mdok);
    45         float scale   = psMetadataLookupF32(&mdok, recipe, "SCALE");     assert (mdok);
     42        float scale   = psMetadataLookupF32(&mdok, recipe, "PIXEL.SCALE");     assert (mdok);
    4643        float skyMags = psMetadataLookupF32(&mdok, recipe, "SKY.MAGS");  assert (mdok);
    4744        skyRate = scale * scale * ppSimMagToFlux (skyMags, zp);
     
    6158    int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY");
    6259
    63     int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y
     60    int binning = psMetadataLookupS32(NULL, recipe, "BINNING"); // Binning in x and y
    6461
    6562    pmPSF *psf = psMetadataLookupPtr (&mdok, chip->analysis, "PSPHOT.PSF");
     
    117114        source->errMag = sqrt(Area*PS_SQR(roughNoise) + flux) / flux;
    118115
    119         // XXX add the sources to a source array
    120 
    121116        // insert the source flux in the image
    122117        pmSourceAddWithOffset (source, PM_MODEL_OP_FULL, 0xff, dX, dY);
    123         psArrayAdd (sources, 100,source);
    124         psFree(source);                 // Drop reference
     118        pmSourceAddWithOffset (source, PM_MODEL_OP_FULL | PM_MODEL_OP_NOISE, 0xff, dX, dY);
    125119
    126120        // Blow away the image parts of the source, which makes the memory explode
     
    132126        RESET(source->psfFlux);
    133127        RESET(source->blends);
     128
     129        // add the sources to the source array
     130        psArrayAdd (sources, 100,source);
     131        psFree(source);                 // Drop reference
    134132    }
    135133
    136     // NOTE: readout must be part of the pmFPAfile named "PPSIM.OUTPUT"
    137     psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "psphot sources", sources);
     134    // NOTE: the pmFPAfile "PPSIM.OUTPUT" points at these sources
     135    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "fake sources", sources);
    138136    psFree(sources);
    139137
     
    141139    return true;
    142140}
    143 
Note: See TracChangeset for help on using the changeset viewer.