Changeset 9785
- Timestamp:
- Oct 30, 2006, 11:45:46 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibADD.tex (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r6009 r9785 1 %%% $Id: psLibADD.tex,v 1.9 3 2006-01-16 01:11:40eugene Exp $1 %%% $Id: psLibADD.tex,v 1.94 2006-10-30 21:45:46 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 366 366 size is choosen to keep about 25 points per bin. Thus, the bin size 367 367 ($d\sigma$) is set to about: 368 \ [368 \begin{equation} 369 369 d\sigma = 2.35 \sigma (N_{\rm bin}/N_{50}) = (25 \times 2.35) (\sigma/N_{50}) 370 \ ]370 \end{equation} 371 371 With the limitation that $\sigma/d\sigma$ should be limited on one end 372 372 to the value 1, and the other to the value 5. The easiest way to set 373 373 this limit is to define dN to be: 374 \ [374 \begin{equation} 375 375 dN = (\sigma / d\sigma) = (N_{50} / N_{\rm bin}) / 2.35 = 0.017 * N_{50} 376 \ ]376 \end{equation} 377 377 \subsubsection{Histograms} 378 378 … … 426 426 T_2(x) & = & 2x^2 - 1 \\ 427 427 T_3(x) & = & 4x^3 - 3x \\ 428 T_4(x) & = & 8x^4 - 8x^2 + 1 \\428 T_4(x) & = & 8x^4 - 8x^2 + 1 429 429 \end{eqnarray} 430 430 Chebyshev polynomials follow the recurrence relation: … … 437 437 \begin{eqnarray} 438 438 d_j & = & 2xd_{j+1} - d_{j+2} + c_j \\ 439 f(x) & = & x*d_1 - d_2 + 1/2 c_0 \\439 f(x) & = & x*d_1 - d_2 + 1/2 c_0 440 440 \end{eqnarray} 441 441 … … 721 721 $i+1,j$, $i,j+1$, and $i+1,j+1$ with pixel values $V_{0,0}$, 722 722 $V_{1,0}$, $V_{0,1}$, $V_{1,1}$. The value at $x,y$ is given by: 723 \ [ V = (V_{0,0}(1 - f_x) + V_{1,0}f_x)(1 - f_y) + (V_{0,1}(1-f_x) + V_{1,1}f_x)f_y \]723 \begin{equation} V = (V_{0,0}(1 - f_x) + V_{1,0}f_x)(1 - f_y) + (V_{0,1}(1-f_x) + V_{1,1}f_x)f_y \end{equation} 724 724 This expression is more efficiently evaluated by factoring and 725 725 calculating the expresion as: 726 \ [ r_x = V_{0,0} + (V_{1,0} - V_{0,0})f_x \]727 \ [ V = r_x + (V_{0,1} + (V_{1,1} - V_{0,1})f_x - r_x)f_y \]726 \begin{equation} r_x = V_{0,0} + (V_{1,0} - V_{0,0})f_x \end{equation} 727 \begin{equation} V = r_x + (V_{0,1} + (V_{1,1} - V_{0,1})f_x - r_x)f_y \end{equation} 728 728 729 729 Note that the values of $f_x$ and $f_y$ require some care. Given a … … 876 876 the output image ($i,j$) corresponds to a fractional pixel coordinate 877 877 ($x,y$) in the input image according to: 878 \ [ x = (i - i_o)*\cos\theta + (j - j_o)*\sin\theta \]879 \ [ y = (i_o - i)*\sin\theta + (j - j_o)*\cos\theta \]878 \begin{equation} x = (i - i_o)*\cos\theta + (j - j_o)*\sin\theta \end{equation} 879 \begin{equation} y = (i_o - i)*\sin\theta + (j - j_o)*\cos\theta \end{equation} 880 880 where the offset coordinate ($i_o,j_o$) depends on the sign of the 881 881 sine of the angle $\theta$. If the sign of that sine is positive, the … … 1092 1092 P_0 & = & \left| C_0 \right|^2 / N^2 \\ 1093 1093 P_j & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\ 1094 P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\1094 P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 1095 1095 \end{eqnarray} 1096 1096 where $j = 1, 2, \ldots, (N/2 - 1)$. … … 1098 1098 Note that we leave the issue of ``windowing'' the data up to the 1099 1099 caller, and choose to normalise by $1/N^2$. 1100 1101 \subsection{Ellipse Representations} 1102 1103 Images of astronomical objects may often be represented using a model 1104 consisting of a radial profile combined with an elliptical contour. 1105 Two common ways to measure such a shape are to fit a model to the 1106 light distribution or to measure second-order moments, perhaps with 1107 some weighting profile. In the special case of a 2D Gaussian with an 1108 elliptical contour, these representations are equivalent. The 1109 following discussion shows how to relate the fitted parameters and 1110 second-order moments of a elliptical Gaussian of an arbitrary 1111 orientation with the parameters of an unrotate elliptical Gaussian. 1112 1113 Consider a 2D Gaussian with an elliptical contour. If the ellipse is 1114 oriented with the major axis along the x-axis, then the formula for 1115 such a Gaussian may be written $f = exp(-z)$ where 1116 \begin{equation} 1117 \label{aligned-ellipse} 1118 z = \frac{x^2}{2\sigma_a^2} + \frac{y^2}{2\sigma_b^2} 1119 \end{equation} 1120 with $\sigma_a$ the semi-major axis and $\sigma_b$ the semi-minor axis 1121 of the 1$\sigma$ contour. Given such a Gaussian, we may measure its 1122 second moments by integration, and find that the second moment tensor 1123 is 1124 \begin{equation} \left| \begin{array}{cc} 1125 \sigma_a^2 & 0 \\ 1126 0 & \sigma_b^2 \\ 1127 \end{array} \right| \end{equation} 1128 1129 Now consider the same ellipse rotated to an arbitrary angle $\theta$. 1130 The formula for such a Gaussian may be written $f = exp(-z)$ where 1131 \begin{equation} 1132 \label{rotated-ellipse} 1133 z = \frac{x^2}{2\sigma_x^2} + \frac{y^2}{2\sigma_y^2} + \sigma_{xy}xy 1134 \end{equation} 1135 Note that, in the above form of the equation, $\sigma_{xy}$ goes to 0 1136 as the ellipse is rotated to be aligned with the x (or y) axis. Thus, 1137 in this representation, $\sigma_{xy}$ is well behaved, but does not 1138 have the same units of length that $\sigma_x$ or $\sigma_y$ have. Our 1139 goal is to determine the relationships between the rotated and 1140 unrotated components of the Gaussian formula as well as the second 1141 moments. 1142 1143 To determine the behavior of $\sigma_x$, etc, under rotation, we start 1144 with the aligned ellipse (\ref{aligned-ellipse}) and rotate the 1145 coordinate frame by an angle $-\theta$: 1146 \begin{equation} 1147 \left( \begin{array}{c} x^\prime \\ y^\prime \end{array} \right) = 1148 \left| \begin{array}{cc} \cos \theta & \sin \theta \\ 1149 -\sin \theta & \cos \theta 1150 \end{array} \right| 1151 \left( \begin{array}{c} x \\ y \end{array} \right) 1152 \end{equation} 1153 where $x^\prime$ and $y^\prime$ are the coordinates for the unrotated 1154 (aligned) ellipse. Applying this rotation to (\ref{aligned-ellipse}) yields: 1155 \begin{equation} 1156 z = \frac{x^2 \cos^2 \theta + y^2 \sin^2 \theta + 2 x y \sin \theta \cos \theta}{2\sigma_a^2} + 1157 \frac{x^2 \sin^2 \theta + y^2 \cos^2 \theta - 2 x y \sin \theta \cos \theta}{2\sigma_b^2} 1158 \end{equation} 1159 Grouping these terms together, we find: 1160 \begin{equation} 1161 z = \frac{x^2}{2}(\sigma_a^{-2} \cos^2 \theta + \sigma_b^{-2}\sin^2 \theta) + 1162 \frac{y^2}{2}(\sigma_b^{-2} \cos^2 \theta + \sigma_a^{-2}\sin^2 \theta) - 1163 \frac{xy}{2} \sin (2 \theta) (\sigma_b^{-2} - \sigma_a^{-2}) 1164 \end{equation} 1165 We then associate the components of this equation with those of (\ref{rotated-ellipse}) and find: 1166 \begin{eqnarray} 1167 \sigma_x^{-2} & = & \sigma_a^{-2} \cos^2 \theta + \sigma_b^{-2}\sin^2 \theta \\ 1168 \sigma_y^{-2} & = & \sigma_b^{-2} \cos^2 \theta + \sigma_a^{-2}\sin^2 \theta \\ 1169 \sigma_{xy} & = & \frac{1}{2} \sin (2 \theta) (\sigma_b^{-2} - \sigma_a^{-2}) 1170 \end{eqnarray} 1171 Replacing $\cos^2$ and $\sin^2$ with the double-angle relationships, we find: 1172 \begin{eqnarray} 1173 \sigma_x^{-2} & = & \frac{1}{2}(\sigma_a^{-2} + \sigma_b^{-2}) - \frac{1}{2}(\sigma_b^{-2} - \sigma_a^{-2}) \cos (2 \theta) \\ 1174 \sigma_y^{-2} & = & \frac{1}{2}(\sigma_a^{-2} + \sigma_b^{-2}) + \frac{1}{2}(\sigma_b^{-2} - \sigma_a^{-2}) \cos (2 \theta) \\ 1175 \sigma_{xy} & = & \frac{1}{2} \sin (2 \theta) (\sigma_b^{-2} - \sigma_a^{-2}) 1176 \end{eqnarray} 1177 These formulae thus define the values of $\sigma_x$, $\sigma_y$, and 1178 $\sigma_{xy}$ given $\sigma_a$, $\sigma_b$, and $\theta$. Note that 1179 in this equation and the one above, we represent the quantities in 1180 terms of $\sigma_b^{-2} - \sigma_a^{-2}$ which is always greater than 1181 0, thus attributing the sign of the equation to the $\sin$ or $\cos$ 1182 term. This is necessary to determine the angle in the proper quadrant 1183 using the arctangent below. 1184 1185 With the above relationships, we may now form combinations that help 1186 us to solve for $\sigma_a$, $\sigma_b$, and $\theta$: 1187 \begin{eqnarray} 1188 f_1 = \sigma_y^{-2} + \sigma_x^{-2} & = & \sigma_b^{-2} + \sigma_a^{-2} \\ 1189 f_2 = \sigma_y^{-2} - \sigma_x^{-2} & = & (\sigma_b^{-2} - \sigma_a^{-2}) \cos (2 \theta) \\ 1190 f_3 = \sqrt{f_2^2 + 4\sigma_{xy}^2} & = & \sigma_b^{-2} - \sigma_a^{-2} 1191 \end{eqnarray} 1192 From these, we may derive the equations for $\sigma_a$, $\sigma_b$, and $\theta$: 1193 \begin{eqnarray} 1194 \theta & = & \frac{1}{2} \arg (-2 \sigma_{xy}, f_2) \\ 1195 \sigma_a & = & \sqrt{\frac{2}{f_1 - f_3}} \\ 1196 \sigma_b & = & \sqrt{\frac{2}{f_1 + f_3}} 1197 \end{eqnarray} 1198 1199 The relationship between the rotated ($m_{i,j}$) and unrotated 1200 ($M_{i,j}$) second moments, the latter being equal to $\sigma_a^2$ and 1201 $\sigma_b^2$, is derived in a similar fashion. We start with the 1202 point that the second moment is rotated as a tensor: 1203 \begin{equation} 1204 \left| 1205 \begin{array}{cc} 1206 m_{x,x} & m_{x,y} \\ 1207 m_{y,x} & m_{y,y} \\ 1208 \end{array} \right| 1209 = 1210 \left| 1211 \begin{array}{cc} 1212 +\cos \theta & +\sin \theta \\ 1213 -\sin \theta & +\cos \theta \\ 1214 \end{array} \right| 1215 \left| 1216 \begin{array}{cc} 1217 M_{x,x} & 0 \\ 1218 0 & M_{y,y} \\ 1219 \end{array} \right| 1220 \left| 1221 \begin{array}{cc} 1222 +\cos \theta & -\sin \theta \\ 1223 +\sin \theta & +\cos \theta \\ 1224 \end{array} \right| 1225 \end{equation} 1226 Multiplying this out and substituting $\sigma_a^2$, $\sigma_b^2$ for $M_{x,x}$, $M_{y,y}$, we find: 1227 \begin{eqnarray} 1228 m_{x,x} & = & \sigma_a^{2} \cos^2 \theta + \sigma_b^{2}\sin^2 \theta \\ 1229 m_{y,y} & = & \sigma_b^{2} \cos^2 \theta + \sigma_a^{2}\sin^2 \theta \\ 1230 m_{x,y} & = & -\frac{1}{2} \sin (2 \theta) (\sigma_a^2 - \sigma_b^2) 1231 \end{eqnarray} 1232 Using the double-angle relationships, these become: 1233 \begin{eqnarray} 1234 m_{x,x} & = & \frac{1}{2}(\sigma_a^{2} + \sigma_b^{2}) + \frac{1}{2}(\sigma_a^{2} - \sigma_b^{2}) \cos (2 \theta) \\ 1235 m_{y,y} & = & \frac{1}{2}(\sigma_a^{2} + \sigma_b^{2}) - \frac{1}{2}(\sigma_a^{2} - \sigma_b^{2}) \cos (2 \theta) \\ 1236 m_{x,y} & = & -\frac{1}{2} \sin (2 \theta) (\sigma_a^{-2} - \sigma_b^{-2}) 1237 \end{eqnarray} 1238 These three formulae define the second moments in terms of $\sigma_a$, $\sigma_b$, and $\theta$. 1239 1240 We define equivalent intermediate products to the above: 1241 \begin{eqnarray} 1242 g_1 = m_{x,x} + m_{y,y} & = & \sigma_a^{2} + \sigma_b^{2} \\ 1243 g_2 = m_{x,x} - m_{y,y} & = & (\sigma_a^{2} - \sigma_b^{2}) \cos (2 \theta) \\ 1244 g_3 = \sqrt{f_2^2 + 4 m_{x,y}^2} & = & \sigma_a^{2} - \sigma_b^{-2} 1245 \end{eqnarray} 1246 From these, we may derive the equations for $\sigma_a$, $\sigma_b$, and $\theta$: 1247 \begin{eqnarray} 1248 \theta & = & \frac{1}{2} \arg (-2 m_{x,y}, g_2) \\ 1249 \sigma_a & = & \sqrt{\frac{g_1 - g_3}{2}} \\ 1250 \sigma_b & = & \sqrt{\frac{g_1 + g_3}{2}} 1251 \end{eqnarray} 1100 1252 1101 1253 \section{PSLib Astronomy Utilities} … … 1793 1945 \alpha_p & = & 180^\circ - 192.85948^\circ \\ 1794 1946 \delta_p & = & 90^\circ - 62.87175^\circ \\ 1795 \phi_p & = & 90^\circ + 32.93192^\circ \\1947 \phi_p & = & 90^\circ + 32.93192^\circ 1796 1948 \end{eqnarray} 1797 1949 … … 2768 2920 \begin{eqnarray} 2769 2921 x_p & = & \rho_x x \\ 2770 y_p & = & \rho_y y \\2922 y_p & = & \rho_y y 2771 2923 \end{eqnarray} 2772 2924 % … … 2830 2982 \begin{eqnarray} 2831 2983 \alpha - \alpha_p & = & \arctan (\sin \alpha, \cos \alpha) \\ 2832 \delta & = & \arcsin (\sin \delta) \\2984 \delta & = & \arcsin (\sin \delta) 2833 2985 \end{eqnarray} 2834 2986 % … … 2845 2997 y & = & \frac{-\cos \theta \cos \phi}{\sin \theta} \\ 2846 2998 \sin \theta & = & \zeta / \sqrt{1 + \zeta^2} \\ 2847 \cos \theta & = & 1 / \sqrt{1 + \zeta^2} \\2999 \cos \theta & = & 1 / \sqrt{1 + \zeta^2} 2848 3000 \end{eqnarray} 2849 3001 … … 2860 3012 y & = & -\cos \theta \cos \phi \\ 2861 3013 \sin \theta & = & \sqrt{1 - R_\theta^2} \\ 2862 \cos \theta & = & R_\theta \\3014 \cos \theta & = & R_\theta 2863 3015 \end{eqnarray} 2864 3016 … … 2922 3074 \begin{eqnarray} 2923 3075 x & = & \phi \left( 2 \cos \frac{2 \theta}{3} - 1 \right) \\ 2924 y & = & \pi \sin \frac{\theta}{3} \\3076 y & = & \pi \sin \frac{\theta}{3} 2925 3077 \end{eqnarray} 2926 3078 … … 2930 3082 \theta & = & 3 \sin^{-1} \rho \\ 2931 3083 \phi & = & \frac{x}{1 - 4\rho^2} \\ 2932 {\rm where}\hspace{1cm} \rho & \equiv & y/\pi \\3084 {\rm where}\hspace{1cm} \rho & \equiv & y/\pi 2933 3085 \end{eqnarray} 2934 3086 … … 3031 3183 This function is a two-dimensional Gaussian with an elliptical 3032 3184 cross-section and a constant local background: 3033 \ [3185 \begin{equation} 3034 3186 f(x,y) = Z_o e^{-z} + S_o 3035 \ ]3187 \end{equation} 3036 3188 where 3037 \ [3189 \begin{equation} 3038 3190 z = \frac{(x - x_o)^2}{2\sigma_x^2} + \frac{(y-y_o)^2}{2\sigma_y^2} + (x-x_o) (y - y_o) \sigma_{xy} 3039 \ ]3191 \end{equation} 3040 3192 3041 3193 Below is the relationship between the \code{psModel} parameters and … … 3080 3232 This function is a polynomial approximation of a 2D Gaussian. The 3081 3233 function is very similar to the real Gaussian: 3082 \ [3234 \begin{equation} 3083 3235 f(x,y) = Z_o (1 + z + z^2/2 + z^3/6)^{-1} + S_o 3084 \ ]3236 \end{equation} 3085 3237 where 3086 \ [3238 \begin{equation} 3087 3239 z = \frac{(x - x_o)^2}{2\sigma_x^2} + \frac{(y-y_o)^2}{2\sigma_y^2} + (x-x_o) (y - y_o) \sigma_{xy} 3088 \ ]3240 \end{equation} 3089 3241 3090 3242 Below is the relationship between the \code{psModel} parameters and … … 3133 3285 than the Taylor series values of 1/2 and 1/6. The 3134 3286 function is very similar to the pseudo-Gaussian: 3135 \ [3287 \begin{equation} 3136 3288 f(x,y) = Z_o (1 + z + B_2 (z^2/2 + B_3 z^3/6))^{-1} + S_o 3137 \ ]3289 \end{equation} 3138 3290 where 3139 \ [3291 \begin{equation} 3140 3292 z = \frac{(x - x_o)^2}{2\sigma_x^2} + \frac{(y-y_o)^2}{2\sigma_y^2} + (x-x_o) (y - y_o) \sigma_{xy} 3141 \ ]3293 \end{equation} 3142 3294 3143 3295 Below is the relationship between the \code{psModel} parameters and … … 3189 3341 core, where the core has a different contour from the wings. 3190 3342 3191 \ [3343 \begin{equation} 3192 3344 f(x,y) = Z_{\rm pk} (1 + z_1 + z_2^M)^{-1} + Sky 3193 \ ]3345 \end{equation} 3194 3346 where 3195 \ [3347 \begin{equation} 3196 3348 z_1 = \frac{x^2}{2\sigma_{x,in}^2} + \frac{y^2}{2\sigma_{y,in}^2} + x y \sigma_{xy,in} 3197 3349 z_2 = \frac{x^2}{2\sigma_{x,out}^2} + \frac{y^2}{2\sigma_{y,out}^2} + x y \sigma_{xy,out} 3198 \ ]3350 \end{equation} 3199 3351 3200 3352 \begin{verbatim}
Note:
See TracChangeset
for help on using the changeset viewer.
