Index: /trunk/doc/release.2015/ps1.calibration/calibration.tex
===================================================================
--- /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39833)
+++ /trunk/doc/release.2015/ps1.calibration/calibration.tex	(revision 39834)
@@ -194,4 +194,100 @@
 images.
 
+\section{Astrometric Model in PSASTRO} 
+
+\code{pasastro} loads the coordinates and calibrated magnitudes of
+stars from the reference database.  A model for the positions of the
+60 chips in the focal plane is used to determine the expected
+astrometry for each chip based on the boresite coordinates and
+position angle reported by the header.  Reference stars are selected
+from the full field of view of the GPC1 camera, padded by an
+additional \note{25\%} to ensure a match can be determined even in the
+presence of substantial errors in the boresite coordinates.  It is
+important to choose an appropriate set of reference stars: if too few
+are selected, the chance of finding a match between the reference and
+observed stars is diminished.  In addition, since stars are loaded in
+brightness order, a selection which is too small is likely to contain
+only stars which are saturated in the GPC1 images.  On the other hand,
+if too many reference stars are chosen, there is a higher chance of a
+false-positive match, especially as many of the reference stars may
+not be detected in the GPC1 image.  The seletion of the reference
+stars includes a limit on the brightest and fainted magnitude of the
+stars selected.
+
+Three somewhat distinct astrometric models are employed within the IPP
+at different stages.  The simplest model is defined independently for
+each chip: a simple TAN projection (Calabretta \& Griesen REF) is used
+to relate sky coordinates to a cartesian tangent-plane coordinate
+system.  \note{include projection math?}  A pair of low-order
+polynomials are used to relate the chip pixel coordinates to this
+tangent-plane coordinate system.  The transforming polynomials are of
+the form:
+\begin{eqnarray}
+P & = & \sum_{i,j} C^P_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
+Q & = & \sum_{i,j} C^Q_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
+\end{eqnarray}
+where $P,Q$ are the tangent plane coordinates, $X_{\rm chip}, Y_{\rm
+  chip}$ are the coordinates on the 60 GPC1 chips (\note{see
+  discussion somewhere on cell vs chip}), and $C^P_{i,j}, C^Q_{i,j}$
+are the polynomial coefficients for each order.  In the \code{psastro}
+analysis, $i + j <= N_{\rm order}$ where the order of the fit, $N_{\rm
+  order}$, may be 1 to 3, under the restriction that sufficient stars
+are needed to constraint the order \note{describe a bit better: this
+  is automatically selected based on the number of stars}.  
+
+A second form of astrometry model which yields somewhat higher
+accuracy consists of a set of connected solutions for all chips in a
+single exposure.  This model also uses a TAN projection to relate the
+sky coordinates to a locally cartesian tangent plane coordinate system.
+A set of polynomials is then used to relate the tangent plane
+coordinates to a 'focal plane' coordinate system, $L,M$:
+\begin{eqnarray}
+P & = & \sum_{i,j} C^P_{i,j} L^i M^j \\
+Q & = & \sum_{i,j} C^Q_{i,j} L^i M^j
+\end{eqnarray}
+This set of polynomial accounts for effects such as optical distortion
+in the camera and distortions due to changing atmospheric refraction
+across the field of the camera.  Since these effects are smooth across
+the field of the camera, a single pair of polynomials can be used for
+each exposure.  Like in the chip analysis about, the \code{psastro}
+code restricts the exponents with the rule $i + j <= N_{\rm order}$
+where the order of the fit, $N_{\rm order}$, may be 1 to 3, under the
+restriction that sufficient stars are needed to constraint the order
+\note{describe a bit better: this is automatically selected based on
+  the number of stars}.
+For each chip, a second set of polynomials describes the
+transformation from the chip coordinate systems to the focal
+coordinate system:
+\begin{eqnarray}
+L & = & \sum_{i,j} C^L_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
+M & = & \sum_{i,j} C^M_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
+\end{eqnarray}
+
+A third form of the astrometry model is used in the context of the
+calibration determined within the DVO database system.  We retain the
+two levels of transformations (chip $\rtarrow$ focal plane $\rtarrow$
+tangent plane), but the relationship between the chip and focal plane
+is represented with only the linear terms in the polynomial,
+supplemented by a course grid of displacements, $\delta L, \delta M$ sampled
+across the coordinate range
+of the chip.  This displacement grid may have a resolution of up to
+$6\times6$ samples across the chip.  The displacement for a specific
+chip coordinate value is determined via bilinear interpolation between
+the nearest sample points.  Thus, the chip to focal-plane
+transformation may be written as:
+\begin{eqnarray}
+L & = & C^L_{0,0} + C^L_{1,0} X_{\rm chip} + C^L_{0,1} Y_{\rm chip} + \delta L(X_{\rm chip}, Y_{\rm chip}) \\
+M & = & C^M_{0,0} + C^M_{1,0} X_{\rm chip} + C^M_{0,1} Y_{\rm chip} + \delta M(X_{\rm chip}, Y_{\rm chip}) \\
+\end{eqnarray}
+
+{\bf WCS Keywords} When this polynomial representation is written to
+the output files, a set of WCS keywords are used to define the
+astrometric transformation elements.  It is necessary to 
+\begin{eqnarray}
+P & = & \sum_{i,j} C^P_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j \\
+Q & = & \sum_{i,j} C^Q_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j 
+\end{eqnarray}
+where $X_0, Y_0$ is the reference pixel, represented in the header as 
+
 \section{Real-time Calibration}
 
@@ -223,66 +319,20 @@
 catalog.  \note{discuss history of the different refcats?}  
 
-{\bf Astrometric Model in PSASTRO} \code{pasastro} loads the
-coordinates and calibrated magnitudes of stars from the reference
-database.  A model for the positions of the 60 chips in the focal
-plane is used to determine the expected astrometry for each chip based
-on the boresite coordinates and position angle reported by the header.
-Reference stars are selected from the full field of view of the GPC1
-camera, padded by an additional \note{25\%} to ensure a match can be
-determined even in the presence of substantial errors in the boresite
-coordinates.  It is important to choose an appropriate set of
-reference stars: if too few are selected, the chance of finding a
-match between the reference and observed stars is diminished.  In
-addition, since stars are loaded in brightness order, a selection
-which is too small is likely to contain only stars which are saturated
-in the GPC1 images.  On the other hand, if too many reference stars
-are chosen, there is a higher chance of a false-positive match,
-especially as many of the reference stars may not be detected in the
-GPC1 image.  The seletion of the reference stars includes a limit on
-the brightest and fainted magnitude of the stars selected.  
-
-Three somewhat distinct astrometric models are employed within the IPP
-at different stages.  The simplest model is defined independently for
-each chip: a simple TAN projection (Calabretta \& Griesen REF) is used
-to relate sky coordinates to a cartesian tangent-plane coordinate
-system.  \note{include projection math?}  A pair of low-order
-polynomials are used to relate the chip pixel coordinates to this
-tangent-plane coordinate system.  The transforming polynomials are of
-the form:
-\begin{eqnarray}
-P & = & \sum_{i,j} C^P_{i,j} X^i_{\rm chip} Y^j_{\rm chip} \\
-Q & = & \sum_{i,j} C^Q_{i,j} X^i_{\rm chip} Y^j_{\rm chip}
-\end{eqnarray}
-where $P,Q$ are the tangent plane coordinates, $X_{\rm chip}, Y_{\rm
-  chip}$ are the coordinates on the 60 GPC1 chips (\note{see
-  discussion somewhere on cell vs chip}), and $C^P_{i,j}, C^Q_{i,j}$
-are the polynomial coefficients for each order.  In the \code{psastro}
-analysis, $i + j <= N_{\rm order}$ where the order of the fit, $N_{\rm
-  order}$, may be 1 to 3, under the restriction that sufficient stars
-are needed to constraint the order \note{describe a bit better: this
-  is automatically selected based on the number of stars}.  
-
-
-{\bf WCS Keywords} When this polynomial representation is written to
-the output files, a set of WCS keywords are used to define the
-astrometric transformation elements.  It is necessary to 
-\begin{eqnarray}
-P & = & \sum_{i,j} C^P_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j \\
-Q & = & \sum_{i,j} C^Q_{i,j} (X_{\rm chip} - X_0)^i (Y_{\rm chip} - Y_0)^j 
-\end{eqnarray}
-where $X_0, Y_0$ is the reference pixel, represented in the header as 
-
-
- are functions then related the The astrometric model u
-
 The astrometric analysis is necessarily performed first; after the
 astrometry is determined, an automatic byproduct is a reliable match
 between reference and observed stars, allowing a comparison of the
-magnitudes to determine the photometric calibration.  The astrometric
-calibration is performed in two major stages: first, the chips are
-fitted independently with a low-order model consisting 
-
-
-
+magnitudes to determine the photometric calibration.  
+
+The astrometric calibration is performed in two major stages: first,
+the chips are fitted independently with independent models for each
+chip.  This fit is sufficient to ensure a reliable match between
+reference stars and observed sources in the image.  Next, the set of
+chip calibrations are used to define the transformation between the
+focal plane coordinate system and the tangent plane coordinate
+system.  The chip-to-focal plane transformations are then determined
+under the single common focal plane to tangent plane transformation.  
+
+The first step of the analysis is to attempt to find the match between
+the reference stars and the detected objects.  \code{psastro} uses a 
 
 \code{smf} 
