IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2009, 6:24:53 AM (17 years ago)
Author:
eugene
Message:

updates for petrosian analysis study

Location:
branches/eam_branches/20090715/psphot/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src

    • Property svn:ignore
      •  

        old new  
        1818psphotVersionDefinitions.h
        1919psphotMomentsStudy
         20psphotPetrosianStudy
  • branches/eam_branches/20090715/psphot/src/psphotPetrosianProfile.c

    r25032 r25105  
    11# include "psphotInternal.h"
     2
     3// generate the Petrosian radius and flux using elliptical contours
     4
     5// XXX much of this function is focused on generating the clean contours, which can be used by
     6// any number of aperture-like measurements.  probably will want to rename the pmPetrosian
     7// structure to something the pmRadialProfile
    28
    39bool psphotPetrosianProfile (pmSource *source) {
    410
     11  // container to hold results from the radial profile analysis
    512  pmPetrosian *petrosian = pmPetrosianAlloc();
    613
    7   if (!psphotRadialProfilesByAngle (petrosian, source, Nsec, Rmax)) {
     14  int Nsec = 24;
     15  float Rmax = 64;
     16  float fluxMin = 0.0;
     17  float fluxMax = 1000.0;
     18
     19  // generate a series of radial profiles at Nsec evenly spaced angles.  the profile flux
     20  // is measured by interpolation for small radii; for large radii, the pixels in a box
     21  // are averaged to increase the S/N (XXX not yet done)
     22  if (!psphotRadialProfilesByAngles (petrosian, source, Nsec, Rmax)) {
    823    psError (PS_ERR_UNKNOWN, false, "failed to measure radial profile for petrosian");
    924    return false;
    1025  }
    1126
     27  // use the radial profiles to determine the radius of a given isophote.  this isophote
     28  // is used to determine the elliptical shape of the object, so it has a relatively high
     29  // value (nominally 50% of the peak)
    1230  if (!psphotRadiiFromProfiles (petrosian, fluxMin, fluxMax)) {
    1331    psError (PS_ERR_UNKNOWN, false, "failed to measure isophotal radii from profiles");
     
    1533  }
    1634
     35  // convert the isophotal radius vs angle measurements to an elliptical contour
    1736  if (!psphotEllipticalContour (petrosian)) {
    1837    psError (PS_ERR_UNKNOWN, false, "failed to measure elliptical contour");
     
    2039  }
    2140 
     41  // generate a single, normalized radial profile following the elliptical contours.
     42  // the radius is normalized by the axis ratio so that on the major axis, 1 pixel = 1 pixel
     43  if (!psphotEllipticalProfile (source, petrosian)) {
     44    psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile");
     45    return false;
     46  }
     47 
     48  // integrate the radial profile for radial bins defined for the petrosian measurement:
     49  // SB_i (r_i) where \alpha r_i < r < \beta r_i
     50  if (!psphotPetrosianRadialBins (source, petrosian, Rmax)) {
     51    psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile");
     52    return false;
     53  }
     54 
     55  // use the SB_i from above to calculate the petrosian radius and the flux within that radius
     56  if (!psphotPetrosianStats (petrosian)) {
     57    psError (PS_ERR_UNKNOWN, false, "failed to generate elliptical profile");
     58    return false;
     59  }
     60 
     61  psphotPetrosianFreeVectors(petrosian);
    2262
     63  fprintf (stderr, "petrosian radius: %f, flux: %f, axis ratio: %f, angle: %f\n",
     64           petrosian->petrosianRadius, petrosian->petrosianFlux, petrosian->axes.minor/petrosian->axes.major, PS_DEG_RAD*petrosian->axes.theta);
     65
     66  return true;
    2367}
Note: See TracChangeset for help on using the changeset viewer.