
%\documentclass[panstarrs,psreport,12pt]{panstarrs}
\documentclass[panstarrs]{panstarrs}

% basic document variables
\title{PS1 Moving Object Processing System}
\subtitle{Trailed Object Fitting}
\author{Joseph Masiero, Eugene Magnier, Paul Price, Robert Jedicke}
\shorttitle{Trailed Objects}
\group{Pan-STARRS MOPS development group}
\project{PS1 MOPS}
\organization{Institute for Astronomy}
% \distribution{}
\version{00}
\docnumber{PSDC-500-008}
% note the use of the docnumber & version number:
% the complete PSDC document number is given by
% \thedocnumber-\theversion

\begin{document}
\maketitle

% -- Revision History --
\RevisionsStart
% version   Date         Description
DR        & 2006.10.04 & First draft \\
DR        & 2006.10.12 & Added initial comments from RJ \\
DR        & 2006.10.18 & edits for clarity \\
00        & 2006.10.20 & Added RJ comments \\
\RevisionsEnd

% -- TBD / TBR Listing --
%\TBDsStart
% section % page Date        Description
%1.2.3.4   & 2    & xxx-xxx & missing a dingle on a dangle \\
%\TBDsEnd

\pagebreak
\tableofcontents

\pagebreak
\listoffigures

\pagebreak 
\pagenumbering{arabic}
\section{Overview}
This document describes our method for fitting and measuring the properties
of trailed asteroid images.  Many of the Near-Earth Objects (NEOs) that will
be imaged by Pan-STARRS will have significant ($>1~$pixel, $>0.26''$)
apparent motions over the $30~$second exposure time of each image.  These
objects, instead of being point sources, will be imaged as trails moving
across the CCD.  While these trails provide information about the rate of
motion of the object, they also present a problem in extracting that
information in an automated manner using the PSF-fitting code that is being
developed by the Pan-STARRS Image Processing Pipeline (IPP).  In order to
accurately determine the orbit of a NEO that is trailed, we need to determine
the trail's center, length (and thereby rate of motion), angle (and thereby
direction of motion), and brightness (and thereby magnitude and even size
after assuming an albedo and calculating an orbit).  To do this, we have
developed an analytical description of a trailed asteroid, which the IPP's
{\tt psphot} code (PSDC-430-021-00, Magnier et al.) will use as its model for
fitting non-point sources in the Pan-STARRS difference images.  Because these
images will have had the static sky removed, the only sources remaining will
be point-source transients, non-point source transients, cosmic rays, and
other noise.  Once cosmic ray removal routines have been run on the image (or
once transients not seen in multiple images have been removed, in the case of
PS4), and Point Spread Function (PSF) fitters have been applied to the
images, only trailed asteroids and comets will remain.  Comet fitting
routines are discussed in PSDC-5xx-xxx (Kleyna, et al).

In order to test the effectiveness and efficiency of our trailed object
fitting routine, we have developed a synthetic trail generator that can
create artificial trails at any flux, length, orientation and position within
an image.  We then applied our fitting model to these synthetic trails.  The
results of these tests are described below along with a discussion of the
problems they have illuminated.


\section{Synthetic Trail Generation}
\label{trailgen}

The Pan-STARRS Moving Object Processing System (MOPS) incorporates
self-testing procedures involving the creation and subsequent blind analysis
of synthetic detections as described in PSDC-5xx-xxx (Jedicke et al).
Because MOPS will not access the images directly, but rather only the
detection lists provided by the IPP, it is important to know the detection
efficiency for trailed objects, as well as the typical errors on derived
quantities such as flux, length, angle of motion, and center position.  In
order to determine these errors and efficiencies for our analytical model, a
set of images of trailed objects with known parameters is required.  Thus,
synthetic trails were inserted into test images from the Canada-France-Hawaii
Telescope (CFHT)/MegaCam.  These images were originally obtained as a proxy
for the pixel size, exposure time and filter for PS1 images.  In addition,
MegaCam's Elixir image processing system (Magnier \& Cuillandre, 2004) is
similar to the preliminary steps of PS1's IPP, meaning that Elixir-processed
MegaCam images are at a similar stage in processing as PS1 images will be
just before the IPP PSF fitter is applied.

We generated our synthetic trailed objects by inserting a large number of
individual ``sub-PSFs'' along the line of motion at $0.2~$pixel ($0.074''$)
spacing to build up a trail.  The ``sub-PSFs'' spacing size was chosen to
ensure a smooth final trail without bogging down the generation code due to
excessive numbers of iterations.  In principle, anything with motions greater
than $\sim0.5~$pixels per image ($\sim16.7~$arcsec/hr or $\sim0.11~$deg/day)
should be detectable however in practice it is difficult to distinguish
between motions of this magnitude and slight variations in object PSF.

Each ``sub-PSF'' is a Gaussian ellipsoid, where the major axis was matched to
the assumed-circular PSF measured for stars in the field, and the minor axis
had a value of $90\%$ that of the major axis.  This was done to model real
images which will often not have perfectly circular PSFs.  The ``sub-PSFs''
were then co-added to create a smooth trail.  Poisson noise was added to the
counts on each pixel and the trail was inserted into the image with a random:

\begin{itemize}
\item location of trail center
\item 'stationary' $g'$ magnitude between $13$ and $20$~mag
\item orientation
\item rate of motion between ($0~-~10$~deg/day)
\end{itemize}

Trail positions were generated without regard to chip gaps, bad columns,
stars, or other image features.  Fig~\ref{fig.strail} shows an example
of one of our synthetic trails near the edge of a chip.

\section{Analytical Trail Model}
\label{model}

We developed an analytical model to fit both synthetic and real trailed
objects with a line minimization (LM) $\chi^2$ minimizer (PSDC 430-012, Price
\& Magnier, based on Press et al., 2002).  Although the most appropriate
model is a convolution of the fitted PSF with a line of the desired length
and orientation, this method is computationally intensive making the run-time
prohibitive.  Additionally, calculating the analytical derivatives of such a
function would exceed the scope and needs of this project.

We have chosen instead to represent our trailed objects with a piecewise
function consisting of $3^{rd}$ order Gaussian approximations, creating a
one-dimensional ``pipe'' with two-dimensional ``endcaps'', as illustrated by
a wire diagram in Fig~\ref{fig.wire}.  First we define a new coordinate
system $\left(x',~y'\right)$, where the $x'$ axis runs along the trailed
object's line of motion, and $y'$ runs perpendicular to the line of motion,
and the location $\left(x',~y'\right)=\left(0,~0\right)$ is the derived
center of the trail $\left(x,~y\right)=\left(x_0,y_0\right)$.  Beyond a
half-length in both the $+x'$ and $-x'$ directions, we follow the derived
stellar PSF exactly.  Between these two points we use a constant brightness
line along the $x'$ axis with $3^{rd}$ order Gaussian falloff along the $y'$
axis, matching the FWHM of the derived stellar PSF at that orientation.

The flux $F$ at any given pixel $(x_1,y_1)$, defined below, will just be the
local sky background ($F_{sky}$) plus the contribution from the trail which
is just the peak flux of the trail ($F_{peak}$) times the third-order
Gaussian falloff.  This falloff will depend on the sigma-weighted distance
$z$.

The derived parameters of the equations are: $F_{peak}$, the pixel-coordinate
location of the trail center $\left(x,~y\right)=\left(x_0,~y_0\right)$, the
length of the trail $l$, and the angle with respect to the positive pixel
x-axis $\theta$.

The equations used for this model are:

\begin{eqnarray}
      F(x_1,y_1) & = & F_{peak}~\left(1+z+\frac{z^2}{2}+\frac{z^3}{6}\right)^{-1} + F_{sky}\\
      z & = & \frac{x_1^2}{2~\sigma_x^2} + \frac{y_1^2}{2~\sigma_y^2} + \sigma_{xy}~x_1~y_1
\end{eqnarray}

where $\sigma_x$, $\sigma_y$, and $\sigma_{xy}$ are the ellipsoidal PSF shape
parameters in the unrotated frame.

We use $x_1$ and $y_1$ as the pixel locations with respect to a ``reference
point'' $\left(x'_r,~y'_r\right)$ to determine the Gaussian falloff.  For the
central ``pipe'' region of the trail, the ``reference point'' is the nearest
point on the line of motion ($x'_r=x'$, $y'_r=0$), and thus the falloff only
depends on the distance in the $y'$ direction.  For the endcap regions, the
``reference point'' is the end of the line of motion ($x'_r=\pm~l/2$,
$y'_r=0$), creating a two-dimensional third-order Gaussian falloff beyond the
limits of the object's motion.  We can write the equations for $x_1$ and
$y_1$ as a function of the trail's length ($l$) and orientation ($\theta$) as
follows:

\begin{itemize}
\item for $x' > \frac{l}{2}$:
\begin{eqnarray}
      x_1 & = & \left(x'-\frac{l}{2}\right)~\cos\theta - y'~\sin\theta\\
      y_1 & = & \left(x'-\frac{l}{2}\right)~\sin\theta + y'~\cos\theta
\end{eqnarray}
\item for $x' < -\frac{l}{2}$:
\begin{eqnarray}
      x_1 & = & \left(x'+\frac{l}{2}\right)~\cos\theta - y'~\sin\theta\\
      y_1 & = & \left(x'+\frac{l}{2}\right)~\sin\theta + y'~\cos\theta
\end{eqnarray}
\item for $\frac{l}{2} \ge x' \ge  -\frac{l}{2}$:
\begin{eqnarray}
      x_1 & = & -y'~\sin\theta\\
      y_1 & = & y'~\cos\theta
\end{eqnarray}
\end{itemize}

The LM minimizer also requires the derivative of the model with respect to
all variables.  The derivatives are:

\begin{eqnarray}
	\frac{dF}{dF_{sky}} & = & 1\\
        \frac{dF}{dF_{peak}} & = & \left(1+z+\frac{z^2}{2}+\frac{z^3}{6}\right)^{-1}
\end{eqnarray}

and letting $q =
F_{peak}~\left(1+z+\frac{z^2}{2}+\frac{z^3}{6}\right)^{-2}~\left(1+z+\frac{z^2}{2}\right)$,
and defining $S_x = \frac{1}{\sigma_x}$, $S_y = \frac{1}{\sigma_y}$, and
$S_{xy} = \sigma_{xy}$:

\begin{itemize}
\item for $x' > \frac{l}{2}$:
\begin{eqnarray}
	  \frac{dF}{dx_0} & = & q~\left(S_x^2~x_1 + S_{xy}~y_1\right)\\
	  \frac{dF}{dy_0} & = & q~\left(S_y^2~y_1 + S_{xy}~x_1\right)\\
	  \frac{dF}{dS_x} & = & -q~S_x~x_1^2\\
	  \frac{dF}{dS_y} & = & -q~S_y~y_1^2\\
	  \frac{dF}{dS_{xy}} & = & -q~x_1~y_1\\
	  \frac{dF}{dl} & = & q~\left(S_x^2~x_1~\frac{\cos\theta}{2} + S_y^2~y_1~\frac{\sin\theta}{2} + S_{xy}~x_1~\frac{\sin\theta}{.}+ S_{xy}~y_1~\frac{\cos\theta}{2}\right)\\
	  \frac{dF}{d\theta} & = & -q~\left(S_x^2~x_1~\frac{l}{2}~\sin\theta - S_y^2~y_1~\frac{l}{2}~\cos\theta - S_{xy}~x_1~\frac{l}{2}~\cos\theta + S_{xy}~y_1~\frac{l}{2}~\sin\theta\right)
\end{eqnarray}
\item for $x' < -\frac{l}{2}$:
\begin{eqnarray}
	  \frac{dF}{dx_0} & = & q~\left(S_x^2~x_1 + S_{xy}~y_1\right)\\
	  \frac{dF}{dy_0} & = & q~\left(S_y^2~y_1 + S_{xy}~x_1\right)\\
	  \frac{dF}{dS_x} & = & -q~S_x~x_1^2\\
	  \frac{dF}{dS_y} & = & -q~S_y~y_1^2\\
	  \frac{dF}{dS_{xy}} & = & -q~x_1~y_1\\
	  \frac{dF}{dl} & = & -q~\left(S_x^2~x_1~\frac{\cos\theta}{2} + S_y^2~y_1~\frac{\sin\theta}{2} + S_{xy}~x_1~\frac{\sin\theta}{2} + S_{xy}~y_1~\frac{\cos\theta}{2}\right)\\
	  \frac{dF}{d\theta} & = & -q~\left(-S_x^2~x_1~\frac{l}{2}~\sin\theta + S_y^2~y_1~\frac{l}{2}~\cos\theta + S_{xy}~x_1~\frac{l}{2}~\cos\theta - S_{xy}~y_1~\frac{l}{2}~\sin\theta\right)
\end{eqnarray}
\item for $\frac{l}{2} \ge x' \ge  -\frac{l}{2}$:
\begin{eqnarray}
	  \frac{dF}{dx_0} & = & q~\sin\theta~\left(S_x^2~\sin\theta~x_1 - S_y^2~y_1~\cos\theta - S_{xy}~x_1~\cos\theta + S_{xy}~y_1~\sin\theta\right)\\
	  \frac{dF}{dy_0} & = & q~\cos\theta~\left(-S_x^2~x_1~\sin\theta + S_y^2~\cos\theta~y_1 + S_{xy}~x_1~\cos\theta - S_{xy}~y_1~\sin\theta\right)\\
	  \frac{dF}{dS_x} & = & -q~S_x~x_1^2\\
	  \frac{dF}{dS_y} & = & -q~S_y~y_1^2\\
	  \frac{dF}{dS_{xy}} & = & -q~x_1~y_1\\
	  \frac{dF}{dl} & = & 0\\
	  \frac{dF}{d\theta} & = & -q~(S_x^2~x_1~\left(x'~\sin\theta - y'~\cos\theta\right) + S_y^2~y_1~\left(x'~\cos\theta - y'~\sin\theta\right) + \nonumber \\
	& & S_{xy}~x_1~\left(x'~\cos\theta - y'~\sin\theta\right) + S_{xy}~y_1~\left(x'~\sin\theta - y'~\cos\theta\right))
\end{eqnarray}
\end{itemize}

The $S_x = \frac{1}{\sigma_x}$, $S_y = \frac{1}{\sigma_y}$, and $S_{xy} =
\sigma_{xy}$ values are determined by a prior PSF-fitting stage and passed to
the trail fitting code.  The IPP determines median values for the PSF
parameters for all the stellar-like detections in the image and returns those
parameters as a function of position in the field.  $F_{sky}$ is likewise
calculated during an earlier stage of image processing.

We have also developed a model that will simultaneously fit the circular PSF
parameters of a trail in addition to the parameters mentioned above.  This
method is convenient for testing this model independent from the rest of the
source fitting process.  However, when fitting both the trail parameters and
the ellipsoid PSF parameters we find that the number of free parameters
causes a steep degradation in fit quality.  Thus, it is not recommended to
attempt to fit the trail and two-dimensional PSF parameters in a single
stage, but rather first fit the PSF parameters to the point sources alone,
and then fit the trail parameters knowing the PSF parameters.  This is only
possible when our trail model is fully integrated in the fitting routine.

\section{Trail Identification Efficiency and Fitting Accuracy}
\label{eff}

To test the efficiency of our trail-fitting routines, we first inserted our
synthetic trails randomly into CFHT/MegaCam images.  These images were
obtained with the $g'$ filter with $40$ second exposures, and binned
$2\times2$ yielding an effective pixel scale of $0.37''$ (PS1's pixel scale
is $0.29''$).  This was all done to mimic as closely as possible the proposed
PS4 Solar System images.  Originally, these data were acquired to measure the
sky-plane density of asteroids in the Main Belt that could be observed with
Pan-STARRS near opposition and in the 'sweet spots' (regions near the
ecliptic and with solar elongation between $60^\circ$ and $90^\circ$).  Due
to the similarities in the both the method of taking the data and the basic
processing, these images can act as good proxies for actual PS1/PS4 data.

After synthetic trail generation (\S~\ref{trailgen}) we ran the IPP source
detection routine {\tt psphot} on the images to fit all PSF-like objects with
a 2-dimensional third-order approximation to a Gaussian.  The trail model
(\S~\ref{model}) was then fit to all non-PSF source in the field.  Note that
because there were galaxies in our image, not everything that was passed to
our routine was a trail.  To determine the efficiency of our routine we
extracted the fitted parameters for any derived trail that had a center point
within $10$ pixels ($3.7~$arcsec) of a generated trail.  An
arbitrary cut of $2$ pixels ($0.74~$arcsec) was applied to attempt to select
more likely matches.  Derived objects within $10$ pixels of a synthetic trail
center are marked in the following plots with red points while those within $2$
pixels are marked in black.  In the following text we will refer to these as
``wide'' and ``tight'' fits, respectively.  The distinction between the wide
and tight fits is caused by trails that are only partially fit, e.g. those
broken by stars, bad columns, or noise.  This will show offsets in length and
pixel center, but should show the correct derived angle, as described below.

One of the problems with the automated matching process described above is
that there was no visual inspection to determine the veracity of the derived
trail, i.e. there is the possibility that non-trailed (background or noise)
sources are entering our results.  This would have the effect of artificially
increasing the trail fitting efficiency.  However, these false detections
would be expected to have random derived lengths and angles which would
increase the RMS of the fit quality of those values.  It is possible to
perform a multi-dimensional cut on the false detections based on length,
angle and magnitude, but as we will see below, each of these parameters are
not yet well determined.  Figure~\ref{fig.xyhist} shows that even without
more stringent cuts, most of the derived trails are within $0.1~$pixels
($0.037~$arcsec) so the biasing of efficiency or RMS values due to a
mis-matching can be ignored.

We began our analysis by looking at the number of generated synthetic trails
that were derived as either wide or tight fits by our algorithm.  We find
that our model is applied to only $\sim50\%$ of the generated trails brighter
than a 'stationary' magnitude of $g'=17$ with a significant decrease at
larger magnitudes (see Figs~\ref{fig.maghist}\&\ref{fig.mageff}).  We traced
the source of this low efficiency to the routine within the {\tt psphot} code
that determines which model should be used to fit each source.  When {\tt
psphot} is run on an image it first finds all groups of pixels that are
collectively above the background noise by at least $3\sigma$.  It then tries
to determine whether the source is a point, an extended source, or a ``bad''
source (e.g. cosmic ray, hot pixel, diffraction spike).  The code then runs
the PSF fitting routine on the point sources, next applies the extended
source model to all the extended sources, and finally files the ``bad''
sources away in a separate output file.  Some trails ($\sim50\%$) present
problems for the code's initial type determination which results in the
source not being fit at all - neither as a PSF nor an extended source and not
being categorized as ``bad'' either.  The majority of missed synthetic trails
fall into this category, while a smaller fraction of the total number (though
a larger relative fraction of the slow moving trails) are fit as PSFs instead
of extended sources.  This is because their slow motions make them
indistinguishable from point sources.

For those derived trails that were tight fits, we determine the RMS of the
scatter in pixel location to be $0.17~$pixels ($0.063''$) from the center of
the generated trail to the center of the derived trail.  A scatter plot of
the difference in location centers is shown in Fig~\ref{fig.xy}, with the
dotted line describing the cut between the tight fits and the wide fits.

There are two features of concern in the comparison between generated and
derived trail length in Fig~\ref{fig.length}.  The first is the
$\sim3.9~$pixel offset between the dotted line marking a one-to-one relation
and the apparent linear trend of the data points - the derived trail length
is almost always less than the actual trail length.  The second is the
distinction between wide and tight fits, especially at longer trail lengths,
with the length of the wide fits being far more poorly determined than for
the tight fits.

When looking more closely at the first problem, we find that the observed
offset in the the linear trend changes as the generated FWHM of the trail
changes, where a smaller FWHM causes a smaller offset.  This can be corrected
by adjusting the model that is fit to the trails, though the changes that
need to be made are currently being investigated.  After artificially
removing the offset in the generated-to-derived comparison we find an RMS
scatter of $1.8~$pixels ($0.67~$arcsec) in the tight fits.  The second
problem is much more difficult to deal with, as it requires a fitting routine
that is not susceptible to discontinuities in the object being fit, which
involves developing a smarter initial object identifier.

We see a much tighter correlation in the relation between derived and
generated angle of motion as shown in Fig~\ref{fig.theta}.  There are some
randomly scattered points, but this is unrelated to whether the derived
trails were tight or wide fits.  In fact, many of the wide fits have
reasonably accurate derived angles, as predicted above.  Much of the scatter
can be explained by trails with very short lengths, and thus ambiguous
angles.  As trails become longer the derived angle accuracy improves.  We
find an RMS scatter in angle of motion of $6.3^\circ$ for the tight fits when
looking across all trail lengths.  For trails with motions
$5\le~\omega~\le10~$deg/day, c.f. Fig~\ref{fig.thetalong}, we find an RMS
scatter of $1.4^\circ$ for the same fits.  There are a few points with very
large errors ($\sim180^\circ$) near the $-90^\circ$ and $+90^\circ$ extrema
but this is to be expected as angles near these values are nearly identical.
To prevent these small number of large-error points from dominating the
calculated value, the RMS was calculated with the difference between the
determined angle and either the generated angle or the generated angle$+180$,
whichever was smaller.  Fig~\ref{fig.tloff} shows the difference between
generated and fitted angles as a function of the rate of motion of the
synthetic object.  As trails get shorter, the error in the angle fitting
increases, as is expected.

The derived trail magnitudes were corrected for the $26.28~$mag zero-point,
as provided by the MegaCam Elixir system (Magnier \& Cuillandre, 2004).
Fig~\ref{fig.mag} shows a comparison between the generated and derived trail
magnitudes.  There is significant scatter but no apparent pattern other than
that the wide fits show much fainter derived magnitudes than the tight ones,
as would be expected if they were only partial fits of the trail length.
However, comparing the difference in generated and derived magnitudes as a
function of length as shown in Fig~\ref{fig.mloff}, we see an interesting and
worrying trend.  As the generated trail length increases, the fitter returns
larger (dimmer) magnitudes for the objects than were generated.  As the trail
length goes to zero the derived magnitudes are brighter than the generated
ones.  The latter problem may be due to incorrect trail generation techniques
(under investigation), or could be due to the same effect that is causing the
underestimation at longer trail lengths (also under investigation).

\section{Summary}

We have developed an analytical model representing the image of a trailed
asteroid that will be incorporated into the Pan-STARRS IPP.  This model will
be fit to candidate trailed sources in the Pan-STARRS images in order to
extract information about the position and motion of nearby objects.  These
data will aid in orbit identification and recovery of the object.
Application of our analytical trailed asteroid model to synthetic trails has
illuminated areas that need to be improved, but has also shown that we are
close to developing a useful technique.

Many issues need to be resolved before the trail fitting is operation,
including:
\begin{itemize}
\item The offset between the generated and derived lengths
\item The difference between generated and derived magnitudes, especially as a function of length
\item The passing of only $\sim50\%$ of the observed trailed objects to the fitting routine
\item The fitting of parts of trails instead of the full trail
\end{itemize}

The first two issues are errors related to the way the trails are modeled,
and can likely be corrected with simple changes to the trail model.  The
latter two problems are more difficult to fix as they are problems inherent
to the core {\tt psphot} code.  Still, as {\tt psphot} is undergoing
continuous upgrades by the IPP, these issues may be solved by future
releases.

Despite the areas that require investigation, the accuracy of the trailed
objects that are fit indicates that our model and this method of fitting will
be effective for determining the location and motion of NEOs and other
swiftly moving objects.

\bibliographystyle{plain}
\begin{center}
{\bf Bibliography}
\end{center}
%Bertin, E. \& Arnouts, S., 1996, A\&AS, 117, 393.

Jedicke, R., et al., 2006, MOPS Efficiency Design, PSDC-5xx-xxx

Kleyna, J.~T., et al., 2006, MOPS Comet Fitting, PSDC-5xx-xxx

Magnier, E.~A. \& Cuillandre, J.~C., 2004, PASP, 116, 449.

Magnier, E.~A., Price, P.~A., Lupton, R.~H. \& Hoblitt, J., 2006, Pan-STARRS PS-1 IPP Library Supplementary Design Requirements Specification, PSDC-430-007

Magnier, E.~A., et al., 2006, Pan-STARRS PS1 IPP PSPhot Software Design Description, PSDC-430-021

Press, W.~H., Teukolsky, S.~A., Vetterling, W.~T. \& Flannery, B.~P., 2002, Numerical Recipes, Cambridge University Press.

Price, P.~A. \& Magnier, E.~A., 2006, Pan-STARRS PS1 IPP Modules Supplementary Design Requirements Specification, PSDC-430-012

%\bibitem [Masiero et~al.(2006)]{SPD} 
%Masiero, J.~R., Jedicke, R., Price, P.~A., Kubica, J., \& Heasley, J.~N., 2006, in prep.


%\bibliography{panstarrs}


\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.5]{trail.jpg} 
\end{center}
\protect\caption{An example of a synthetic trail generated by our code.  The
green axes show the directions defined as ``x'' and ``y'', and the red arrows
indicate the synthetic trail that has a 'stationary' $g'$ magnitude of
$18.96~$mag, angle of motion of $29.62^\circ$ counter-clockwise from the
x-axis, and rate of motion of $4.53~$deg/day.  }
\label{fig.strail}
\end{figure}
\clearpage

\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=1]{wirestrail.jpg}  
\end{center}
\protect\caption{A wire diagram of the analytical model used to fit trailed
objects.  The x and y axes (denoted in Fig~1) are indicated, as are the $x'$
and $y'$ axes which are rotated by angle $\theta$ to line up with the trail's
direction of motion.  }
\label{fig.wire}
\end{figure}
\clearpage

\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailHistxy.jpg}  
\end{center}
\protect\caption{Distance between derived and generated center points for
synthetic trails.  }
\label{fig.xyhist}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailHistmag.jpg}  
\end{center}
\protect\caption{Magnitudes of generated (dashed) and found (solid) trails
for all trail lengths.  It is currently unclear why the efficiency peaks at
$\sim15.5~$mag.  }
\label{fig.maghist}
\end{figure}
\clearpage


\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailHistmageff.jpg}  
\end{center}
\protect\caption{Trail fitting efficiency (derived/generated) vs magnitude.
}
\label{fig.mageff}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailCompxy.jpg}  
\end{center}
\protect\caption{Differences in x and y positions between the generated and
derived synthetic trails.  The black points are defined as derived trails
that were less than $2$ pixels ($0.74~$arcsec) away from the generated trail
center (inside the inner dotted-line circle) while the red points are defined
as derived trails between $2$ and $10$ pixels ($0.74$ and $3.7~$arcsec) away
from the generated trail center.  }
\label{fig.xy}
\end{figure}
\clearpage


\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailComplength.jpg}  
\end{center}
\protect\caption{Generated trail length vs. derived length.  The red points
indicate trails with large offset in derived center position.  }
\label{fig.length}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailComptheta.jpg}  
\end{center}
\protect\caption{Generated angle (with respect to the pixel x axis)
vs. derived angle.  }
\label{fig.theta}
\end{figure}
\clearpage

\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailLongtheta.jpg}  
\end{center}
\protect\caption{Generated angle (with respect to the pixel x axis)
vs. derived angle for trails with lengths between $5$ and $10$ degrees per
day.  }
\label{fig.thetalong}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailComptloff.jpg}  
\end{center}
\protect\caption{The scatter in derived angle vs. the rate of motion of the
generated trail.  Red points are those that show significant differences in
derived center points.  }
\label{fig.tloff}
\end{figure}
\clearpage

\newpage
\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailCompmag.jpg}  
\end{center}
\protect\caption{Generated magnitude vs. derived magnitude.  The derived
magnitude has been shifted by the $28.26$ magnitude Elixir-calculated
zero-point.  }
\label{fig.mag}
\end{figure}

\begin{figure}
\begin{center}
\includegraphics[scale=0.4]{strailCompmloff.jpg}  
\end{center}
\protect\caption{The offset in derived magnitude vs. the generated
length of the trail.  A negative value on the y-axis implies an object fitted
to a fainter flux level than was generated.  }
\label{fig.mloff}
\end{figure}
\clearpage


\end{document}

