IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15819


Ignore:
Timestamp:
Dec 13, 2007, 2:40:29 PM (18 years ago)
Author:
Paul Price
Message:

Fixing syntax so it builds.

File:
1 edited

Legend:

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

    r15801 r15819  
    11# include "psphotInternal.h"
    22
    3 # define COMPARE(A,B) (radius->data.F32[A] < radius->data.F32[B])
    4 # define SWAPFUNC(TYPE,A,B) { \
     3# define COMPARE_RADIUS(A,B) (radius->data.F32[A] < radius->data.F32[B])
     4# define SWAP_RADIUS(TYPE,A,B) { \
    55  float tmp; \
    66  if (A != B) { \
     
    1414    weight->data.F32[A] = weight->data.F32[B]; \
    1515    weight->data.F32[B] = tmp; \
    16   }
    17    
     16  } \
     17}
     18
    1819bool psphotRadialProfile (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
    1920
    2021    // allocate pmSourceExtendedParameters, if not already defined
    2122    if (!source->extpars) {
    22         source->extpars = pmSourceExtendedParsAlloc ();
     23        source->extpars = pmSourceExtendedParsAlloc ();
    2324    }
    2425
    2526    if (!source->extpars->profile) {
    26         source->extpars->profile = pmSourceRadialProfileAlloc ();
    27     }   
    28    
     27        source->extpars->profile = pmSourceRadialProfileAlloc ();
     28    }
     29
    2930    int nPts = source->pixels->numRows * source->pixels->numCols;
    3031    source->extpars->profile->radius = psVectorAllocEmpty (nPts, PS_TYPE_F32);
     
    4344    float Yo = source->modelEXT->params->data.F32[PM_PAR_YPOS] - source->pixels->row0;
    4445    for (int iy = 0; iy < source->pixels->numRows; iy++) {
    45         for (int ix = 0; ix < source->pixels->numCols; ix++) {
    46             if (source->maskObj->data.U8[iy][ix]) continue;
    47             radius->data.F32[n] = hypot (ix - Xo, iy - Yo) ;
    48             flux->data.F32[n]   = source->pixels->data.F32[iy][ix];
    49             weight->data.F32[n] = source->weight->data.F32[iy][ix];
    50             n++;
    51         }
     46        for (int ix = 0; ix < source->pixels->numCols; ix++) {
     47            if (source->maskObj->data.U8[iy][ix]) continue;
     48            radius->data.F32[n] = hypot (ix - Xo, iy - Yo) ;
     49            flux->data.F32[n]   = source->pixels->data.F32[iy][ix];
     50            weight->data.F32[n] = source->weight->data.F32[iy][ix];
     51            n++;
     52        }
    5253    }
    5354    radius->n = n;
     
    5657
    5758    // sort the vector set by the radius
    58     PSSORT (radius->n, COMPARE, SWAPFUNC, NONE);
     59    PSSORT (radius->n, COMPARE_RADIUS, SWAP_RADIUS, NONE);
    5960
    6061    return true;
Note: See TracChangeset for help on using the changeset viewer.