IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 15, 2009, 9:53:13 AM (17 years ago)
Author:
eugene
Message:

define pmSourceSortBySeq; more MODE_SUBTRACTED to internal TMPF_SUBTRACTED; add asserts for object stats

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20090208/psModules/src/objects/pmSource.c

    r21408 r21486  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-06 02:31:25 $
     8 *  @version $Revision: 1.69.2.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-15 19:53:13 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    113113    source->type = PM_SOURCE_TYPE_UNKNOWN;
    114114    source->mode = PM_SOURCE_MODE_DEFAULT;
     115    source->tmpFlags = 0;
    115116    source->extpars = NULL;
    116117    source->region = psRegionSet(NAN, NAN, NAN, NAN);
     
    534535    float INNER_RADIUS = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS");
    535536
     537    pmSourceMode noMoments = PM_SOURCE_MODE_MOMENTS_FAILURE | PM_SOURCE_MODE_SKYVAR_FAILURE | PM_SOURCE_MODE_SKY_FAILURE | PM_SOURCE_MODE_BELOW_MOMENTS_SN;
     538
    536539    // XXX allow clump size to be scaled relative to sigmas?
    537540    // make rough IDs based on clumpX,Y,DX,DY
     
    540543        pmSource *source = (pmSource *) sources->data[i];
    541544
    542         if (source->peak->x < region->x0) continue;
    543         if (source->peak->x > region->x1) continue;
    544         if (source->peak->y < region->y0) continue;
    545         if (source->peak->y > region->y1) continue;
    546 
    547         source->peak->type = 0;
     545        // psf clumps are found for image subregions:
     546        // skip sources not in this region
     547        if (source->peak->x <  region->x0) continue;
     548        if (source->peak->x >= region->x1) continue;
     549        if (source->peak->y <  region->y0) continue;
     550        if (source->peak->y >= region->y1) continue;
     551
     552        // should be set by pmSourceAlloc
     553        psAssert (source->type == PM_SOURCE_TYPE_UNKNOWN, "source type was not init-ed?");
    548554
    549555        // we are basically classifying by moments; use the default if not found
    550556        if (!source->moments) {
    551557            source->type = PM_SOURCE_TYPE_STAR;
     558            psAssert (source->mode & noMoments, "why is this source missing moments?");
    552559            Nstar++;
    553560            continue;
     
    10491056}
    10501057
     1058// sort by Seq (ascending)
     1059int pmSourceSortBySeq (const void **a, const void **b)
     1060{
     1061    pmSource *A = *(pmSource **)a;
     1062    pmSource *B = *(pmSource **)b;
     1063
     1064    int iA = A->seq;
     1065    int iB = B->seq;
     1066
     1067    int diff = iA - iB;
     1068    if (diff > 0) return (+1);
     1069    if (diff < 0) return (-1);
     1070    return (0);
     1071}
     1072
    10511073pmSourceMode pmSourceModeFromString (const char *name) {
    10521074  if (!strcasecmp (name, "DEFAULT"   )) return PM_SOURCE_MODE_DEFAULT;
     
    10661088  if (!strcasecmp (name, "CRLIMIT"   )) return PM_SOURCE_MODE_CR_LIMIT;
    10671089  if (!strcasecmp (name, "EXTLIMIT"  )) return PM_SOURCE_MODE_EXT_LIMIT;
    1068   if (!strcasecmp (name, "SUBTRACTED")) return PM_SOURCE_MODE_SUBTRACTED;
    10691090  return PM_SOURCE_MODE_DEFAULT;
    10701091}
     
    10881109    case PM_SOURCE_MODE_CR_LIMIT   : return psStringCopy ("CRLIMIT"   );
    10891110    case PM_SOURCE_MODE_EXT_LIMIT  : return psStringCopy ("EXTLIMIT"  );
    1090     case PM_SOURCE_MODE_SUBTRACTED : return psStringCopy ("SUBTRACTED");
    10911111    default:
    10921112      return NULL;
Note: See TracChangeset for help on using the changeset viewer.