IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 2, 2011, 5:43:29 PM (15 years ago)
Author:
eugene
Message:

need to handle plain sources and sources with parents from psphotStack

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psModules/src/objects/pmSource.c

    r30621 r30775  
    11661166}
    11671167
     1168// sort by SN (descending)
     1169int pmSourceSortByParentSN (const void **a, const void **b)
     1170{
     1171    pmSource *Ao = *(pmSource **)a;
     1172    pmSource *Bo = *(pmSource **)b;
     1173    pmSource *A  = Ao->parent;
     1174    pmSource *B  = Bo->parent;
     1175
     1176    psF32 fA = (A->peak == NULL) ? 0 : A->peak->SN;
     1177    psF32 fB = (B->peak == NULL) ? 0 : B->peak->SN;
     1178    if (isnan (fA)) fA = 0;
     1179    if (isnan (fB)) fB = 0;
     1180
     1181    psF32 diff = fA - fB;
     1182    if (diff > FLT_EPSILON) return (-1);
     1183    if (diff < FLT_EPSILON) return (+1);
     1184    return (0);
     1185}
     1186
    11681187// sort by Y (ascending)
    11691188int pmSourceSortByY (const void **a, const void **b)
     
    12011220    pmSource *A = *(pmSource **)a;
    12021221    pmSource *B = *(pmSource **)b;
     1222
     1223    int iA = A->seq;
     1224    int iB = B->seq;
     1225
     1226    int diff = iA - iB;
     1227    if (diff > 0) return (+1);
     1228    if (diff < 0) return (-1);
     1229    return (0);
     1230}
     1231
     1232// sort by Seq (ascending)
     1233int pmSourceSortByParentSeq (const void **a, const void **b)
     1234{
     1235    pmSource *Ao = *(pmSource **)a;
     1236    pmSource *Bo = *(pmSource **)b;
     1237    pmSource *A  = Ao->parent;
     1238    pmSource *B  = Bo->parent;
    12031239
    12041240    int iA = A->seq;
Note: See TracChangeset for help on using the changeset viewer.