IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 21, 2007, 3:13:53 PM (20 years ago)
Author:
eugene
Message:

adding ability to load externally-supplied sources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotMergeSources.c

    r11201 r11230  
    1111}
    1212
    13 // XXX this is something of a hack: external sources are loaded with the same functions used to
    14 // read and write the sources.  These use the readout->analysis entry PSPHOT.SOURCES.  at the
    15 // beginning of psphotReadout, we need to rename any such entry for later use by
    16 // psphotLoadExtSources below
    17 
    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 
    3113// merge the externally supplied sources with the existing sources.  mark them as having
    3214// mode PM_SOURCE_MODE_EXTERNAL
    33 bool psphotLoadExtSources (pmReadout *readout, psArray *sources) {
     15bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources) {
    3416
    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    }
    3729
    3830    for (int i = 0; i < extSources->n; i++) {
Note: See TracChangeset for help on using the changeset viewer.