IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27952


Ignore:
Timestamp:
May 13, 2010, 11:45:49 AM (16 years ago)
Author:
eugene
Message:

forgot to sort the pixel fluxes by radius

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/psphot.20100506/src/psphotRadialApertures.c

    r27932 r27952  
    11# include "psphotInternal.h"
     2
     3bool psphotRadialAperturesSortFlux (psVector *radius, psVector *pixFlux, psVector *pixVar);
    24
    35// for now, let's store the detections on the readout->analysis for each readout
     
    154156        }
    155157    }
     158    psphotRadialAperturesSortFlux(radius, pixFlux, pixVar);
    156159
    157160    psVector *flux    = psVectorAllocEmpty(radMax->n, PS_TYPE_F32); // surface brightness of radial bin
     
    207210    return true;
    208211}
     212
     213// *** pmSourceRadialProfileSortPair is a utility function for sorting a pair of vectors
     214# define COMPARE_VECT(A,B) (radius->data.F32[A] < radius->data.F32[B])
     215# define SWAP_VECT(TYPE,A,B) { \
     216  float tmp; \
     217  if (A != B) { \
     218    tmp = radius->data.F32[A]; \
     219    radius->data.F32[A] = radius->data.F32[B];  \
     220    radius->data.F32[B] = tmp; \
     221    tmp = pixFlux->data.F32[A]; \
     222    pixFlux->data.F32[A] = pixFlux->data.F32[B]; \
     223    pixFlux->data.F32[B] = tmp; \
     224    tmp = pixVar->data.F32[A]; \
     225    pixVar->data.F32[A] = pixVar->data.F32[B]; \
     226    pixVar->data.F32[B] = tmp; \
     227  } \
     228}
     229
     230bool psphotRadialAperturesSortFlux (psVector *radius, psVector *pixFlux, psVector *pixVar) {
     231
     232    // sort the vector set by the radius
     233    PSSORT (radius->n, COMPARE_VECT, SWAP_VECT, NONE);
     234    return true;
     235}
     236
Note: See TracChangeset for help on using the changeset viewer.