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/psphotPetrosian.c

    r15359 r15400  
    22
    33bool psphotPetrosian (pmSource *source, psMetadata *recipe, psMaskType maskVal) {
     4
     5  bool status;
    46
    57  assert (source->extpars);
     
    1719
    1820  // first find flux at R0
    19   firstBelow = -1;
    20   lastAbove = -1;
     21  int firstBelow = -1;
     22  int lastAbove = -1;
    2123  for (int i = 0; i < radius->n; i++) {
    2224    if (radius->data.F32[i] > PETROSIAN_R0) lastAbove = i;
     
    2527
    2628  // average flux in this range
    27   fluxR0 = 0.0;
    28   fluxRn = 0;
     29  float fluxR0 = 0.0;
     30  int fluxRn = 0;
    2931  for (int i = PS_MIN(firstBelow, lastAbove); i <= PS_MAX(firstBelow, lastAbove); i++) {
    3032    fluxR0 += flux->data.F32[i];
    3133    fluxRn ++;
    3234  }
    33   fluxR0 = fluxR0 / (float)(fluxRn);
     35  fluxR0 /= (float)(fluxRn);
    3436 
    3537  // target flux for petrosian radius
    36   fluxRP = fluxR0 * PETROSIAN_RF;
     38  float fluxRP = fluxR0 * PETROSIAN_RF;
    3739
    3840  // find the first bin below the flux level and the last above the level
     
    5860    }
    5961  }
    60   float flux    = 0.5*(fluxLast + fluxFirst);
    61   float fluxErr = 0.5*fabs(fluxLast - fluxFirst);
     62  float fluxRPSum    = 0.5*(fluxLast + fluxFirst);
     63  float fluxRPSumErr = 0.5*fabs(fluxLast - fluxFirst);
    6264  // XXX need to use the weight appropriately here...
    6365
     
    7072 
    7173  // these are uncalibrated: instrumental mags and pixel units
    72   source->extpars->petrosian->mag    = -2.5*log10(flux);
    73   source->extpars->petrosian->magErr = fluxErr / flux;
     74  source->extpars->petrosian->mag    = -2.5*log10(fluxRPSum);
     75  source->extpars->petrosian->magErr = fluxRPSumErr / fluxRPSum;
    7476
    7577  source->extpars->petrosian->rad    = rad;
Note: See TracChangeset for help on using the changeset viewer.