Index: /branches/pap/doc/latex/panstarrs.cls
===================================================================
--- /branches/pap/doc/latex/panstarrs.cls	(revision 25845)
+++ /branches/pap/doc/latex/panstarrs.cls	(revision 25845)
@@ -0,0 +1,262 @@
+%%
+%% This is file `panstarrs.cls'
+%%
+%% Derived from milstd498.cls by William DeMeo @ MHPCC
+%% Eugene Magnier, 2003.12.15
+%%
+%% Example usage:
+%%
+%% \documentclass[panstarrs]{panstarrs}
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesClass{panstarrs}[2003/06/29 LaTeX class for PanSTARRS]
+\LoadClass[12pt]{article}
+\RequirePackage{tocloft,ifthen,fancyhdr,vmargin}
+\RequirePackage{hyperref,times,amsmath,amssymb}
+\RequirePackage{color,fullpage,boxedminipage,acronym,epsfig}
+
+% -- panstarrs definitions--
+\DeclareOption{panstarrs}{\input{panstarrs.def}}
+
+% -- page layout options --
+\addtolength{\parskip}{+0.1in}
+\setlength{\parindent}{0in}
+\hoffset =-0.5in
+\topmargin=0in
+\oddsidemargin=0in
+\evensidemargin=0in
+\voffset=-0.5in
+\textheight=9.0in
+\textwidth=7.35in
+\headheight=12pt
+\headsep = 24pt
+\footskip=30pt
+
+\font\fontA=phvr at 18pt
+\font\fontB=phvr at 12pt
+
+\addtolength{\cftfignumwidth}{2em}
+
+% -- section numbering --
+\let\@section=\section \let\@subsection=\subsection
+\let\@subsubsection=\subsubsection
+\def\section{\renewcommand{\thefigure}{\thesection -\arabic{figure}} \setcounter{figure}{0} \@section}
+\def\subsection{\renewcommand{\thefigure}{\thesubsection -\arabic{figure}} \setcounter{figure}{0} \@subsection}
+\def\subsubsection{\renewcommand{\thefigure}{\thesubsubsection -\arabic{figure}} \setcounter{figure}{0} \@subsubsection}
+\def\paragraph{\@startsection{paragraph}{4}{\z@}%
+  {-3.5ex\@plus -1ex \@minus -.2ex}%
+  {1.5ex \@plus .2ex}%
+  {\normalsize\bf}}
+\def\subparagraph{\@startsection{subparagraph}{5}{\z@}%
+  {-3.5ex\@plus -1ex \@minus -.2ex}%
+  {1.5ex \@plus .2ex}%
+  {\normalsize\bf}}
+\def\subsubparagraph{\@startsection{subsubparagraph}{6}{\z@}%
+  {-3.5ex\@plus -1ex \@minus -.2ex}%
+  {1.5ex \@plus .2ex}%
+  {\normalsize\it}}
+\let\subsubsubsection=\paragraph
+
+% -- section display --
+\setcounter{secnumdepth}{4} % lowest level at which counters are displayed
+\setcounter{tocdepth}{3} % lowest level to be included in toc
+
+% -- basic document labels --
+\newcommand\thedocnumber{PSDC-xxx-xxx} 
+\newcommand\thegroup{panstarrs group}
+\newcommand\theorganization{Institute for Astronomy} 
+\newcommand\theshorttitle{short title} 
+\newcommand\theversion{xx} 
+\newcommand\theproject{panstarrs project} 
+\newcommand\thesubtitle{} 
+\newcommand\thedistribution{Approved for Public Release -- Distribution is Unlimited}
+
+\newcommand{\docnumber}[1]{\renewcommand\thedocnumber{#1} }
+\newcommand{\group}[1]{ \renewcommand\thegroup{#1} }
+\newcommand{\organization}[1]{ \renewcommand\theorganization{#1} }
+\newcommand{\shorttitle}[1]{ \renewcommand\theshorttitle{#1} }
+\newcommand{\version}[1]{ \renewcommand\theversion{#1} }
+\newcommand{\project}[1]{ \renewcommand\theproject{#1} }
+\newcommand{\subtitle}[1]{ \renewcommand\thesubtitle{#1} }
+\newcommand{\distribution}[1]{ \renewcommand\thedistribution{#1} }
+
+% -- MAKETITLE --
+\def\maketitle{
+   \fancyhead{}
+   \fancyhead[L]{\theproject}
+   \fancyhead[R]{\thedocnumber-\theversion}
+   \fancyfoot[L]{\theshorttitle}
+   \fancyfoot[R]{\today}
+   \par
+   \begingroup
+   \newpage
+   \global\@topnum\z@        % Prevents figures from going at top of page.
+   \@maketitle
+   \endgroup
+   \let\maketitle\relax
+   \let\@maketitle\relax
+   \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax
+   \pagestyle{fancy}
+}
+
+\def\@maketitle{
+  \pagenumbering{roman} 
+  \thispagestyle{empty} 
+  \unitlength 1.0in
+  \begin{picture}(0.0,0.0)(0.0,9.375)
+  \small
+
+  \put (7.50, 9.85){\makebox(0,0)[br]{\small      {\bf Pan-STARRS Document Control}}}
+  \put (7.50, 9.70){\makebox(0,0)[br]{\small      {\bf \thedocnumber-\theversion}}}
+
+  \put (4.006, 8.30){\line(1,0){0.1}} % put the macron on Manoa
+  \put (0.50, 8.10){\makebox(0,0)[bl]{\fontA UNIVERSITY OF HAWAII AT MANOA}}
+  \put (0.50, 7.88){\makebox(0,0)[bl]{\fontB Institute for Astrononmy}}
+
+  \put (0.50, 7.83){\line(1,0){6.5}}
+  \put (0.50, 7.63){\makebox(0,0)[bl]{\small      {\bf Pan-STARRS Project Management System}}}
+
+  \put (3.75, 5.25){\makebox(0,0)[bc]{\large {\bf \@title}}}
+  \put (3.75, 5.00){\makebox(0,0)[bc]{\large {\bf \thesubtitle}}}
+
+  \put (2.15, 4.75){\makebox(0,0)[l]{{\bf Grant Award No. }}}
+  \put (2.15, 4.57){\makebox(0,0)[l]{{\bf Prepared For    }}}
+  \put (2.15, 4.39){\makebox(0,0)[l]{{\bf Prepared By     }}}
+  \put (2.15, 4.21){\makebox(0,0)[l]{{\bf Document No.    }}}
+  \put (2.15, 4.03){\makebox(0,0)[l]{{\bf Document Date   }}}
+  \put (2.15, 3.85){\makebox(0,0)[l]{{\bf Revision        }}}
+
+  \put (3.75, 4.75){\makebox(0,0)[l]{{\bf : F29601-02-1-0268}}}
+  \put (3.75, 4.57){\makebox(0,0)[l]{{\bf : Pan-STARRS Team}}}
+  \put (3.75, 4.39){\makebox(0,0)[l]{{\bf : \@author}}}
+  \put (3.75, 4.21){\makebox(0,0)[l]{{\bf : \thedocnumber-\theversion}}}
+  \put (3.75, 4.03){\makebox(0,0)[l]{{\bf : \today}}}
+  \put (3.75, 3.85){\makebox(0,0)[l]{{\bf : \theversion}}}
+
+  \put (3.75, 2.50){\makebox(0,0)[c]{{\bf DISTRIBUTION STATEMENT}}}
+  \put (3.75, 2.30){\makebox(0,0)[c]{{\bf \thedistribution}}}
+
+  \put (3.75, 1.30){\makebox(0,0)[bc]{\scriptsize {\bf \copyright Institute for Astronomy, University of Hawaii}}}
+  \put (3.75, 1.15){\makebox(0,0)[bc]{\scriptsize {\bf 2680 Woodlawn Drive, Honolulu, Hawaii 96822}}}
+  \put (3.75, 1.00){\makebox(0,0)[bc]{\scriptsize {\bf An Equal Opportunity/Affirmative Action Institution}}}
+  \end{picture}
+
+  \pagebreak 
+  \unitlength 1.0in
+  \begin{picture}(0.0,0.0)(0.5,9.375)
+  \small
+
+  \put (1.00, 8.50){\makebox(0,0)[l]{Submitted By:}}
+  \put (1.00, 8.00){\line(1,0){5.5}}
+  \put (6.70, 8.00){\line(1,0){0.8}}
+  \put (1.00, 7.90){\makebox(0,0)[l]{[Insert Signature Block of Authorized Developer Representative]}}
+  \put (6.70, 7.90){\makebox(0,0)[l]{Date}}
+
+  \put (1.00, 7.00){\makebox(0,0)[l]{Approved By:}}
+  \put (1.00, 6.50){\line(1,0){5.5}}
+  \put (6.70, 6.50){\line(1,0){0.8}}
+  \put (1.00, 6.40){\makebox(0,0)[l]{[Insert Signature Block of Customer Developer Representative]}}
+  \put (6.70, 6.40){\makebox(0,0)[l]{Date}}
+
+  \end{picture}
+  \pagebreak 
+}               
+
+% -- panstarrs definitions--
+\DeclareOption{psreport}{\input{psreport.def}}
+
+\ProcessOptions\relax
+
+% -- some additional PanSTARRS options
+% A label that also provides a hyperlink anchor
+\newcommand{\hlabel}[1]{\label{#1}\relax\hypertarget{#1}{}}
+
+% Make verbatim use a \footnotesize font (to allow 110-character lines)
+\let\oldverbatim@font=\verbatim@font
+\def\verbatim@font{\oldverbatim@font\footnotesize}
+
+\def\RevisionsStart{
+{ \Large \bf Revision History}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{1in}|p{4in}|}
+\hline
+{\bf Revision Number} & {\bf Release Date} & {\bf Description} \\
+\hline
+}
+\def\RevisionsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak
+}
+
+\def\TBDsStart{
+{ \Large \bf TBD / TBR Listing}
+\begin{center}
+\begin{tabular}{|p{1in}|p{0.8in}|p{0.8in}|p{3.45in}|}
+\hline
+{\bf Section No.} & {\bf Page No.} & {\bf TBD/R No.} & {\bf Description} \\
+\hline
+}
+\def\TBDsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak
+}
+
+\def\DocumentsInternalSection{
+\section{Referenced Documents}
+\subsection{Internal Documents}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsExternalSection{
+\hline
+\end{tabular}
+\end{center}
+\par
+\subsection{External Documents}
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsInternal{
+{\large \bf Referenced Documents}\par
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\multicolumn{1}{l}{\bf Internal Documents} \\
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsExternal{
+\hline
+\end{tabular}
+\end{center}
+\par
+\begin{center}
+\begin{tabular}{|p{1.25in}|p{5in}|}
+\multicolumn{1}{l}{\bf External Documents} \\
+\hline
+{\bf Reference} & {\bf Title} \\
+\hline}
+
+\def\DocumentsEnd{
+\hline
+\end{tabular}
+\end{center}
+\pagebreak }
+
+% Backwards compatibility
+\let\milsection=\section
+\let\milsubsection=\subsection
+\let\milsubsubsection=\subsubsection
+\let\milparagraph=\paragraph
+\let\milsubparagraph=\subparagraph
+
Index: /branches/pap/doc/latex/panstarrs.def
===================================================================
--- /branches/pap/doc/latex/panstarrs.def	(revision 25845)
+++ /branches/pap/doc/latex/panstarrs.def	(revision 25845)
@@ -0,0 +1,161 @@
+% -*- latex -*-
+
+%-------------------------------------------------------------
+% Pan-STARRS Notation
+% -------------------
+% LaTeX variables (cntl sequences) for entities significant to Pan-STARRS.
+   \newcommand{\PS}{Pan-STARRS}
+   \newcommand{\pipelinename}{Image Processing Pipeline}
+   \newcommand{\thisdocument}{\PS/ \pipelinename\ Software Design Description}
+   \newcommand\Object{\ensuremath{f}}                % an object
+   \newcommand\ObjectSet{\ensuremath{\mathbf{f}}}    % a set of objects
+   \newcommand\Telescope{\ensuremath{T}}             % a telescope
+   \newcommand\TelescopeSet{\ensuremath{T}}          % a set of telescopes
+   \newcommand\Image{\ensuremath{\varphi}}           % an image
+   \newcommand\ImageSet{\ensuremath{\varphi}}        % a set of images
+   \newcommand\ImageFT{\ensuremath{\hat{\varphi}}}   % Fourier transform of an image
+   \newcommand\psf{psf}                              % abreviation for point spread function (to appear in sentences)
+   \newcommand\PSF{\ensuremath{g}}                   % math symbol for psf (to appear in math expressions)
+   \newcommand\PSFSet{\ensuremath{\mathbf{g}}}       % a set of psf's
+   \newcommand\PSFFT{\ensuremath{G}}                 % Fourier transform of a psf
+   \newcommand\otf{otf}                              % abreviation for optical transfer function
+   \newcommand\PixelScale{\ensuremath{s_p}}          % pixel scale
+   \newcommand\WarpDegree{\ensuremath{D_w}}          % degree of warp transform polynomial
+   \newcommand\ota{ota}                              % abbreviation for an orthogonal transfer array (to appear in sentences)
+   \newcommand\OTA{\ensuremath{A}}                   % math symbol for ota
+   \newcommand\imcat{{\tt imcat}}                    % reference to Kaiser's imcat software
+   \newcommand\AngularPitch{\ensuremath{p_{\text{\scriptsize pixel}}}}   % angular pitch of a pixel (e.g. 0.3 arcsec)
+
+%
+% Typsetting documentation
+%
+% \code{...} sets code in \tt and escapes most special characters.  Doesn't
+% handle {} correctly, but \CODE.anything but period. does (actually, you
+% may use any character as a delimiter).
+%
+% Designed for a word or two of code inline; use
+% \begin{verbatim}...\end{verbatim} for longer blocks
+%
+\def\uncatcodespecials{\def\do##1{\catcode`##1=12}\dospecials}%
+{\catcode`\`=\active\gdef`{\relax\lq}}% this line inhibits Spanish 
+                                      % ligatures ?` and !` of \tt font
+\def\setupc@de % see TeX Book, p. 381
+    {\tt %
+     \spaceskip=0pt \xspaceskip=0pt % just in case...
+     \catcode`\`=\active
+     \obeylines \uncatcodespecials \obeyspaces
+     \catcode`\{=1\catcode`\}=2
+    }%
+\def\SETUPC@DE % see TeX Book, p. 381
+    {\tt %
+     \spaceskip=0pt \xspaceskip=0pt % just in case...
+     \catcode`\`=\active
+     \obeylines \uncatcodespecials \obeyspaces
+    }%
+
+\def\d@code#1{#1\endgroup}%
+\def\D@CODE#1{\def\next##1#1{##1\endgroup}\next}%
+
+\def\code{\begingroup\setupc@de\d@code}%
+\def\CODE{\begingroup\SETUPC@DE\D@CODE}%
+
+\newcommand\note[1]{{\bf #1}}
+\newcommand\tbd[1]{\textbf{[{\color{red}#1}]}}
+\newcommand\TBD[1]{\par\tbd{#1}\par}
+
+\newcommand{\file}[1]{\textit{#1}}%
+
+%------------------------------------------------------------------------------
+%-------------------------------------------------------------
+% General Math Notation
+% ---------------------
+% -Algebra & Analysis------------
+   \newcommand\Z{\ensuremath{\mathbb{Z}}}                   % integers
+   \newcommand\N{\ensuremath{\mathbb{N}}}                   % natural numbers
+   \newcommand\R{\ensuremath{\mathbb{R}}}                   % real numbers 
+   \newcommand\C{\ensuremath{\mathbb{C}}}                   % complex numbers 
+   \newcommand\rel{\ensuremath{\mathcal{R}}}                % a general relation
+   \newcommand\Group{\ensuremath{\langle G,* \rangle}}      % a group
+   \newcommand\Ring{\ensuremath{\langle R,+,\cdot \rangle}} % a ring
+   \newcommand\F{\ensuremath{\mathbf{F}}}                   % a field
+   \newcommand\Fn{\ensuremath{\mathbf{F}^n}}                % a field in n dimensions
+   \newcommand\FN{\ensuremath{\mathbf{F}^N}}                % a field in N dimensions
+   \newcommand\ztwo{\ensuremath{\mathbb{Z}_2}}              % Cyclic groups (rings)
+   \newcommand\zthree{\ensuremath{\mathbb{Z}_3}}
+   \newcommand\zfour{\ensuremath{\mathbb{Z}_4}}
+   \newcommand\Real{\mbox{Re}}                              % real part (alternatively: \newcommand\Real{\Re}})
+   \newcommand\Imag{\mbox{Im}}                              % imaginary part (alt.: \newcommand\Real{\Re}})
+   \newcommand\integral{\ensuremath{\int_{-\infty}^{\infty}}} % integral 
+
+% -Operator Theory-----------------
+   \newcommand\Per{\ensuremath{\operatorname{Per}}}
+   \newcommand\pv{\ensuremath{\operatorname{pv}}}
+   \newcommand\T{\ensuremath{\operatorname{T}}}
+   \newcommand\W{\ensuremath{\operatorname{W}}}
+   \newcommand\Hilbert{\ensuremath{\mathcal{H}}}
+   \newcommand\Hone{\ensuremath{\mathcal{H}_1}}
+   \newcommand\Htwo{\ensuremath{\mathcal{H}_2}}
+   \newcommand\Banach{\ensuremath{\mathcal{B}(\Hilbert,\Hilbert)}}
+   \newcommand\Banachonetwo{\ensuremath{\mathcal{B}(\Hone,\Htwo)}}
+   \newcommand\Banachtwoone{\ensuremath{\mathcal{B}(\Htwo,\Hone)}}
+   \newcommand\Lone{\ensuremath{L^1}}
+   \newcommand\Ltwo{\ensuremath{L^2}}
+   \newcommand\ltwo{\ensuremath{\ell^2}}
+   \newcommand\LoneR{\ensuremath{L^1(\mathbb{R})}}
+   \newcommand\LtwoR{\ensuremath{L^2(\mathbb{R})}}
+   \newcommand\ltwoR{\ensuremath{\ell^2(\mathbb{R})}}
+% -Vector Spaces---------------------
+   \newcommand\basis{\ensuremath{\mathcal{B}}}
+   \newcommand\Span{\ensuremath{\text{span}}}
+   \newcommand\Null{\ensuremath{\mathcal{N}}}
+   \newcommand\Range{\ensuremath{\mathcal{R}}}   
+   \newcommand\Krylov{\ensuremath{\mathcal{K}}}
+   \newcommand\bx{\ensuremath{\mathbf{x}}}      % the vector x = (x_0, x_1, ...)
+   \newcommand\by{\ensuremath{\mathbf{y}}}      % the vector y = (y_0, y_1, ...)
+% -Harmonic Analysis-----------------
+   \newcommand\FT{\ensuremath{\mathcal{F}}}         % Fourier transform
+   \newcommand\invFT{\ensuremath{\mathcal{F}^{-1}}} % inverse Fourier transform
+
+% -Statistics------------------------
+   \newcommand\OutcomeSpace{\ensuremath{\Omega}}    % Outcome Space
+   \newcommand\SampleSpaceX{\ensuremath{\frak{X}}}  % Sample Space X
+   \newcommand\SampleSpaceY{\ensuremath{\frak{Y}}}  % Sample Space Y
+   \newcommand\SampleMeanX{\overline{x}}            % Sample mean in X  = sum_i x_i / n
+
+%-------------------------------------------------------------
+% Object Oriented Design Notation
+% ---------------------
+  \newcommand\SkyObjectSetList{{\tt SkyObjectSetList}}  % List of sets of sky objects
+  \newcommand\SkyObjectSet{{\tt SkyObjectSet}}          % set of sky objects
+  \newcommand\SkyObject{{\tt SkyObject}}             % sky object
+  \newcommand\SkyLocation{{\tt SkyLocation}}            % sky coordinate (RA,DEC) 
+  \newcommand\DetectorLocation{{\tt DetectorLocation}}  % detector coordinate (x,y)
+  \newcommand\SkyGeometryTransform{{\tt SkyGeometryTransform}} % transforamtion from detector to sky location
+  \newcommand\SkyFluxTransform{{\tt SkyFluxTransform}}  % transforamtion from detector flux to real flux
+
+%------------------------------
+% Language/Grammar
+%----------
+% Latin (see LaTeX Companion, p. 50)
+   \newcommand{\eg}{e.g.,\space}            % for example (latin: {\it exempli gratia})
+   \newcommand{\ie}{i.e.,\space}            % that is     (latin: {\it id est})
+   \newcommand{\etc}{etc.\@\space}          % etcetera    (latin: {\it et cetera})
+
+% doxygen elements
+\newenvironment{CompactList}
+{\begin{list}{}{
+  \setlength{\leftmargin}{0.5cm}
+  \setlength{\itemsep}{0pt}
+  \setlength{\parsep}{0pt}
+  \setlength{\topsep}{0pt}
+  \renewcommand{\makelabel}{}}}
+{\end{list}}
+\newenvironment{CompactItemize}
+{
+  \begin{itemize}
+  \setlength{\itemsep}{-3pt}
+  \setlength{\parsep}{0pt}
+  \setlength{\topsep}{0pt}
+  \setlength{\partopsep}{0pt}
+}
+{\end{itemize}}
Index: /branches/pap/doc/latex/panstarrs.el
===================================================================
--- /branches/pap/doc/latex/panstarrs.el	(revision 25845)
+++ /branches/pap/doc/latex/panstarrs.el	(revision 25845)
@@ -0,0 +1,77 @@
+;;
+;; Support code for the Pan-STARRS C coding standards
+;;
+;; The basic tool is a "panstarrs-c" mode derived from c-mode. If you want to
+;; always use this mode, add the commands
+;;   (load-file "/path/to/panstarrs.el")
+;;   (add-to-list 'auto-mode-alist (cons "\\.[ch]$" 'panstarrs-c-mode))
+;; to your .emacs file
+;;
+;; You might want to copy some of these add-hook lines to your .emacs file too:
+;;  (add-hook 'panstarrs-c-mode-hook 'panstarrs-c99-comments)
+;;  (add-hook 'panstarrs-c-mode-hook 'panstarrs-set-width)
+;;  (add-hook 'panstarrs-c-mode-hook
+;;	    '(lambda ()
+;;	       (set (make-variable-buffer-local 'comment-indent-function)
+;;		    'panstarrs-comment-indent)))
+;; These respectively:
+;;   use C99-style comments (i.e. // to end of line)
+;;   have your emacs window set to 110 characters wide
+;;   somewhat improve (or spoil?) the handling of re-indenting comments
+
+(define-derived-mode panstarrs-c-mode
+  c-mode "Pan-STARRS C"
+  "Major mode for editing Pan-STARRS C source.
+          \\{panstarrs-c-mode-map}
+"
+  
+  (let ( (our-mode-name mode-name) )
+    (c-mode)			        ; get correct font-lock behaviour
+    (setq mode-name our-mode-name))	; keep our desired name
+
+  (setq c-default-style '((other . "k&r")))
+  (setq c-basic-offset 4)
+
+  (setq comment-column 40)
+  (setq fill-column 110)
+  
+  (add-to-list 'c-offsets-alist (cons 'statement-case-intro 2))
+  (add-to-list 'c-offsets-alist (cons 'statement-case-open 2))
+  (add-to-list 'c-offsets-alist (cons 'case-label 2)))
+;;
+;; Various useful commands for writing panstarrs code
+;;
+(defun panstarrs-c99-comments ()
+  "Use C99-style // comments"
+  (setq comment-start "// ")
+  (setq comment-end ""))
+;;
+(defun panstarrs-set-width ()
+  "Set frame width to fill-column + 1 ( + 1 to allow for wrap column)"
+  (set-frame-width default-minibuffer-frame (1+ fill-column)))
+;;
+;;
+(defun panstarrs-comment-indent (&optional delete)
+  "Make ESC; indent new comments to comment-column even if previous line
+has a comment indented further to the right"
+
+  (interactive "p")
+  (let ( (indent (c-comment-indent)) )
+    (if (> indent comment-column)
+	(save-excursion
+	  (beginning-of-line)
+	  (if (not (looking-at (concat "^[ \t]*" comment-start)))
+	      (setq indent comment-column))))
+    indent))
+
+(defun panstarrs-c-default (&optional delete)
+  "Use Pan-STARRS C-mode as default"
+
+  (interactive "p")
+  (add-to-list 'auto-mode-alist (cons "\\.[ch]$" 'panstarrs-c-mode))
+  (add-hook 'panstarrs-c-mode-hook 'panstarrs-set-comments)
+  (add-hook 'panstarrs-c-mode-hook
+	    '(lambda ()
+	       (set (make-variable-buffer-local 'comment-indent-function)
+		    'panstarrs-comment-indent))))
+
