Changeset 27657 for trunk/ppSim
- Timestamp:
- Apr 11, 2010, 5:08:29 PM (16 years ago)
- Location:
- trunk/ppSim
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
src/ppSimInsertGalaxies.c (modified) (2 diffs)
-
src/ppSimInsertStars.c (modified) (1 diff)
-
src/ppSimPhotomReadout.c (modified) (4 diffs)
-
src/ppSimPhotomReadoutFake.c (modified) (1 diff)
-
src/ppSimPhotomReadoutForce.c (modified) (2 diffs)
-
src/ppSimUtils.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppSim
-
Property svn:mergeinfo
set to
/branches/eam_branches/stackphot.20100406/ppSim merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ppSim/src/ppSimInsertGalaxies.c
r18011 r27657 74 74 int dY = PM_CELL_TO_CHIP (0.0, y0Cell, yParityCell, binning); 75 75 76 // psMetadataLookupPtr (readout->analysis, "PSPHOT.SOURCES", 0); 77 78 psArray *sources = psArrayAllocEmpty (galaxies->n); 79 76 pmDetections *detections = psMetadataLookupPtr (&mdok, readout->analysis, "PSPHOT.DETECTIONS"); 77 if (!detections) { 78 detections = pmDetectionsAlloc(); 79 detections->allSources = psArrayAllocEmpty (galaxies->n); 80 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY | PS_META_REPLACE, "psphot detections", detections); 81 } else { 82 psMemIncrRefCounter (detections); 83 } 84 psArray *sources = sources = detections->allSources; 80 85 81 86 // add sources to the readout image & weight … … 181 186 } 182 187 183 // NOTE: readout must be part of the pmFPAfile named "PPSIM.OUTPUT"184 // psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, "psphot sources", sources);188 // XXX many leaks in here, i think 189 psFree (detections); 185 190 186 // XXX many leaks in here, i think187 191 return true; 188 192 } -
trunk/ppSim/src/ppSimInsertStars.c
r27533 r27657 145 145 fclose (outfile); 146 146 147 // NOTE: the pmFPAfile "PPSIM.OUTPUT" points at these sources 148 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "fake sources", sources); 149 psFree(sources); 147 pmDetections *detections = pmDetectionsAlloc(); 148 detections->allSources = sources; 149 150 // save detections on the readout->analysis 151 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "fake sources", detections)) { 152 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 153 return false; 154 } 155 psFree(detections); 150 156 151 157 // XXX many leaks in here, i think -
trunk/ppSim/src/ppSimPhotomReadout.c
r26900 r27657 6 6 PS_ASSERT_PTR_NON_NULL (readout, NULL); 7 7 8 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 8 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 9 psAssert (detections, "missing detections?"); 10 11 psArray *sources = detections->allSources; 9 12 return sources; 10 13 } … … 151 154 152 155 // create the exported-metadata and free local data 153 // XXX this places the sources on readout->analysis as PSPHOT.SOURCES. modify?154 // (or don't supply the sources, and do this with a different function)155 156 psphotReadoutCleanup(config, readout, recipe, NULL, psf, NULL); 156 157 … … 167 168 psAssert (forceReadout, "no forceReadout?"); 168 169 pmChipSetDataStatus (forceChip, true); 169 psMetadataAddArray (forceReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "forced photometry ", forceSources); 170 psFree (forceSources); 170 171 pmDetections *detectionsForce = pmDetectionsAlloc(); 172 detectionForce->allSources = forceSources; 173 174 // save detections on the readout->analysis 175 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "force sources", detectionsForce)) { 176 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 177 return false; 178 } 179 psFree(detectionsForce); 171 180 172 181 pmCell *fakeCell = pmFPAfileThisCell (config->files, view, "PPSIM.FAKE.SOURCES"); psAssert (fakeCell, "no cell?"); … … 179 188 psAssert (fakeReadout, "no fakeReadout?"); 180 189 pmChipSetDataStatus (fakeChip, true); 181 psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "fake photometry ", fakeSources); 190 191 pmDetections *detectionsFake = pmDetectionsAlloc(); 192 detectionFake->allSources = fakeSources; 193 194 // save detections on the readout->analysis 195 if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "fake sources", detectionsFake)) { 196 psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout"); 197 return false; 198 } 199 psFree(detectionsFake); 182 200 183 201 return true; -
trunk/ppSim/src/ppSimPhotomReadoutFake.c
r26900 r27657 111 111 psAssert (fakeReadout, "no fakeReadout?"); 112 112 pmChipSetDataStatus (fakeChip, true); 113 psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "fake photometry ", fakeSources); 113 114 pmDetections *detections = pmDetectionsAlloc(); 115 detection->allSources = fakeSources; 116 117 psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE, "fake photometry ", detections); 118 psFree(detections); 114 119 115 120 return true; -
trunk/ppSim/src/ppSimPhotomReadoutForce.c
r26900 r27657 98 98 99 99 // create the exported-metadata and free local data 100 // XXX this places the sources on readout->analysis as PSPHOT.SOURCES. modify?101 // (or don't supply the sources, and do this with a different function)102 100 psphotReadoutCleanup(config, readout, recipe, NULL, psf, NULL); 103 101 … … 111 109 psAssert (forceReadout, "no forceReadout?"); 112 110 pmChipSetDataStatus (forceChip, true); 113 psMetadataAddArray (forceReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "force photometry ", forceSources); 111 112 pmDetections *detections = pmDetectionsAlloc(); 113 detection->allSources = forceSources; 114 psMetadataAddArray (forceReadout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE, "force photometry ", detections); 115 psFree(detections); 114 116 115 117 return true; -
trunk/ppSim/src/ppSimUtils.c
r24807 r27657 270 270 psArray *ppSimSelectSources (pmConfig *config, const pmFPAview *view, const char *filename) { 271 271 272 bool status; 273 272 274 pmReadout *readout = pmFPAfileThisReadout (config->files, view, filename); 273 275 PS_ASSERT_PTR_NON_NULL (readout, NULL); 274 276 275 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 277 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 278 psAssert (detections, "missing detections?"); 279 280 psArray *sources = detections->allSources; 276 281 return sources; 277 282 }
Note:
See TracChangeset
for help on using the changeset viewer.
