Changeset 18011 for trunk/ppSim/src/ppSimInsertStars.c
- Timestamp:
- Jun 8, 2008, 4:03:31 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppSim/src/ppSimInsertStars.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim/src/ppSimInsertStars.c
r17557 r18011 15 15 16 16 if (!stars->n) { return true; } 17 18 // XXX is this needed?19 // pmFPAfile *simSources = psMetadataLookupPtr(NULL, config->files, "PPSIM.SOURCES"); // Output sources20 17 21 18 pmCell *cell = readout->parent; … … 43 40 if (isnan(skyRate)) { 44 41 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); 46 43 float skyMags = psMetadataLookupF32(&mdok, recipe, "SKY.MAGS"); assert (mdok); 47 44 skyRate = scale * scale * ppSimMagToFlux (skyMags, zp); … … 61 58 int yParityCell = psMetadataLookupS32(NULL, cell->concepts, "CELL.YPARITY"); 62 59 63 int binning = psMetadataLookupS32(NULL, config->arguments, "BINNING"); // Binning in x and y60 int binning = psMetadataLookupS32(NULL, recipe, "BINNING"); // Binning in x and y 64 61 65 62 pmPSF *psf = psMetadataLookupPtr (&mdok, chip->analysis, "PSPHOT.PSF"); … … 117 114 source->errMag = sqrt(Area*PS_SQR(roughNoise) + flux) / flux; 118 115 119 // XXX add the sources to a source array120 121 116 // insert the source flux in the image 122 117 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); 125 119 126 120 // Blow away the image parts of the source, which makes the memory explode … … 132 126 RESET(source->psfFlux); 133 127 RESET(source->blends); 128 129 // add the sources to the source array 130 psArrayAdd (sources, 100,source); 131 psFree(source); // Drop reference 134 132 } 135 133 136 // NOTE: readout must be part of the pmFPAfile named "PPSIM.OUTPUT"137 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, " psphotsources", 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); 138 136 psFree(sources); 139 137 … … 141 139 return true; 142 140 } 143
Note:
See TracChangeset
for help on using the changeset viewer.
