IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15801


Ignore:
Timestamp:
Dec 12, 2007, 6:06:59 PM (18 years ago)
Author:
eugene
Message:

added sort-by-radius

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotRadialProfile.c

    r15562 r15801  
    11# include "psphotInternal.h"
    22
     3# define COMPARE(A,B) (radius->data.F32[A] < radius->data.F32[B])
     4# define SWAPFUNC(TYPE,A,B) { \
     5  float tmp; \
     6  if (A != B) { \
     7    tmp = radius->data.F32[A]; \
     8    radius->data.F32[A] = radius->data.F32[B]; \
     9    radius->data.F32[B] = tmp; \
     10    tmp = flux->data.F32[A]; \
     11    flux->data.F32[A] = flux->data.F32[B]; \
     12    flux->data.F32[B] = tmp; \
     13    tmp = weight->data.F32[A]; \
     14    weight->data.F32[A] = weight->data.F32[B]; \
     15    weight->data.F32[B] = tmp; \
     16  }
     17   
    318bool psphotRadialProfile (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
    419
     
    4055    flux->n = n;
    4156
    42     // XXX need to sort here
    43     // SortVectorsByRadius (radius, flux, weight);
     57    // sort the vector set by the radius
     58    PSSORT (radius->n, COMPARE, SWAPFUNC, NONE);
    4459
    4560    return true;
Note: See TracChangeset for help on using the changeset viewer.