IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27939


Ignore:
Timestamp:
May 12, 2010, 3:54:46 PM (16 years ago)
Author:
eugene
Message:

re-org so we can do radial apertures and extended sources by object, not image

Location:
branches/eam_branches/psphot.20100506/src
Files:
2 added
6 edited

Legend:

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

    r27932 r27939  
    164164        psphotModelWithPSF.c           \
    165165        psphotExtendedSourceAnalysis.c \
     166        psphotExtendedSourceAnalysisByObject.c \
    166167        psphotExtendedSourceFits.c     \
    167168        psphotKernelFromPSF.c          \
     
    192193        psphotRadialBins.c             \
    193194        psphotRadialApertures.c        \
     195        psphotRadialAperturesByObject.c \
    194196        psphotPetrosian.c              \
    195197        psphotPetrosianRadialBins.c    \
  • branches/eam_branches/psphot.20100506/src/psphot.h

    r27932 r27939  
    462462bool psphotRadialApertureSource (pmSource *source, psMetadata *recipe, float skynoise, psImageMaskType maskVal, const psVector *radMax);
    463463
     464bool psphotExtendedSourceAnalysisByObject (pmConfig *config, psArray *objects, const pmFPAview *view, const char *filerule);
     465bool psphotRadialAperturesByObject (pmConfig *config, psArray *objects, const pmFPAview *view, const char *filerule);
     466
    464467#endif
  • branches/eam_branches/psphot.20100506/src/psphotExtendedSourceAnalysis.c

    r27909 r27939  
    11# include "psphotInternal.h"
     2
     3// ?? these cannot happen here --> we would need to do this in psphotExtendedSourceAnalysis
     4// XXX option to choose a consistent position
     5// XXX option to choose a consistent elliptical contour
     6// XXX SDSS uses the r-band petrosian radius to measure petrosian fluxes in all bands
     7// XXX consistent choice of extendedness...
    28
    39// for now, let's store the detections on the readout->analysis for each readout
  • branches/eam_branches/psphot.20100506/src/psphotFitSourcesLinearStack.c

    r27657 r27939  
    2828
    2929    // analysis is done in spatial order (to speed up overlap search)
    30     // sort by first element in each source list
    3130    objects = psArraySort (objects, pmPhotObjSortByX);
    3231
  • branches/eam_branches/psphot.20100506/src/psphotSourceMatch.c

    r27909 r27939  
    11# include "psphotInternal.h"
    22
    3 bool psphotMatchSourcesGenerate (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects);
     3bool psphotMatchSourcesAddMissing (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects);
     4bool psphotMatchSourcesSetIDs (psArray *objects);
    45 
    56psArray *psphotMatchSources (pmConfig *config, const pmFPAview *view, const char *filerule)
     
    2122    }
    2223
    23     psphotMatchSourcesGenerate (config, view, filerule, 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;
     
    145150}
    146151
    147 bool psphotMatchSourcesGenerate (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) {
     152bool psphotMatchSourcesAddMissing (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) {
    148153
    149154    bool status = false;
     
    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}
  • branches/eam_branches/psphot.20100506/src/psphotStackReadout.c

    r27932 r27939  
    150150    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
    151151    psphotFitSourcesLinearStack (config, objects, FALSE);
    152     psFree (objects);
    153152
    154153    // identify CRs and extended sources
     
    157156    // measure aperture photometry corrections
    158157    if (!psphotApResid (config, view, STACK_OUT)) {
     158        psFree (objects);
    159159        psLogMsg ("psphot", 3, "failed on psphotApResid");
    160160        return psphotReadoutCleanup (config, view, STACK_OUT);
    161161    }
    162162
    163     psphotRadialApertures (config, view, STACK_OUT);
    164     psphotExtendedSourceAnalysis (config, view, STACK_OUT); // pass 1 (detections->allSources)
     163    psphotRadialAperturesByObject (config, objects, view, STACK_OUT);
     164    psphotExtendedSourceAnalysisByObject (config, objects, view, STACK_OUT); // pass 1 (detections->allSources)
    165165    psphotExtendedSourceFits (config, view, STACK_OUT); // pass 1 (detections->allSources)
    166166
     
    186186    psphotStackRemoveChisqFromInputs(config, STACK_RAW);
    187187
     188    psFree (objects);
     189
    188190    // create the exported-metadata and free local data
    189191    return psphotReadoutCleanup (config, view, STACK_OUT);
Note: See TracChangeset for help on using the changeset viewer.