%APN3_PROCEEDINGS_FORM%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% TEMPLATE.TEX -- APN3 (2003) ASP Conference Proceedings template.
%
% Derived from ADASS VIII (98) ASP Conference Proceedings template
% Updated by N. Manset for ADASS IX (99), F. Primini for ADASS 2000,
% D.Bohlender for ADASS 2001, and H. Payne for ADASS XII and LaTeX2e.
%
% Use this template to create your proceedings paper in LaTeX format
% by following the instructions given below.  Much of the input will
% be enclosed by braces (i.e., { }).  The percent sign, "%", denotes
% the start of a comment; text after it will be ignored by LaTeX.  
% You might also notice in some of the examples below the use of "\ "
% after a period; this prevents LaTeX from interpreting the period as
% the end of a sentence and putting extra space after it.  
% 
% You should check your paper by processing it with LaTeX.  For
% details about how to run LaTeX as well as how to print out the User
% Guide, consult the README file.  You should also consult the sample
% LaTeX papers, sample1.tex and sample2.tex, for examples of including
% figures, html links, special symbols, and other advanced features.
%
% If you do not have access to the LaTeX software or a laser printer
% at your site, you can still prepare your paper following the
% instructions in the User Guide.  In such cases, the editors will
% process the file and make any necessary editorial adjustments.
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
\documentclass[11pt,twoside]{article}  % Leave intact
\usepackage{adassconf}

% If you have the old LaTeX 2.09, and not the current LaTeX2e, comment
% out the \documentclass and \usepackage lines above and uncomment
% the following:

%\documentstyle[11pt,twoside,adassconf]{article}

\begin{document}   % Leave intact

%-----------------------------------------------------------------------
%                           Paper ID Code
%-----------------------------------------------------------------------
% Enter the proper paper identification code.  The ID code for your
% paper is the session number associated with your presentation as
% published in the official conference proceedings.  You can           
% find this number locating your abstract in the printed proceedings
% that you received at the meeting or on-line at the conference web
% site; the ID code is the letter/number sequence proceeding the title 
% of your presentation. 
%
% This will not appear in your paper; however, it allows different
% papers in the proceedings to cross-reference each other.  Note that
% you should only have one \paperID, and it should not include a
% trailing period.
%
% EXAMPLE: \paperID{O4-1}
% EXAMPLE: \paperID{P7-7}
%

\paperID{P4-17}
%%%% ID=P4-17

%-----------------------------------------------------------------------
%                           Paper Title 
%-----------------------------------------------------------------------
% Enter the title of the paper.
%
% EXAMPLE: \title{A Breakthrough in Astronomical Software Development}
% 
% If your title is so long as to fill the page header when you print it,
% then please supply a short form as a \titlemark.
%
% EXAMPLE: 
%  \title{Rapid Development for Distributed Computing, with Implications
%         for the Virtual Observatory}
%  \titlemark{Rapid Development for Distributed Computing}
%

\title{Preliminary design of the SCUBA-2 Data Reduction Pipeline}
%\titlemark{ }

%-----------------------------------------------------------------------
%                         Authors of Paper
%-----------------------------------------------------------------------
% Enter the authors followed by their affiliations.  The \author and
% \affil commands may appear multiple times as necessary (see example
% below).  List each author by giving the first name or initials first
% followed by the last name.  Authors with the same affiliations
% should grouped together. 
%
% EXAMPLE: \author{Raymond Plante, Doug Roberts, 
%                  R.\ M.\ Crutcher\altaffilmark{1}}
%          \affil{National Center for Supercomputing Applications, 
%                 University of Illinois Urbana-Champaign, Urbana, IL
%                 61801}
%          \author{Tom Troland}
%          \affil{University of Kentucky}
%
%          \altaffiltext{1}{Astronomy Department, UIUC}
%
% In this example, the first three authors, "Plante", "Roberts", and
% "Crutcher" are affiliated with "NCSA".  "Crutcher" has an alternate 
% affiliation with the "Astronomy Department".  The fourth author,
% "Troland", is affiliated with "University of Kentucky"

\author{Tim Jenness\altaffilmark{1}, Frossie Economou}
\affil{Joint Astronomy Centre, 660 N. A`oh\={o}k\={u} Place, University Park,
Hilo, Hawaii, 96720}

\author{Douglas Scott}
\affil{University of British Columbia, 6224 Agricultural Road,
  Vancouver, British Columbia, V6T 1Z1, Canada}

\author{Dennis Kelly, Wayne S.\ Holland}
\affil{UK Astronomy Technology Centre, Royal Observatory, Blackford Hill,
Edinburgh EH9 3HJ, UK}

\altaffiltext{1}{University of British Columbia}

%-----------------------------------------------------------------------
%                        Contact Information
%-----------------------------------------------------------------------
% This information will not appear in the paper but will be used by
% the editors in case you need to be contacted concerning your
% submission.  Enter your name as the contact along with your email
% address.
% 
% EXAMPLE:  \contact{Dennis Crabtree}
%           \email{crabtree@cfht.hawaii.edu}
%

\contact{Tim Jenness}
\email{t.jenness@jach.hawaii.edu}

%-----------------------------------------------------------------------
%                     Author Index Specification
%-----------------------------------------------------------------------
% Specify how each author name should appear in the author index.  The 
% \paindex{ } should be used to indicate the primary author, and the
% \aindex for all other co-authors.  You MUST use the following
% syntax: 
%
% SYNTAX:  \aindex{Lastname, F. M.}
% 
% where F is the first initial and M is the second initial (if
% used).  This guarantees that authors that appear in multiple papers
% will appear only once in the author index.  
%
% EXAMPLE: \paindex{Crabtree, D.}
%          \aindex{Manset, N.}        
%          \aindex{Veillet, C.}        
%
% NOTE: this information is also used to build the author list that
% appears in the table of contents.  Authors will be listed in the order
% of the \paindex and \aindex commmands.
%

\paindex{Jenness, T.}
\aindex{Economou, F.}     % Remove this line if there is only one author
\aindex{Scott, D.}
\aindex{Kelly, B. D.}
\aindex{Holland, W. S.}

%-----------------------------------------------------------------------
%                     Author list for page header       
%-----------------------------------------------------------------------
% Please supply a list of author last names for the page header. in
% one of these formats:
%
% EXAMPLES:
% \authormark{Lastname}
% \authormark{Lastname1 \& Lastname2}
% \authormark{Lastname1, Lastname2, ... \& LastnameN}
% \authormark{Lastname et al.}
%
% Use the "et al." form in the case of seven or more authors, or if
% the preferred form is too long to fit in the header.

\authormark{Jenness, Economou, Scott, Kelly \& Holland}

%-----------------------------------------------------------------------
%                       Subject Index keywords
%-----------------------------------------------------------------------
% Enter a comma separated list of up to 6 keywords describing your
% paper.  These will NOT be printed as part of your paper; however,
% they will be used to generate the subject index for the proceedings.
% There is no standard list; however, you can consult the indices
% for past proceedings (http://adass.org/adass/proceedings/).
%
% EXAMPLE:  \keywords{visualization, astronomy: radio, parallel
%                     computing, AIPS++, Galactic Center}
%
% In this example, the author noticed that "radio astronomy" appeared
% in the ADASS VII Index as "astronomy" being the major keyword and
% "radio" as the minor keyword.  The colon is used to introduce another
% level into the index.

\keywords{astronomy: submm, pipelines, SCUBA-2, JCMT, Starlink, Perl}

%-----------------------------------------------------------------------
%                              Abstract
%-----------------------------------------------------------------------
% Type abstract in the space below.  Consult the User Guide and Latex
% Information file for a list of supported macros (e.g. for typesetting 
% special symbols). Do not leave a blank line between \begin{abstract} 
% and the start of your text.

\begin{abstract}          % Leave intact
% Place the text of your abstract here - NO BLANK LINES
SCUBA-2, scheduled for delivery in late 2005, will be the largest
submillimetre bolometer array ever built. Data from this instrument are
stored at a rate of 200~Hz generating approximately 0.5~TB per night;
unheard of for a submillimetre array. This paper will discuss the overall
design of the planned pipeline, with reference to some of the unique
algorithmic challenges that must be resolved.
\end{abstract}

%-----------------------------------------------------------------------
%                             Main Body
%-----------------------------------------------------------------------
% Place the text for the main body of the paper here.  You should use
% the \section command to label the various sections; use of
% \subsection is optional.  Significant words in section titles should
% be capitalized.  Sections and subsections will be numbered
% automatically. 
%
% EXAMPLE:  \section{Introduction}
%           ...
%           \subsection{Our View of the World}
%           ...
%           \section{A New Approach}
%
% It is recommended that you look at the sample papers, sample1.tex
% and sample2.tex, for examples for formatting references, footnotes,
% figures, equations, html links, lists, and other special features.  

\section{Introduction}

SCUBA-2 (Holland et al.\ 2003) is a second generation wide-field
submillimetre camera under development for the James Clerk Maxwell Telescope
(JCMT). With over 10,000 pixels in two arrays (850- and 450-$\mu$m), SCUBA-2
will map the submillimetre sky up to 1000 times faster than the current SCUBA
(Holland et al.\ 1999).

\section{Observing Modes}

Unlike SCUBA, which can only record an AC (i.e.\ chopped) signal, the signal
output of the SCUBA-2 pixels will be DC-coupled to the signal processing
electronics. This will lead to significant efficiency improvements, since half
of the integration cycle is not spent on blank sky. There is no need for sky
chopping, leading to better image fidelity and sensitivity to source structure
on \emph{all} scales. It also gives a lower confusion limit i.e.\ by not
continuously subtracting two images of the sky. However, the main complication
is that 1/f noise from detectors or electronics must be at an acceptable
level. A cold shutter will take ``dark frames'' to compensate for any 1/f
noise and any other instrumental drifts. It is envisaged that
SCUBA-2 will provide JCMT with the following observing modes.

\subsection{Imaging}

To produce images up to a few arrays in size the array can image regions of
the sky equivalent to the array field-of-view (8~arcmin) and mosaic together
offset frames. There are two techniques to achieve this.  The simplest imaging
mode is simply to co-add the 200 Hz data, de-spike, flat-field and fit a sky
signal.  Whilst straightforward, it is not yet clear that the flat-field will
be stable enough for this to work.

The difficulty associated with maintaining a stable flat-field indicates that
it is likely that an observing mode more complex than simple co-adding and sky
fitting will be required for simple imaging mode. We intend to use the DREAM
(Dutch Real-Time Acquisition Mode) technique as prototyped on SCUBA (Le Poole
\& van Someren Greve 1998). In essence, with this technique the secondary
mirror is moved rapidly such that multiple bolometers measure the same point
in the sky during a single second of integration. The relative response for
each bolometer can then be solved such that the individual maps created for
each bolometer can be tiled to create a complete image.  The main constraint
on the system is the maximum size of the secondary mirror excursion (any
larger than about 30 arcsec will lead to vignetting of the array) and the
requirement to get round the pattern before the atmosphere changes.


\subsection{Scan Mode}

The 200~Hz readout rate and the 7 arcsec beam at 450~$\mu$m combine to   
limit the maximum scan speed to approximately 600 arcsec/sec whilst
Nyquist sampling. This is significantly faster than the current SCUBA scan
rate of 24 arcsec/sec at 450~$\mu$m or 60 arcsec/sec at 850~$\mu$m,
resulting in maps potentially covering up to tens of degrees at a time.

\subsection{Spectroscopic/Polarimetric}

The polarimeter and FTS will rely on the standard STARE mode (not DREAM) in
order to maximize observing efficiency. The polarimeter wave-plate will be
spinning fast (up to 25 Hz) in order to minimize sky variations and will be a
scaled-up version of the current SCUBA polarimeter (Greaves et al.\ 2003).
Similarly, the FTS mirror will be scanned rapidly to generate a cube as
quickly as possible (see, e.g.\ Naylor et al.\ 2003). Processing the data
whilst keeping up with observing will be challenging.

\section{Computing Challenges}

While 10,000 pixels spread over 2 wavelengths may not seem like much to those
used to large CCDs, the challenge for SCUBA-2 lies in the fact that the
instrument is read out and data stored to disk at 200 frames per second (and
up to 20~kHz in the acquisition electronics). This speed is required in order
to enable the sky variation during the readout to be minimized and allows for
a very fast mapping speed.

The data rate for SCUBA-2 translates to 4 MB/s for each wavelength, equivalent
to 0.5 TB of data per night for a normal 16 hour observing period. Each
sub-array is connected to a separate data acquisition (DA) computer running
Real Time Linux. In imaging mode a file is written every few seconds (limited
by sky rotation; the instrument is on the Nasmyth platform without an image
rotator) while in SCAN mode a file is written approximately every minute. The
pipeline and display system pick up data from the file system.


\section{Data Display}

There is no real-time display associated with SCUBA-2. Observer feedback is
provided by an instance of the pipeline optimized to display the observation
progress as fast as possible (the so-called ``Quick Look'' (QL) pipeline):
simply co-adding sub-scans and re-gridding the data from Nasmyth coordinates to
RA/Dec. The QL pipeline is fundamentally identical to the main analysis
pipeline, differing only in the recipe that is executed. No data analysis is
included in this version of the pipeline.  GAIA/RTD (e.g.\ Draper 2000) will
be used as the main display engine.


\section{Pipeline Architecture}

The SCUBA-2 pipeline will use the ORAC-DR pipeline infrastructure (Economou et
al.\ 1999).  This architecture has a proven track record on UKIRT (Economou et
al.\ 2001), JCMT (Jenness \& Economou 1999) and the AAT, is truly generic (it
can also support Gemini (Cavanagh et al.\ 2003) and ESO data (Currie 2004))
and is easily flexible enough to incorporate SCUBA-2 data.  Where possible we
will make use of existing applications (the standard SCUBA algorithms for
skydip fitting (Jenness \& Lightfoot 1998; Archibald et al.\ 2002), Starlink
applications for mosaicking and world coordinate handling (Giaretta et al.\ 
2004; Berry 2004), and standard point source extraction tools) but new
applications will also have to be written to deal with the unique
observational and computing requirements for the specified observing modes
(the so-called algorithm engines). Supported messaging interfaces are SOAP,
DRAMA (Bailey, Farrell \& Shortridge 1995) and Starlink ADAM.

\section{Calibration Enhancements}

The ability to generate complete fully-sampled images in 1 second
(significantly faster than the 64 seconds required with the current SCUBA)
allows some fairly significant improvements in calibration accuracy possible
from the pipeline. For example, the opacity correction can be applied from the
water vapor radiometer (see e.g.\ Wiedner et al.\ 2001) which can provide
line-of-sight opacity values every 1.2 seconds. Also, the field-of-view is 16
times larger than with SCUBA and much more sensitive; bright sources in the
field can usefully allow for fast pointing/seeing corrections to be applied.
Finally, calibration drifts can be corrected much more accurately due to the
faster sampling and larger field-of-view. (cf.\ Jenness et al.\ 2002).

\section{Time Line}

SCUBA-2 is considered a high risk high return project on an aggressive time
schedule. It is currently due to go on JCMT in early 2006. The general
pipeline architecture will be tested on simulated data prior to delivery, but
the details of specific algorithms may change significantly during
commissioning.


%-----------------------------------------------------------------------
%                             References
%-----------------------------------------------------------------------
% List your references below within the reference environment
% (i.e. between the \begin{references} and \end{references} tags).
% Each new reference should begin with a \reference command which sets
% up the proper indentation.  Observe the following order when listing
% bibliographical information for each reference:  author name(s),
% publication year, journal name, volume, and page number for
% articles.  Note that many journal names are available as macros; see
% the User Guide listing "macro-ized" journals.   
%
% EXAMPLE:  \reference Hagiwara, K., \& Zeppenfeld, D.\  1986, 
%                Nucl.Phys., 274, 1
%           \reference H\'enon, M.\  1961, Ann.d'Ap., 24, 369
%           \reference King, I.\ R.\  1966, \aj, 71, 276
%           \reference King, I.\ R.\  1975, in Dynamics of Stellar 
%                Systems, ed.\ A.\ Hayli (Dordrecht: Reidel), 99
%           \reference Tody, D.\  1998, \adassvii, 146
%           \reference Zacharias, N.\ \& Zacharias, M.\ 2003,
%                \adassxii, \paperref{P7.6}
% 
% Note the following tricks used in the example above:
%
%   o  \& is used to format an ampersand symbol (&).
%   o  \'e puts an accent agu over the letter e.  See the User Guide
%      and the sample files for details on formatting special
%      characters.  
%   o  "\ " after a period prevents LaTeX from interpreting the period 
%      as an end of a sentence.
%   o  \aj is a macro that expands to "Astron. J."  See the User Guide
%      for a full list of journal macros
%   o  \adassvii is a macro that expands to the full title, editor,
%      and publishing information for the ADASS VII conference
%      proceedings.  Such macros are defined for ADASS conferences I
%      through XI.
%   o  When referencing a paper in the current volume, use the
%      \adassxii and \paperref macros.  The argument to \paperref is
%      the paper ID code for the paper you are referencing.  See the 
%      note in the "Paper ID Code" section above for details on how to 
%      determine the paper ID code for the paper you reference.  
%
\begin{references}

%% \reference Allan, P.\ M.\ 1992, \adassi, 126 

\reference Archibald, A., et al.\ 2002, \mnras, 336, 1

\reference Bailey, J.\ A., Farrell, T.\ \& Shortridge, K.\ 1995, Proc.\ SPIE,
2479, 62

\reference Berry, D.\ S.\ 2004, \adassxiii, \paperref{P4-12}

\reference Cavanagh, B.\ et al.\ 2003, \adassxii, 237

\reference Currie, M.\ J.\ 2004, \adassxiii, \paperref{P4-25}

\reference Draper, P.\ W.\ 2000, \adassix, 615

\reference Economou, F.\ et al.\ 1999, \adassviii, 11

\reference Economou, F.\ et al.\ 2001, \adassx, 314

\reference Giaretta, D.\ et al.\ 2004, \adassxiii, \paperref{D12}

\reference Greaves, J.\ S.\ et al.\ 2003, \mnras, 340, 353

\reference Holland, W.\ S.\ et al.\ 1999, \mnras, 303, 659

\reference Holland, W.\ S.\ et al.\ 2003, Proc.\ SPIE, 4855, 1

\reference Jenness, T., \& Lightfoot, J.\ F.\ 1998, \adassvii, 216

\reference Jenness, T., \& Economou, F.\ 1999, \adassviii, 171

\reference Jenness, T.\ et al.\ 2002, \mnras, 336, 14

\reference Le Poole, R.\ S.\ \& van Someren Greve, H.\ W.\ 1998, Proc.\ SPIE,
3357, 638

\reference Naylor, D.\ A.\ et al.\ 2003, Proc.\ SPIE, 4855, 540

\reference Wiedner, M.\ C., Hills, R.\ E., Carlstrom, J.\ E.\ \& Lay, O.\ P.\
2001, \apj, 553, 1036

\end{references}

% Do not place any material after the references section

\end{document}  % Leave intact
