IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28821


Ignore:
Timestamp:
Aug 1, 2010, 4:38:52 PM (16 years ago)
Author:
eugene
Message:

moved pmPhotObjSortByX to psModules

Location:
branches/eam_branches/ipp-20100621
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20100621/psModules/src/objects/pmPhotObj.c

    r28643 r28821  
    103103    return (0);
    104104}
     105
     106// sort by X (ascending)
     107int pmPhotObjSortByX (const void **a, const void **b)
     108{
     109    pmPhotObj *objA = *(pmPhotObj **)a;
     110    pmPhotObj *objB = *(pmPhotObj **)b;
     111
     112    psF32 fA = objA->x;
     113    psF32 fB = objB->x;
     114
     115    psF32 diff = fA - fB;
     116    if (diff > FLT_EPSILON) return (+1);
     117    if (diff < FLT_EPSILON) return (-1);
     118    return (0);
     119}
  • branches/eam_branches/ipp-20100621/psModules/src/objects/pmPhotObj.h

    r28643 r28821  
    4242
    4343int pmPhotObjSortBySN (const void **a, const void **b);
     44int pmPhotObjSortByX (const void **a, const void **b);
    4445
    4546/// @}
  • branches/eam_branches/ipp-20100621/psphot/src/psphot.h

    r28782 r28821  
    328328
    329329bool psphotFitSourcesLinearStack (pmConfig *config, psArray *objects, bool final);
    330 int pmPhotObjSortBySN (const void **a, const void **b);
    331 int pmPhotObjSortByX (const void **a, const void **b);
    332330
    333331typedef enum {
  • branches/eam_branches/ipp-20100621/psphot/src/psphotFitSourcesLinearStack.c

    r28440 r28821  
    170170    return true;
    171171}
    172 
    173 // sort by X (ascending)
    174 int pmPhotObjSortByX (const void **a, const void **b)
    175 {
    176     pmPhotObj *objA = *(pmPhotObj **)a;
    177     pmPhotObj *objB = *(pmPhotObj **)b;
    178 
    179     psF32 fA = objA->x;
    180     psF32 fB = objB->x;
    181 
    182     psF32 diff = fA - fB;
    183     if (diff > FLT_EPSILON) return (+1);
    184     if (diff < FLT_EPSILON) return (-1);
    185     return (0);
    186 }
Note: See TracChangeset for help on using the changeset viewer.