IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2010, 5:08:29 PM (16 years ago)
Author:
eugene
Message:

updates to support psphotStack

Location:
trunk/psModules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/objects/pmPhotObj.c

    r26893 r27657  
    1717#include <pslib.h>
    1818#include "pmPhotObj.h"
     19#include "pmSource.h"
    1920
    2021static void pmPhotObjFree (pmPhotObj *tmp)
     
    3839}
    3940
     41bool pmPhotObjAddSource(pmPhotObj *object, pmSource *source) {
     42
     43    psAssert (source, "programming error: NULL source");
     44    if (!source->peak) {
     45        psError(PS_ERR_UNKNOWN, true, "source missing peak");
     46        return false;
     47    }
     48    if (!finite(source->peak->xf)) {
     49        psError(PS_ERR_UNKNOWN, true, "NAN peak coordinate");
     50        return false;
     51    }
     52    if (!finite(source->peak->yf)) {
     53        psError(PS_ERR_UNKNOWN, true, "NAN peak coordinate");
     54        return false;
     55    }
     56
     57    // XXX we should probably use the fitted position if it exists
     58    if (!object->sources) {
     59        object->sources = psArrayAllocEmpty(1);
     60        object->x = source->peak->xf;
     61        object->y = source->peak->yf;
     62    }
     63    psArrayAdd (object->sources, 1, source);
     64    return true;
     65}
Note: See TracChangeset for help on using the changeset viewer.