Changeset 11230 for trunk/psphot/src/psphotMergeSources.c
- Timestamp:
- Jan 21, 2007, 3:13:53 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMergeSources.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMergeSources.c
r11201 r11230 11 11 } 12 12 13 // XXX this is something of a hack: external sources are loaded with the same functions used to14 // read and write the sources. These use the readout->analysis entry PSPHOT.SOURCES. at the15 // beginning of psphotReadout, we need to rename any such entry for later use by16 // psphotLoadExtSources below17 18 bool psphotSaveExtSources (pmReadout *readout) {19 20 psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");21 if (!sources) return true;22 23 psLogMsg ("psphot", 3, "%ld external sources loaded, saved for later use", sources->n);24 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.EXTSRC", PS_DATA_ARRAY, "external sources", sources);25 26 psMetadataRemoveKey (readout->analysis, "PSPHOT.SOURCES");27 28 return true;29 }30 31 13 // merge the externally supplied sources with the existing sources. mark them as having 32 14 // mode PM_SOURCE_MODE_EXTERNAL 33 bool psphotLoadExtSources (pm Readout *readout, psArray *sources) {15 bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources) { 34 16 35 psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.EXTSRC"); 36 if (!extSources) return true; 17 // find the currently selected readout 18 pmReadout *readout = pmFPAfileThisReadout (config->files, view, "INPUT.SRC"); 19 if (!readout) { 20 psLogMsg ("psphot", 3, "no external sources supplied"); 21 return true; 22 } 23 24 psArray *extSources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES"); 25 if (!extSources) { 26 psLogMsg ("psphot", 3, "no external sources for this readout"); 27 return true; 28 } 37 29 38 30 for (int i = 0; i < extSources->n; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.
