IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 18, 2010, 4:11:53 PM (16 years ago)
Author:
eugene
Message:

merge changes from branches/eam_branches/psphot,psModules.20100506 (finish basic psphotStack)

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotSourceMatch.c

    r27657 r28013  
    11# include "psphotInternal.h"
    22
    3 bool psphotMatchSourcesGenerate (pmConfig *config, const pmFPAview *view, psArray *objects);
    4  
    5 psArray *psphotMatchSources (pmConfig *config, const pmFPAview *view)
     3bool psphotMatchSourcesAddMissing (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects);
     4bool psphotMatchSourcesSetIDs (psArray *objects);
     5 
     6psArray *psphotMatchSources (pmConfig *config, const pmFPAview *view, const char *filerule)
    67{
    78    bool status = true;
     
    1415    // loop over the available readouts
    1516    for (int i = 0; i < num; i++) {
    16         if (!psphotMatchSourcesReadout (objects, config, view, "PSPHOT.INPUT", i)) {
     17        if (!psphotMatchSourcesReadout (objects, config, view, filerule, i)) {
    1718            psError (PSPHOT_ERR_CONFIG, false, "failed to merge sources for PSPHOT.INPUT entry %d", i);
    1819            psFree (objects);
     
    2122    }
    2223
    23     psphotMatchSourcesGenerate (config, view, objects);
     24    // create sources for images where an object has been detected in the other images
     25    psphotMatchSourcesAddMissing (config, view, filerule, objects);
     26
     27    // choose a consistent position; set common sequence values
     28    psphotMatchSourcesSetIDs (objects);
    2429
    2530    return objects;
    2631}
    2732
    28 bool psphotMatchSourcesReadout (psArray *objects, pmConfig *config, const pmFPAview *view, char *filename, int index) {
     33bool psphotMatchSourcesReadout (psArray *objects, pmConfig *config, const pmFPAview *view, const char *filerule, int index) {
    2934 
    3035    bool status = false;
     
    3843
    3944    // find the currently selected readout
    40     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
     45    pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, index); // File of interest
    4146    psAssert (file, "missing file?");
    4247
     
    145150}
    146151
    147 bool psphotMatchSourcesGenerate (pmConfig *config, const pmFPAview *view, psArray *objects) {
     152bool psphotMatchSourcesAddMissing (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) {
    148153
    149154    bool status = false;
     
    167172
    168173        // find the currently selected readout
    169         pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PSPHOT.INPUT", i); // File of interest
     174        pmFPAfile *file = pmFPAfileSelectSingle(config->files, filerule, i); // File of interest
    170175        psAssert (file, "missing file?");
    171176
     
    255260    return true;
    256261}
     262
     263bool psphotMatchSourcesSetIDs (psArray *objects) {
     264
     265    for (int i = 0; i < objects->n; i++) {
     266        pmPhotObj *obj = objects->data[i];
     267
     268        // set the source->seq values
     269        for (int j = 0; j < obj->sources->n; j++) {
     270            pmSource *src = obj->sources->data[j];
     271            src->seq = i;
     272        }
     273    }
     274    return true;
     275}
Note: See TracChangeset for help on using the changeset viewer.