IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 7, 2008, 11:14:09 AM (18 years ago)
Author:
Paul Price
Message:

Reworking due to compiler error which seems to be due to initialising static value to NAN: 'initializer element is not constant'. Got rid of the static --- no need for this, unless the psMetadataLookup is too heavy (shouldn't be, and there's more processing going on in these functions than is going on in psMetadataLookup).

File:
1 edited

Legend:

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

    r17396 r17561  
    11# include "psphotInternal.h"
    2 
    3 static float PETROSIAN_R0 = NAN;
    4 static float PETROSIAN_RF = NAN;
    52
    63bool psphotPetrosian (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
     
    1714
    1815  // flux at which to measure isophotal parameters
    19   if (!isfinite(PETROSIAN_R0)) {
    20     PETROSIAN_R0 = psMetadataLookupF32 (&status, recipe, "PETROSIAN_R0");
    21     PETROSIAN_RF = psMetadataLookupF32 (&status, recipe, "PETROSIAN_FLUX_RATIO");
    22     assert (status);
    23   }
     16  float PETROSIAN_R0 = psMetadataLookupF32 (&status, recipe, "PETROSIAN_R0");
     17  float PETROSIAN_RF = psMetadataLookupF32 (&status, recipe, "PETROSIAN_FLUX_RATIO");
     18  assert (status);
    2419
    2520  // first find flux at R0
     
    5045  }
    5146  fluxR0 /= (float)(fluxRn);
    52  
     47
    5348  // target flux for petrosian radius
    5449  float fluxRP = fluxR0 * PETROSIAN_RF;
     
    5651  // find the first bin below the flux level and the last above the level
    5752  // XXX can this be done faster with bisection?
    58   // XXX do I need to worry about crazy outliers? 
     53  // XXX do I need to worry about crazy outliers?
    5954  // XXX should i be smoothing or fitting the curve?
    6055  int firstBelow = -1;
     
    9792    source->extpars->petrosian = pmSourcePetrosianValuesAlloc ();
    9893  }
    99  
     94
    10095  // these are uncalibrated: instrumental mags and pixel units
    10196  source->extpars->petrosian->mag    = -2.5*log10(fluxRPSum);
     
    106101
    107102  psTrace ("psphot", 5, "Petrosian flux:%f +/- %f @ %f +/- %f for %f, %f\n",
    108            source->extpars->petrosian->mag, source->extpars->petrosian->magErr,
    109            source->extpars->petrosian->rad, source->extpars->petrosian->radErr,
    110            source->peak->xf, source->peak->yf);
     103           source->extpars->petrosian->mag, source->extpars->petrosian->magErr,
     104           source->extpars->petrosian->rad, source->extpars->petrosian->radErr,
     105           source->peak->xf, source->peak->yf);
    111106
    112107  return true;
Note: See TracChangeset for help on using the changeset viewer.