IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 28, 2007, 3:41:13 PM (19 years ago)
Author:
eugene
Message:

adding extended source measurements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psphot/src/psphotIsophotal.c

    r15359 r15400  
    77  assert (source->extpars->profile->radius);
    88  assert (source->extpars->profile->flux);
     9
     10  bool status;
    911
    1012  psVector *radius = source->extpars->profile->radius;
     
    1921  // XXX do I need to worry about crazy outliers? 
    2022  // XXX should i be smoothing or fitting the curve?
    21   firstBelow = -1;
    22   lastAbove = -1;
     23  int firstBelow = -1;
     24  int lastAbove = -1;
    2325  for (int i = 0; i < flux->n; i++) {
    2426    if (flux->data.F32[i] > ISOPHOT_FLUX) lastAbove = i;
     
    3133  for (int i = 0; i <= PS_MAX(firstBelow, lastAbove); i++) {
    3234    if (i <= firstBelow) {
    33       isophotFluxFirst += flux->data.F32[i];
     35      isophotalFluxFirst += flux->data.F32[i];
    3436    }
    3537    if (i <= lastAbove) {
    36       isophotFluxLast += flux->data.F32[i];
     38      isophotalFluxLast += flux->data.F32[i];
    3739    }
    3840  }
    39   float isophotalFlux    = 0.5*(isophotFluxLast + isophotFluxFirst);
    40   float isophotalFluxErr = 0.5*fabs(isophotFluxLast - isophotFluxFirst);
     41  float isophotalFlux    = 0.5*(isophotalFluxLast + isophotalFluxFirst);
     42  float isophotalFluxErr = 0.5*fabs(isophotalFluxLast - isophotalFluxFirst);
    4143
    4244  float isophotalRad     = 0.5*(radius->data.F32[firstBelow] + radius->data.F32[lastAbove]);
     
    5759
    5860}
    59 
    60 # if (0)
    61   // XXX cache the tmpScalar
    62   psScalar fluxScalar;
    63   fluxScalar.type.type = PS_TYPE_F32;
    64   fluxScalar.data.F32  = ISOPHOT_FLUX;
    65 
    66   // radius and flux must be sorted by radius
    67 
    68   // XXX in general, flux decreases monotonically with radius.  however, since exceptions are
    69   // possible we need to do something to smooth or otherwise handle the flux variations
    70  
    71   // get the index of the flux-sorted vector
    72   psVector *fluxIndex = psVectorSortIndex (flux);
    73 
    74   // XXX need to write psVectorIndexBinaryDisect, which operates on a
    75 
    76   // use disection to get in the right vicinity
    77   binS = psVectorIndexBinaryDisect (&result, flux, fluxIndex, fluxScalar, PS_BISECT_FIRST);
    78   binE = psVectorIndexBinaryDisect (&result, flux, fluxIndex, fluxScalar, PS_BISECT_LAST);
    79 
    80   // find the min and max radius bins in this range
    81 
    82   // XXX do something to choose a more accurate radial bin
    83 
    84 # endif
Note: See TracChangeset for help on using the changeset viewer.