IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11230


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

adding ability to load externally-supplied sources

Location:
trunk/psphot/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphot.h

    r11201 r11230  
    9898bool psphotFitSummary ();
    9999bool psphotMergeSources (psArray *oldSources, psArray *newSources);
    100 
    101 bool psphotSaveExtSources (pmReadout *readout);
    102 bool psphotLoadExtSources (pmReadout *readout, psArray *sources);
     100bool psphotLoadExtSources (pmConfig *config, pmFPAview *view, psArray *sources);
  • 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++) {
  • trunk/psphot/src/psphotParseCamera.c

    r11201 r11230  
    2323    // optionally load the PSF Model and/or fixed stars
    2424    pmFPAfileBindFromArgs (NULL, input, config, "INPUT.PSF", "PSF");
    25     pmFPAfile *srcInput = pmFPAfileBindFromArgs (NULL, input, config, "INPUT.SRC", "SRC");
     25    pmFPAfile *srcInput = pmFPAfileDefineFromArgs (NULL, config, "INPUT.SRC", "SRC");
    2626    if (!srcInput) {
    2727        fprintf (stderr, "!");
  • trunk/psphot/src/psphotReadout.c

    r11201 r11230  
    88    // find the currently selected readout
    99    pmReadout  *readout = pmFPAfileThisReadout (config->files, view, "PSPHOT.INPUT");
    10     psphotSaveExtSources (readout);
    1110
    1211    // optional break-point for processing
     
    8180
    8281    // include externally-supplied sources
    83     psphotLoadExtSources (readout, sources);
     82    psphotLoadExtSources (config, view, sources);
    8483
    8584    // construct an initial model for each object
Note: See TracChangeset for help on using the changeset viewer.