Index: trunk/doc/release.2015/ps1.diffs/Makefile
===================================================================
--- trunk/doc/release.2015/ps1.diffs/Makefile	(revision 40694)
+++ trunk/doc/release.2015/ps1.diffs/Makefile	(revision 40695)
@@ -2,5 +2,5 @@
 
 DO_PDFLATEX = 1
-DO_BIBTEX = 1
+DO_BIBTEX = 0
 
 help:
@@ -17,12 +17,26 @@
 ../inputs/astro.sty \
 ../inputs/apj.bst \
+../inputs/code.sty \
 diffs.tex \
-references.bib \
-apj-jour.bib \
+diffs.bbl \
 figures/noise_model/variance.eps \
 figures/noise_model/covariance.eps \
 figures/stack/stack_image.eps \
 figures/all/kernel.eps \
-figures/all/sn2009kf.eps
+figures/all/sn2009kf.eps \
+figures/diff/stamps_mean.eps \
+figures/diff/stamps_rms.eps \
+figures/diff/kernel_x.eps \
+figures/diff/kernel_xx.eps \
+figures/diff/kernel_xy.eps \
+figures/diff/deconv_max.eps \
+figures/noise_model/input_phot.eps \
+figures/noise_model/warp_phot.eps \
+figures/noise_model/diff_phot.eps \
+figures/noise_model/stack_phot.eps \
+figures/stack/stack_conv_m_dm.eps \
+figures/stack/stack_unconv_m_dm.eps \
+figures/stack/stack_conv_hist.eps \
+figures/stack/stack_unconv_hist.eps 
 
 include ../Makefile.Common
@@ -30,2 +44,4 @@
 # submission : 
 # 	tar --transform 's%inputs/%%' -zcf waters2017.tgz $(FILES)
+
+detrend.tgz: $(FILES)
Index: trunk/doc/release.2015/ps1.diffs/diffs.tex
===================================================================
--- trunk/doc/release.2015/ps1.diffs/diffs.tex	(revision 40694)
+++ trunk/doc/release.2015/ps1.diffs/diffs.tex	(revision 40695)
@@ -63,11 +63,30 @@
 \section{Introduction}
 
-The age of synoptic surveys has come.  As optical (and other
-wavelength) telescopes are surveying ever increasing areas to ever
-fainter flux limits with multiple repeats, there is a growing interest
-in the study of transient phenomena.  This technological progress is
-well matched with the current scientific emphases on large samples of
-supernovae (SN), microlenses, asteroids, and other transients and
-variable sources.
+The past three decades have seen the increasing importance of
+time-domain surveys in astronomy.  These include asteroid searches
+such as the Lincoln Near-Earth Asteroid Research
+\citep[LINEAR][]{2000Icar..148...21S}, the Lowell Observatory
+Near-Earth Object Search \citep[LONEOS,][]{1995DPS....27.0110B}, the
+Catalina Sky Survey \citep{2003DPS....35.3604L}, and ATLAS
+\citep{2018PASP..130f4505T}; microlensing surveys such as MACHO
+\citep{1993ASPC...43..291A} and Optical Gravitational Lens Experiment
+\citep[OGLE,][]{1992AcA....42..253U}; and searches for supernovae and
+other transient sources such as ASAS-SN \citep{2014ApJ...788...48S}, the
+Palomar Transient Factory \citep[PTF,][]{2009PASP..121.1395L}, and the Robotic Optical
+Transient Search Experiment \citep[ROTSE-I,][]{2000ApJ...542..251A}.
+
+The Pan-STARRS Observatory \citep{chambers2017} has been a leader in
+the searches for both explosive transient / supernova and potentially
+hazardous asteroids.  According to the statistics maintained by David
+Bishop\footnote{http://www.rochesterastronomy.org/snimages/archives.html},
+since 2009, 40\% of all supernova have been discovered by
+Pan-STARRS\,1.  Similarly, 24\% of all Near Earth Objects (NEOs)
+discovered to date have been found by
+Pan-STARRS\footnote{https://cneos.jpl.nasa.gov/stats/site\_all.html}.
+Since 2014, when Pan-STARRS shifted its primary mission to the search
+for NEOs, this fraction has increased to 41\%. Both of these search
+programs use nightly observations to hunt for features which have
+changed, either between multiple images in a single night or between
+the current image and an archival reference image.
 
 PSF-matched image differencing\footnote{We eschew the popular term
@@ -88,5 +107,5 @@
 of the convolution kernel as a linear combination of basis functions,
 which allows the least-squares problem to be reduced to a matrix
-equation.  \citet{2000A&AS..144..363A} showed how this can be expanded
+equation.  \citet{2000AAS..144..363A} showed how this can be expanded
 to allow spatial variation of the kernel across the images.  Of
 course, the basis functions used for the kernel may be completely
@@ -137,5 +156,5 @@
 basis functions, $g_i(x,y) k_i(u,v)$, where the inclusion of
 $g_i(x,y)$ allows for spatial variation of the kernel.  In order to
-enforce conservation of flux \citep[following][]{2000A&AS..144..363A},
+enforce conservation of flux \citep[following][]{2000AAS..144..363A},
 we specify that all of the kernel basis functions have zero sum,
 $\sum_{u,v} k_i(u,v) = 0\ \forall i$.  This may be achieved by scaling
@@ -161,10 +180,10 @@
 $\chi^2$ between wide and narrow kernels.  Setting $c_i \equiv 0$ and
 $p_i \equiv 0$ reduces the above equation to the
-\citet{2000A&AS..144..363A} formalism, but with the normalisation
+\citet{2000AAS..144..363A} formalism, but with the normalisation
 ($b_0$) included explicitly.  In practise, the above sum will only be
 over small regions (known as ``stamps''), and if we assume that the
 spatial variation is not large, then we can simply use the coordinates
 of the stamp centres for the $g_i(x,y)$; this allows a faster
-calculation \citep{2000A&AS..144..363A}.
+calculation \citep{2000AAS..144..363A}.
 
 To simplify the equation, we write
@@ -199,5 +218,5 @@
 other special polynomial for the $f_i(x,y)$ and $g_i(x,y)$ is simple
 and convenient.  The kernel basis function sets of
-\citet{1998ApJ...503..325A} and \citet{2000A&AS..144..363A} are
+\citet{1998ApJ...503..325A} and \citet{2000AAS..144..363A} are
 \begin{equation}
 g_i(x,y) k_i'(u,v) = \psi_i x^\ell y^m u^p v^q \exp((u^2+v^2)/2s_i^2)
@@ -338,11 +357,13 @@
 \subsection{Stamps}
 
-The choice of stamps is key to successful PSF-matching --- the
-convolution kernel is only as good as the stamps used to construct it.
-We use a merged list of sources from photometry of the two input
-images as the basis of our stamps list.  Sources with a flag
-indicating that it is anything other than a pristine astrophysical
-source are excluded.  At the present time, we make no effort to select
-sources of a particular color or range of colors.
+Since we restrict the analysis of the kernel required for PSF matching
+to the small ``stamps'' centered on bright stars, the choice of stamps
+is key to successful PSF-matching.  The convolution kernel is only as
+good as the stamps used to construct it.  We use a merged list of
+sources from photometry of the two input images as the basis of our
+stamps list.  Sources with a flag indicating that it is anything other
+than a pristine astrophysical source are excluded.  At the present
+time, we make no effort to select sources of a particular color or
+range of colors.
 
 We exclude sources with any masked pixels that would affect the
@@ -490,5 +511,5 @@
 progressive software packages producing \citep[e.g.,
   SWarp:][]{2002ASPC..281..228B} and using \citep[e.g.,
-  SExtractor:][]{1996A&AS..117..393B} weight maps to characterise the
+  SExtractor:][]{1996AAS..117..393B} weight maps to characterise the
 noise over the image.  Because of simplicity and lower calculation
 cost relative to weights or standard deviations, we prefer to
@@ -993,5 +1014,6 @@
 \clearpage
 \bibliographystyle{apj}
-\bibliography{apj-jour,references}
+%\bibliography{apj-jour,references}
+\input{diffs.bbl}
 
 \end{document}
Index: trunk/doc/release.2015/ps1.diffs/references.bib
===================================================================
--- trunk/doc/release.2015/ps1.diffs/references.bib	(revision 40694)
+++ trunk/doc/release.2015/ps1.diffs/references.bib	(revision 40695)
@@ -1,4 +1,186 @@
 
-@ARTICLE{2000A&AS..144..363A,
+@ARTICLE{2000ApJ...542..251A,
+   author = {{Akerlof}, C. and {Balsano}, R. and {Barthelmy}, S. and {Bloch}, J. and 
+	{Butterworth}, P. and {Casperson}, D. and {Cline}, T. and {Fletcher}, S. and 
+	{Gisler}, G. and {Hills}, J. and {Kehoe}, R. and {Lee}, B. and 
+	{Marshall}, S. and {McKay}, T. and {Pawl}, A. and {Priedhorsky}, W. and 
+	{Seldomridge}, N. and {Szymanski}, J. and {Wren}, J.},
+    title = "{Rapid Optical Follow-up Observations of SGR Events with ROTSE-I}",
+  journal = {\apj},
+ keywords = {Gamma Rays: Bursts, Gamma Rays: Observations, pulsars: individual (SGR 1900+14, SGR 1806-20)},
+     year = 2000,
+    month = oct,
+   volume = 542,
+    pages = {251-256},
+      doi = {10.1086/309535},
+   adsurl = {http://adsabs.harvard.edu/abs/2000ApJ...542..251A},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@ARTICLE{2009PASP..121.1395L,
+   author = {{Law}, N.~M. and {Kulkarni}, S.~R. and {Dekany}, R.~G. and {Ofek}, E.~O. and 
+	{Quimby}, R.~M. and {Nugent}, P.~E. and {Surace}, J. and {Grillmair}, C.~C. and 
+	{Bloom}, J.~S. and {Kasliwal}, M.~M. and {Bildsten}, L. and 
+	{Brown}, T. and {Cenko}, S.~B. and {Ciardi}, D. and {Croner}, E. and 
+	{Djorgovski}, S.~G. and {van Eyken}, J. and {Filippenko}, A.~V. and 
+	{Fox}, D.~B. and {Gal-Yam}, A. and {Hale}, D. and {Hamam}, N. and 
+	{Helou}, G. and {Henning}, J. and {Howell}, D.~A. and {Jacobsen}, J. and 
+	{Laher}, R. and {Mattingly}, S. and {McKenna}, D. and {Pickles}, A. and 
+	{Poznanski}, D. and {Rahmer}, G. and {Rau}, A. and {Rosing}, W. and 
+	{Shara}, M. and {Smith}, R. and {Starr}, D. and {Sullivan}, M. and 
+	{Velur}, V. and {Walters}, R. and {Zolkower}, J.},
+    title = "{The Palomar Transient Factory: System Overview, Performance, and First Results}",
+  journal = {\pasp},
+archivePrefix = "arXiv",
+   eprint = {0906.5350},
+ primaryClass = "astro-ph.IM",
+     year = 2009,
+    month = dec,
+   volume = 121,
+    pages = {1395},
+      doi = {10.1086/648598},
+   adsurl = {http://adsabs.harvard.edu/abs/2009PASP..121.1395L},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@ARTICLE{2014ApJ...788...48S,
+   author = {{Shappee}, B.~J. and {Prieto}, J.~L. and {Grupe}, D. and {Kochanek}, C.~S. and 
+	{Stanek}, K.~Z. and {De Rosa}, G. and {Mathur}, S. and {Zu}, Y. and 
+	{Peterson}, B.~M. and {Pogge}, R.~W. and {Komossa}, S. and {Im}, M. and 
+	{Jencson}, J. and {Holoien}, T.~W.-S. and {Basu}, U. and {Beacom}, J.~F. and 
+	{Szczygie{\l}}, D.~M. and {Brimacombe}, J. and {Adams}, S. and 
+	{Campillay}, A. and {Choi}, C. and {Contreras}, C. and {Dietrich}, M. and 
+	{Dubberley}, M. and {Elphick}, M. and {Foale}, S. and {Giustini}, M. and 
+	{Gonzalez}, C. and {Hawkins}, E. and {Howell}, D.~A. and {Hsiao}, E.~Y. and 
+	{Koss}, M. and {Leighly}, K.~M. and {Morrell}, N. and {Mudd}, D. and 
+	{Mullins}, D. and {Nugent}, J.~M. and {Parrent}, J. and {Phillips}, M.~M. and 
+	{Pojmanski}, G. and {Rosing}, W. and {Ross}, R. and {Sand}, D. and 
+	{Terndrup}, D.~M. and {Valenti}, S. and {Walker}, Z. and {Yoon}, Y.
+	},
+    title = "{The Man behind the Curtain: X-Rays Drive the UV through NIR Variability in the 2013 Active Galactic Nucleus Outburst in NGC 2617}",
+  journal = {\apj},
+archivePrefix = "arXiv",
+   eprint = {1310.2241},
+ primaryClass = "astro-ph.HE",
+ keywords = {galaxies: active, galaxies: nuclei, galaxies: Seyfert, line: formation, line: profiles},
+     year = 2014,
+    month = jun,
+   volume = 788,
+      eid = {48},
+    pages = {48},
+      doi = {10.1088/0004-637X/788/1/48},
+   adsurl = {http://adsabs.harvard.edu/abs/2014ApJ...788...48S},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@ARTICLE{1992AcA....42..253U,
+   author = {{Udalski}, A. and {Szymanski}, M. and {Kaluzny}, J. and {Kubiak}, M. and 
+	{Mateo}, M.},
+    title = "{The Optical Gravitational Lensing Experiment}",
+  journal = {\actaa},
+ keywords = {Charge Coupled Devices, Galactic Bulge, Gravitational Lenses, Star Distribution, Statistical Analysis, Galactic Clusters, Galactic Halos, Variable Stars},
+     year = 1992,
+   volume = 42,
+    pages = {253-284},
+   adsurl = {http://adsabs.harvard.edu/abs/1992AcA....42..253U},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@INPROCEEDINGS{1993ASPC...43..291A,
+   author = {{Alcock}, C. and {Allsman}, R.~A. and {Axelrod}, T.~S. and {Bennett}, D.~P. and 
+	{Cook}, K.~H. and {Park}, H.~S. and {Marshall}, S.~L. and {Stubbs}, C.~W. and 
+	{Griest}, K. and {Perlmutter}, S. and {Sutherland}, W. and {Freeman}, K.~C. and 
+	{Peterson}, B.~A. and {Quinn}, P.~J. and {Rodgers}, A.~W.},
+    title = "{The MACHO Project - a Search for the Dark Matter in the Milky-Way}",
+booktitle = {Sky Surveys. Protostars to Protogalaxies},
+     year = 1993,
+   series = {Astronomical Society of the Pacific Conference Series},
+   volume = 43,
+   editor = {{Soifer}, B.~T.},
+    month = jan,
+    pages = {291},
+   adsurl = {http://adsabs.harvard.edu/abs/1993ASPC...43..291A},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@ARTICLE{2018PASP..130f4505T,
+   author = {{Tonry}, J.~L. and {Denneau}, L. and {Heinze}, A.~N. and {Stalder}, B. and 
+	{Smith}, K.~W. and {Smartt}, S.~J. and {Stubbs}, C.~W. and {Weiland}, H.~J. and 
+	{Rest}, A.},
+    title = "{ATLAS: A High-cadence All-sky Survey System}",
+  journal = {\pasp},
+archivePrefix = "arXiv",
+   eprint = {1802.00879},
+ primaryClass = "astro-ph.IM",
+     year = 2018,
+    month = jun,
+   volume = 130,
+   number = 6,
+    pages = {064505},
+      doi = {10.1088/1538-3873/aabadf},
+   adsurl = {http://adsabs.harvard.edu/abs/2018PASP..130f4505T},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@INPROCEEDINGS{2003DPS....35.3604L,
+   author = {{Larson}, S. and {Beshore}, E. and {Hill}, R. and {Christensen}, E. and 
+	{McLean}, D. and {Kolar}, S. and {McNaught}, R. and {Garradd}, G.
+	},
+    title = "{The CSS and SSS NEO surveys}",
+booktitle = {AAS/Division for Planetary Sciences Meeting Abstracts \#35},
+     year = 2003,
+   series = {Bulletin of the American Astronomical Society},
+   volume = 35,
+    month = may,
+      eid = {36.04},
+    pages = {982},
+   adsurl = {http://adsabs.harvard.edu/abs/2003DPS....35.3604L},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@INPROCEEDINGS{1995DPS....27.0110B,
+   author = {{Bowell}, E. and {Koehn}, B.~W. and {Howell}, S.~B. and {Hoffman}, M. and 
+	{Muinonen}, K.},
+    title = "{The Lowell Observatory Near-Earth-Object Search: A Progress Report}",
+booktitle = {AAS/Division for Planetary Sciences Meeting Abstracts \#27},
+     year = 1995,
+   series = {Bulletin of the American Astronomical Society},
+   volume = 27,
+    month = jun,
+      eid = {01.10},
+    pages = {1057},
+   adsurl = {http://adsabs.harvard.edu/abs/1995DPS....27.0110B},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@ARTICLE{2000Icar..148...21S,
+   author = {{Stokes}, G.~H. and {Evans}, J.~B. and {Viggh}, H.~E.~M. and 
+	{Shelly}, F.~C. and {Pearce}, E.~C.},
+    title = "{Lincoln Near-Earth Asteroid Program (LINEAR)}",
+  journal = {\icarus},
+     year = 2000,
+    month = nov,
+   volume = 148,
+    pages = {21-28},
+      doi = {10.1006/icar.2000.6493},
+   adsurl = {http://adsabs.harvard.edu/abs/2000Icar..148...21S},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+                  
+@ARTICLE{chambers2017,
+   author = {{Chambers}, K.~C. and {Magnier}, E.~A. and {Metcalfe}, N. and et al.},
+    title = "{IPP}",
+  journal = {ArXiv e-prints},
+archivePrefix = "arXiv",
+   eprint ={1612.05560},
+ primaryClass = "astro-ph.HE",
+ keywords = {Astrophysics},
+     year = 2017,
+    month = jan,
+   adsurl = {http://adsabs.harvard.edu/abs/2016arXiv160203842A},
+  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
+}
+
+@ARTICLE{2000AAS..144..363A,
    author = {{Alard}, C.},
     title = "{Image subtraction using a space-varying kernel}",
