IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 755


Ignore:
Timestamp:
May 21, 2004, 4:43:54 PM (22 years ago)
Author:
Paul Price
Message:

Added section on fitting an image with a 2D Chebyshev polynomial.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibADD.tex

    r726 r755  
    1 %%% $Id: psLibADD.tex,v 1.14 2004-05-19 00:48:05 price Exp $
     1%%% $Id: psLibADD.tex,v 1.15 2004-05-22 02:43:54 price Exp $
    22\documentclass[panstarrs]{panstarrs}
     3
     4\usepackage{amsmath}
    35
    46% basic document variables
     
    2426\RevisionsStart
    2527% version     Date         Description
    26 \theversion & 2003 Mar 11 & Hacking \\
     2800 & 2004 Mar 11 & Hacking \\
     2901 & 2004 May 21 & Added section on 2D Chebyshev fitting. \\
    2730\RevisionsEnd
    2831
     
    507510\end{center}
    508511
     512\paragraph{Fitting a 2D Chebyshev Polynomial}
     513
     514Suppose we have an image, $z = z(x,y)$ with corresponding error
     515estimates, $\sigma_z(x,y)$, and want to fit this with a 2D Chebyshev
     516polynomial,
     517\begin{equation}
     518T(x,y) = \sum_{i,j} P_{i,j} T_i(x) T_j(y)
     519\end{equation}
     520where $T_i(x)$ is a Chebyshev polynomial in $x$ of order $i$
     521(\S\ref{sec:polynomials}).  Then we can calculate the coefficients,
     522$P_{i,j}$ by minimising $\chi^2$ in the standard manner:
     523
     524\begin{eqnarray}
     525\chi^2 & = & \sum_{x,y} \left[ \frac{z(x,y) - P_{i,j} T_i(x) T_j(y)}{\sigma_z(x,y)} \right] ^2 \\
     526\frac{\partial \chi^2}{\partial P_{k,l}} & = & -2 \sum_{x,y} \left[ \frac{z(x,y) - \sum_{i,j} P_{i,j} T_i(x) T_j(y)}{\sigma_z(x,y)} \right] \frac{T_k(x) T_l(y)}{\sigma_z(x,y)}
     527\end{eqnarray}
     528
     529Setting the partial derivative to zero and assuming that the errors
     530are approximately equal over the image (as is the case for background
     531fitting), $\sigma_z(x,y) = \sigma = {\rm const}$, then:
     532\begin{equation}
     533\sum_{x,y} z(x,y) T_k(x) T_l(y) = \sum_{i,j} \sum_{x,y} P_{i,j} T_i(x) T_j(y) T_k(x) T_l(y)
     534\end{equation}
     535Then we use the orthogonality property of Chebyshev polynomials, namely,
     536\begin{equation}
     537\sum_{x=0}^N T_i(x) T_j(x) = \begin{cases} 0 & i \ne j \\
     538N/2 & i=j \ne 0 \\
     539N & i=j=0 \\
     540\end{cases}
     541\end{equation}
     542
     543\begin{eqnarray}
     544\sum_{x,y} z(x,y) T_k(x) T_l(y) & = & \sum_{i,j} P_{i,j} (\delta_{ik} N_x/2 + \delta_{i0} N_x/2) (\delta_{jl} N_y/2 + \delta_{j0} N_y/2) \\
     545& = & ( P_{k,l} + P_{k,0} + P_{0,l} + P_{0,0} ) N_x N_y / 4
     546\end{eqnarray}
     547where $N_x$ and $N_y$ are the order of the polynomials in $x$ and $y$.
     548
     549Note that this is not a matrix equation, but simply requires a single pass
     550through the data to calculate each coefficient.
     551
    509552%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    510553
    511554\subsubsection{Polynomials}
     555\label{sec:polynomials}
    512556
    513557We will employ Chebyshev polynomials (NR \S 5.8) to approximate functions:
Note: See TracChangeset for help on using the changeset viewer.