IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17561


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).

Location:
trunk/psphot/src
Files:
2 edited

Legend:

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

    r17396 r17561  
    11# include "psphotInternal.h"
    2 
    3 static float ISOPHOT_FLUX = NAN;
    42
    53bool psphotIsophotal (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
     
    1614
    1715  // flux at which to measure isophotal parameters
    18   if (!isfinite(ISOPHOT_FLUX)) {
    19     // XXX ISOPHOTAL_FLUX should be specified in mags, need the zero point to get counts/sec
    20     ISOPHOT_FLUX = psMetadataLookupF32 (&status, recipe, "ISOPHOTAL_FLUX");
    21     assert (status);
    22   }
     16  // XXX ISOPHOTAL_FLUX should be specified in mags, need the zero point to get counts/sec
     17  float ISOPHOT_FLUX = psMetadataLookupF32 (&status, recipe, "ISOPHOTAL_FLUX");
     18  assert (status);
    2319
    2420  // find the first bin below the flux level and the last above the level
    2521  // XXX can this be done faster with bisection?
    26   // XXX do I need to worry about crazy outliers? 
     22  // XXX do I need to worry about crazy outliers?
    2723  // XXX should i be smoothing or fitting the curve?
    2824  int firstBelow = -1;
     
    4440    return false;
    4541  }
    46  
     42
    4743  // need to examine pixels in this vicinity
    4844  float isophotalFluxFirst = 0;
     
    6561    source->extpars->isophot = pmSourceIsophotalValuesAlloc ();
    6662  }
    67  
     63
    6864  // these are uncalibrated: instrumental mags and pixel units
    6965  source->extpars->isophot->mag    = -2.5*log10(isophotalFlux);
     
    7470
    7571  psTrace ("psphot", 5, "Isophot flux:%f +/- %f @ %f +/- %f for %f, %f\n",
    76            source->extpars->isophot->mag, source->extpars->isophot->magErr,
    77            source->extpars->isophot->rad, source->extpars->isophot->radErr,
    78            source->peak->xf, source->peak->yf);
     72           source->extpars->isophot->mag, source->extpars->isophot->magErr,
     73           source->extpars->isophot->rad, source->extpars->isophot->radErr,
     74           source->peak->xf, source->peak->yf);
    7975
    8076  return true;
  • 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.