Index: /trunk/psphot/doc/notes.20090523.txt
===================================================================
--- /trunk/psphot/doc/notes.20090523.txt	(revision 24992)
+++ /trunk/psphot/doc/notes.20090523.txt	(revision 24993)
@@ -1,19 +1,58 @@
 
-20090523 : extended source analysis -- further development
+20090725 : extended source radial profiles
 
- issues to address:
+ I need to fix the Petrosian and similar code.  There are several issues:
 
- * quality of moments used for initial psf selection
-   - what is the behavior of moments with Gaussian windowing as function of S/N & size?
-   - can we choose a sigma value that will give reliable moments for an expected range of seeing?
+ 1) correct implementation of the actual Petrosian radius / Petrosian flux measurement:
 
- * moments for galaxy model guesses
-   - trade-off between Gaussian windowing, tophat windowing, and S/N windowing in footprint area
+    R_p : Given F(R) : F(0) / F(R_p) = 0.9 ?? (something like this...)
 
- initial dev work:
+    Actually implemented by calculating the average surface brightness in annullii:
 
- * add Gaussian windowing, S/N windowing, (tophat windowing) and options to select
+    R_p : Given F(R) -> define f(R) = \sum_{R-dR}^{R+dR}F(R) / 4\pi R dR
+    R_p : f(dR) / F(R_p) = P_ratio
 
- * check visualization of moments
+ 2) need to construct a clean, normalized radial profile to make this measurement
+
+    * generate radial profiles for each of N annular wedges
+    * find R_50 : f(0) / f(R_50) = 0.5
+    $ fit the ellipse of R_50 to Rmaj sin(T) + Rmin cos(T) 
+
+
+    cos(a+b) = cos(a) cos(b) - sin(a) sin(b)
+    sin(a+b) = cos(a) sin(b) + cos(b) sin(a)
+
+    cos(theta+To) = cos(theta) cos(To) - sin(theta) sin(To)
+    sin(theta+To) = cos(theta) sin(To) + sin(theta) cos(To)
+
+    R_x = R_maj cos(theta + theta_o) = R_maj cos(theta) cos(theta_o) - Rmaj sin(theta) sin(theta_o)
+    R_y = R_min sin(theta + theta_o) = R_min cos(theta) sin(theta_o) + Rmin sin(theta) cos(theta_o)
+
+    R_X = R_x cos(phi) - R_y sin(phi)
+    R_Y = R_x sin(phi) + R_y cos(phi)
+
+    R_X = R_maj cos(phi) cos(theta + To) - R_min sin(phi) sin(theta + To)
+    R_Y = R_maj sin(phi) cos(theta + To) + R_min cos(phi) sin(theta + To)
+
+    R_X = (R_maj cos(phi) cos (To) - R_min sin(phi) sin(To)) cos(theta) - (Rmaj cos(phi) sin(To) + Rmin sin(phi) cos(To)) sin(theta)
+    R_Y = (R_maj sin(phi) cos (To) + R_min cos(phi) sin(To)) cos(theta) - (Rmaj cos(phi) sin(To) + Rmin sin(phi) cos(To)) sin(theta)
+    
+
+    R_X = Ax cos(theta) + Bx sin(theta)
+    R_Y = Ay cos(theta) + By sin(theta)
+    
+    Ax = \sum (R_X * cos(theta))
+    Bx = \sum (R_X * sin(theta))
+    Ay = \sum (R_Y * cos(theta))
+    By = \sum (R_Y * sin(theta))
+
+    R_maj = sqrt(Ax^2 + Ay^2)
+    R_min = sqrt(Bx^2 + By^2)
+
+    phi = atan2(Bx + By, Ax + Ay)
+
+    *** get rest of math from my notebook...
+
+
 
 20090525 : some clarity of issues:
@@ -40,2 +79,20 @@
    
  * QGAUSS with see 
+
+20090523 : extended source analysis -- further development
+
+ issues to address:
+
+ * quality of moments used for initial psf selection
+   - what is the behavior of moments with Gaussian windowing as function of S/N & size?
+   - can we choose a sigma value that will give reliable moments for an expected range of seeing?
+
+ * moments for galaxy model guesses
+   - trade-off between Gaussian windowing, tophat windowing, and S/N windowing in footprint area
+
+ initial dev work:
+
+ * add Gaussian windowing, S/N windowing, (tophat windowing) and options to select
+
+ * check visualization of moments
+
