- Timestamp:
- Jan 31, 2010, 5:00:42 PM (16 years ago)
- Location:
- branches/eam_branches/psModules.stack.20100120
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/objects/pmSourceIO.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/psModules.stack.20100120
- Property svn:mergeinfo changed
/branches/eam_branches/20091201/psModules (added) merged: 26686-26687,26693,26702-26703,26731-26735,26737,26739,26741-26743
- Property svn:mergeinfo changed
-
branches/eam_branches/psModules.stack.20100120/src/objects/pmSourceIO.c
r26260 r26747 40 40 #include "pmPSF.h" 41 41 #include "pmModel.h" 42 #include "pmDetections.h" 42 43 #include "pmSource.h" 43 44 #include "pmModelClass.h" … … 344 345 345 346 // if sources is NULL, write out an empty table 346 // input / output sources are stored on the readout->analysis as "PSPHOT.SOURCES" -- a better name might be something like PM_SOURCE_DATA 347 psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 347 // input / output sources are stored on the readout->analysis as "PSPHOT.DETECTIONS" 348 349 psArray *sources = NULL; 350 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 351 if (detections) { 352 sources = detections->allSources; 353 } 348 354 if (!sources) { 355 detections = pmDetectionsAlloc(); 349 356 sources = psArrayAlloc(0); 350 psMetadataAddArray(readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "Blank array of sources", sources); 351 psFree(sources); // Held onto by the metadata, so we can continue to use 357 detections->allSources = sources; 358 psMetadataAddPtr(readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_UNKNOWN | PS_META_REPLACE, "Blank array of sources", detections); 359 psFree(detections); // Held onto by the metadata, so we can continue to use 352 360 } 353 361 … … 1031 1039 } 1032 1040 readout->data_exists = true; 1033 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY, "input sources", sources); 1034 psFree (sources); 1041 1042 pmDetections *detections = pmDetectionsAlloc(); 1043 detections->allSources = sources; 1044 status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY, "input sources", detections); 1045 psFree (detections); 1035 1046 return true; 1036 1047 } … … 1124 1135 bool status; 1125 1136 1126 // select the psf of interest 1127 pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES"); 1128 if (!psf) return false; 1129 return true; 1130 } 1131 1132 1137 // select the detections of interest 1138 pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS"); 1139 if (!detections) return false; 1140 if (!detections->allSources) return false; 1141 return true; 1142 } 1143 1144
Note:
See TracChangeset
for help on using the changeset viewer.
