IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27950


Ignore:
Timestamp:
May 13, 2010, 11:01:42 AM (16 years ago)
Author:
eugene
Message:

set up a consistent position; perform extended analysis on all sources for an object processed

Location:
branches/eam_branches/psphot.20100506/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/Makefile.am

    r27939 r27950  
    9999        psphotStackMatchPSFsPrepare.c \
    100100        psphotStackOptions.c          \
     101        psphotStackObjects.c          \
    101102        psphotStackPSF.c              \
    102103        psphotCleanup.c
  • branches/eam_branches/psphot.20100506/src/psphot.h

    r27939 r27950  
    465465bool psphotRadialAperturesByObject (pmConfig *config, psArray *objects, const pmFPAview *view, const char *filerule);
    466466
     467bool psphotStackObjectsUnifyPosition (psArray *objects);
     468
    467469#endif
  • branches/eam_branches/psphot.20100506/src/psphotExtendedSourceAnalysisByObject.c

    r27939 r27950  
    11# include "psphotInternal.h"
    22
    3 // ?? these cannot happen here --> we would need to do this in psphotExtendedSourceAnalysis
    4 // XXX option to choose a consistent position
    53// XXX option to choose a consistent elliptical contour
    64// XXX SDSS uses the r-band petrosian radius to measure petrosian fluxes in all bands
    7 // XXX consistent choice of extendedness...
    85
    96// aperture-like measurements for extended sources
     
    6461
    6562    // source analysis is done in S/N order (brightest first)
    66     // XXX add this in (need to put S/N in pmPhotObj) : objects = psArraySort (objects, pmPhotObjSortBySN);
     63    objects = psArraySort (objects, pmPhotObjSortBySN);
    6764
    6865    // process the objects in order. 
     
    7269        if (!object->sources) continue;
    7370
     71        // we need to decide for an object if we are going to measure all sources or not
     72        // simple rule : if *any* of the sources would be measured, measure the object
     73
    7474        // choose the sources of interest
    75         for (int j = 0; j < object->sources->n; j++) {
     75        bool measureSource = false;
     76        for (int j = 0; !measureSource && (j < object->sources->n); j++) {
    7677
    7778            pmSource *source = object->sources->data[j];
     
    8889            assert (source->peak); // how can a source not have a peak?
    8990            if (source->peak->SN < SN_LIM) continue;
     91            measureSource = true;
     92        }
     93        if (!measureSource) continue;
     94
     95        // choose the sources of interest
     96        for (int j = 0; j < object->sources->n; j++) {
     97
     98            pmSource *source = object->sources->data[j];
     99            psAssert (source, "programming error"); // all entries in object->sources must exist, right?
     100            psAssert (source->peak, "programming error"); // how can a source not have a peak?
    90101
    91102            // replace object in image
     
    146157    return true;
    147158}
    148 
    149 // sort by X (ascending)
    150 # if (0)
    151 int pmPhotObjSortBySN (const void **a, const void **b)
    152 {
    153     pmPhotObj *objA = *(pmPhotObj **)a;
    154     pmPhotObj *objB = *(pmPhotObj **)b;
    155 
    156     psF32 fA = objA->x;
    157     psF32 fB = objB->x;
    158 
    159     psF32 diff = fA - fB;
    160     if (diff > FLT_EPSILON) return (+1);
    161     if (diff < FLT_EPSILON) return (-1);
    162     return (0);
    163 }
    164 # endif
  • branches/eam_branches/psphot.20100506/src/psphotRadialAperturesByObject.c

    r27939 r27950  
    4141
    4242    // source analysis is done in S/N order (brightest first)
    43     // XXX are we getting the objects out of order? does it matter?
    44     // XXX objects = psArraySort (objects, pmPhotObjSortBySN);
     43    objects = psArraySort (objects, pmPhotObjSortBySN);
    4544
    4645    // generate look-up arrays for readouts
  • branches/eam_branches/psphot.20100506/src/psphotStackReadout.c

    r27939 r27950  
    7373    }
    7474
    75     // XXX do this now or below?
    76     // remove chisq image from config->file:PSPHOT.INPUT (why?)
    77     // psphotStackRemoveChisqFromInputs(config, STACK_RAW);
    78 
    7975    // copy the detections from RAW to OUT
    8076    if (!psphotCopySources (config, view, STACK_OUT, STACK_RAW)) {
     
    9086    }
    9187
    92     // *** generate the objects (which unify the sources from the different images)
     88    // generate the objects (object unify the sources from the different images)
    9389    psArray *objects = psphotMatchSources (config, view, STACK_OUT);
    9490
     
    137133    }
    138134
    139     // include externally-supplied sources
    140     // XXX fix this in the new multi-input context
    141     // psphotLoadExtSources (config, view, "PSPHOT.INPUT"); // pass 1
    142 
    143135    // construct an initial model for each object, set the radius to fitRadius, set circular fit mask
    144136    psphotGuessModels (config, view, STACK_OUT);
     
    161153    }
    162154
     155    psphotStackObjectsUnifyPosition (objects);
    163156    psphotRadialAperturesByObject (config, objects, view, STACK_OUT);
     157
    164158    psphotExtendedSourceAnalysisByObject (config, objects, view, STACK_OUT); // pass 1 (detections->allSources)
    165159    psphotExtendedSourceFits (config, view, STACK_OUT); // pass 1 (detections->allSources)
     
    182176    psphotSourceFreePixels (config, view, STACK_OUT);
    183177
    184     // XXX do this now or above?
    185178    // remove chisq image from config->file:PSPHOT.INPUT (why?)
    186179    psphotStackRemoveChisqFromInputs(config, STACK_RAW);
Note: See TracChangeset for help on using the changeset viewer.