\documentclass{article}
\usepackage{graphicx}
\usepackage{fancyhdr}
% \usepackage{natbib}
\makeindex{}

\makeatletter
\textheight 625pt
\textwidth 460pt
\oddsidemargin 0pt
\evensidemargin 0pt
\marginparwidth 50pt
\topmargin 0pt

% Float Positionning Behaviour Correction.
\renewcommand{\textfraction}{0.0}
\renewcommand{\topfraction}{1.0}
\renewcommand{\bottomfraction}{1.0}
\renewcommand{\floatpagefraction}{0.0}
\setcounter{totalnumber}{5}
\setcounter{topnumber}{4}

\newcommand{\etal}{et al.}
\newcommand{\ie}{{\em i.e.}}
\newcommand{\eg}{{\em e.g.}}
\newcommand{\cf}{cf.}

\newcommand{\emm}[1]{\ensuremath{#1}}   % Ensures math mode.
\newcommand{\emr}[1]{\emm{\mathrm{#1}}} % Uses math roman fonts.
\newcommand{\nds}[1]{\emm{\displaystyle#1}} % Normal display size for array and tabular environment.
\newcommand{\paren}[1]{\nds{\left(  #1 \right) }} % Parenthesis. 
\newcommand{\cbrace}[1]{\nds{\left\{ #1 \right\}}} % Curly Braces.
\newcommand{\bracket}[1]{\nds{\left[  #1 \right] }} % Brackets.
\newcommand{\abs}[1]{\emm{\left| #1 \right|}} % Absolute value.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\noise}[1][]{\emm{\sigma_\emr{#1}}}
\newcommand{\noisebeam}{\noise[beam]}
\newcommand{\nefd}{\emr{NEFD}}
\newcommand{\elev}{\emr{el}}
\newcommand{\tauzen}{\emm{\tau_\emr{zen}}}
\newcommand{\A}{\emm{A}}

\newcommand{\tint}[2][]{\emm{t^\emr{#1}_\emr{#2}}}
\newcommand{\tsig}{\tint{\noise}}
\newcommand{\tsigmap}{\tint{map}}
\newcommand{\tsigbeam}{\tint{beam}}
\newcommand{\tcover}{\tint{cover}}
\newcommand{\ttel}{\tint{tel}}

\newcommand{\tsource}{\tint{source}}
\newcommand{\nsource}{\emm{n_\emr{source}}}
\newcommand{\nscan}{\emm{n_\emr{scan}}}
\newcommand{\nsubscan}{\emm{n_\emr{subscan}}}
\newcommand{\nsubscanmax}{\emm{n_\emr{subscan}^\emr{max}}}
\newcommand{\nsubscanres}{\emm{n_\emr{subscan}^\emr{res}}}
\newcommand{\nsubscantot}{\emm{n_\emr{subscan}^\emr{tot}}}
\newcommand{\nsubscancov}{\emm{n_\emr{subscan}^\emr{cover}}}
\newcommand{\ncal}{\emm{n_\emr{cal}}}
\newcommand{\dcal}{\emm{d_\emr{cal}}}
\newcommand{\dscan}{\emm{d_\emr{scan}}}
\newcommand{\dsubmap}{\emm{d_\emr{submap}}}
\newcommand{\efftel}{\emm{\epsilon_\emr{tel}}}
\newcommand{\tcal}{\tint{cal}}
\newcommand{\tscan}{\tint{scan}}
\newcommand{\tscanover}{\tint[overhead]{scan}}
\newcommand{\tsubscan}{\tint{subscan}}
\newcommand{\tsubscanover}{\tint[overhead]{subscan}}
\newcommand{\tpointing}{\tint{pointing}}
\newcommand{\tfocus}{\tint{focus}}
\newcommand{\tskydips}{\tint{skydips}}
\newcommand{\tcalonoff}{\tint[cal]{onoff}}
\newcommand{\caloverhead}{\emm{\eta_\emr{cal}}}

\newcommand{\Amap}{\emm{\Omega_\emr{map}}}
\newcommand{\Abeam}{\emm{\Omega_\emr{beam}}}
\newcommand{\beam}{\emm{\theta}}
\newcommand{\grideff}{\emm{\eta_\emr{grid}}}
\newcommand{\nbeam}{\emm{n_\emr{beam}}}
\newcommand{\nbeambol}{\emm{n_\emr{beam}^\emr{bol}}}

\newcommand{\vlin}{\emm{v_\emr{\|}}}

\newcommand{\dist}[2][]{\emm{\Delta^\emr{#1}_\emr{#2}}}
\newcommand{\dperptot}{\dist[\bot]{tot}}
\newcommand{\dparatot}{\dist[\|]{tot}}
\newcommand{\dperpmos}{\dist[\bot]{mos}}
\newcommand{\dparamos}{\dist[\|]{mos}}
\newcommand{\dperpsou}{\dist[\bot]{sou}}
\newcommand{\dparasou}{\dist[\|]{sou}}
\newcommand{\darray}{\dist{array}}
\newcommand{\dthrow}{\dist{throw}}
\newcommand{\dbase}{\dist{base}}
\newcommand{\dedge}{\dist{edge}}
\newcommand{\Dsubmap}{\dist{submap}}
\newcommand{\rowsep}{\emm{\delta}}

\newcommand{\nbol}[1][]{\emm{n^\emr{#1}_\emr{bol}}}
\newcommand{\nboltot}{\nbol[tot]}
\newcommand{\nbolmax}{\nbol[max]}
\newcommand{\nboldead}{\nbol[dead]}

\newcommand{\Asubmap}{\emm{\Omega_\emr{submap}}}
\newcommand{\tsubmap}{\tint{submap}}
\newcommand{\nsubmap}{\emm{n_\emr{submap}}}
\newcommand{\ncover}{\emm{n_\emr{cover}}}

\newcommand{\ceil}{\emr{ceil}}
\newcommand{\floor}{\emr{floor}}

\newcommand{\csf}{\emm{\alpha}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Makes fancy headings and footers.
\pagestyle{fancy}

\fancyhf{} % Clears all fields.

\lhead{\scshape IRAM-30m MAMBO time/sensitivity estimator}
\rhead{\scshape \nouppercase{\rightmark}}   %
\fancyfoot[C]{\bfseries \thepage{}}

\renewcommand{\headrulewidth}{0pt}    %
\renewcommand{\footrulewidth}{0pt}    %

\renewcommand{\sectionmark}[1]{%
  \markright{\thesection. \MakeLowercase{#1}}}
\renewcommand{\subsectionmark}[1]{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\TabParams}{%
  \begin{center}
    Table 1: Values of parameters independent of the observing mode.\\
    \begin{tabular}{lrc}
      \hline
      \hline
      Parameter & Value & Unit \\
      \hline
      \nefd{}        & 30  & (mJy/beam)\,$\sqrt{\mbox{s}}$\\
      \hline
      \dcal{}        & 1   & hr  \\
      \tpointing{}   & 3   & min \\
      \tfocus{}      & 2   & min \\
      \tskydips{}    & 5   & min \\
      \tcalonoff{}   & 4   & min \\
      \caloverhead{} & 1.5 & --- \\
      \hline
      \efftel{}      & 1   & --- \\
      \hline
    \end{tabular}    
  \end{center}
  \label{tab:params}}

\newcommand{\TabOpacities}{%
  \begin{center}
    Table 2: Values of used zenith opacities (\tauzen{}) as a function of
    weather conditions for summer and winter.\\
    \begin{tabular}{cccc}
      \hline
      \hline
      & Excellent & Average & Poor \\
      \hline
      Winter & $\le 0.10$ & $\le 0.30$ & $\le 0.50$ \\
      Summer & $\le 0.20$ & $\le 0.35$ & $\le 0.50$ \\
      \hline
    \end{tabular}    
  \end{center}
  \label{tab:opacities}}

\newcommand{\TabMap}{%
  \begin{center}
    Table 3: User defined values of parameters for the mapping observing mode.\\
    \begin{tabular}{lcccc}
      \hline
      \hline
      Parameter & Default  & Minimum & Maximum & Unit \\
      \hline
      \vlin{}     &   8 &   4 &  10 & arcsec\,s$^{-1}$ \\
      \rowsep{}   &   8 &   5 &  24 & arcsec \\
      \dthrow{}   &  60 &  30 &  90 & arcsec \\
      \hline
    \end{tabular}    
  \end{center}
  \label{tab:mapping}}

\newcommand{\TabArray}{%
  \begin{center}
    Table 4: Fixed values of parameters for the mapping observing mode.\\
    \begin{tabular}{lrc}
      \hline
      \hline
      Parameter & Value & Unit \\
      \hline
      \dbase{}    &  30 & arcsec \\
      \darray{}   & 245 & arcsec \\
      \nbolmax{}  & 117 & --- \\
      \nboldead{} &  14 & --- \\
      \hline
      \dsubmap{}  &   1 & hr \\
      \dscan{}    &   1 & hr \\
      \hline
      $\csf(40'')$ & 0.4 & mJy/beam.$\sqrt{\emr{sec}}$/arcsec \\
      $\csf(2')$  & 1.2 & mJy/beam.$\sqrt{\emr{sec}}$/arcsec \\
      \hline
    \end{tabular}    
  \end{center}
  \label{tab:array}}

\newcommand{\TabOnOff}{%
  \begin{center}
    Table 5: Values of parameters for the On-Off observing mode.\\
    \begin{tabular}{lrc}
      \hline
      \hline
      Parameter & Value & Unit \\
      \hline
      \nsubscan{}     & 20  & --- \\
      \tsubscan{}     & 60  & sec \\
      \tsubscanover{} &  4  & sec \\
      \tscanover{}    & 15  & sec \\
      \hline
    \end{tabular}    
  \end{center}
  \label{tab:onoff}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\title{IRAM Memo 2010-2\\[3\bigskipamount]
  IRAM-30m MAMBO time/sensitivity estimator}%
\author{J. Pety$^{1,2}$, G. Quintana-Lacaci$^{3}$, R. Zylka$^{1}$, S. Bardeau$^{1}$, E. Reynier$^{1}$\\[0.5cm]
  1. IRAM (Grenoble) \\
  2. Observatoire de Paris\\
  3. IRAM (Granada)}
\date{Jun, 30th 2010\\
  Version 1.0}

\maketitle

\begin{abstract}
  This memo describes the equations used in the IRAM-30m MAMBO
  time/sensitivity estimator available in the \texttt{GILDAS/ASTRO}
  program.
\end{abstract}

\vspace*{3cm}

\newpage{}

\tableofcontents{}

\newpage{}

\section{Generalities}

\subsection{Noise as a function of time for a single bolometer}

The rms noise (\noise) of the data obtained with a single bolometer is
related to the on-source integration time (\tsig) in a given direction of
the sky through
\begin{equation}
  \noise = \frac{\nefd\,\exp\paren{\A\,\tauzen}}{\sqrt{\tsig}},
  \label{eq:bolo}  
\end{equation}
where \nefd{} is the noise equivalent flux density of the bolometer, $\A
\simeq 1/\sin(\elev)$ the airmass and \tauzen{} the zenith atmospheric
opacity.

\subsection{Estimator philosophy}

The goal of a time estimator is to find the elapsed telescope time
(\ttel{}) needed to obtain a given rms noise, while a sensitivity estimator
aims at finding the rms noise obtained when observing during \ttel{}. 

The time needed 1) to do calibrations (\eg{} pointing, focus, skydip) and
2) to slew the telescope between on-source integrations have to be added to
\tsig{} to get the elapsed telescope time. The observing procedures to use
MAMBO are standardized. This enables to decompose the telescope time into a
succession of calibrations, scans and subscans, which will be close to the
actual observing setup. We nevertheless include an additional efficiency
factor (\efftel{}), which will take into account the possibility of bad
weather and/or technical problems. The idea is that on average the PIs will
reach their scientific goals, including possible hazards.

\subsection{Decomposing the elapsed telescope time}

If the PI wants to reach the same rms noise (\noise) on \nsource{} sources
(they must share the same calibrator sources), during a given elapsed
telescope time (\ttel{}), we have
\begin{equation}
  \efftel \, \ttel = \nsource\,\tsource + \ncal\,\tcal,
\end{equation}
where \tcal{} is the time required to acquire the calibration information
and \ncal{} the number of such calibration suits.

The calibration time can be written as
\begin{equation}
  \tcal = \caloverhead \, (\tpointing + \tfocus + \tskydips + \tcalonoff),
\end{equation}
where \tpointing{}, \tfocus{}, \tskydips{} and \tcalonoff{} are
respectively the typical times needed to perform a pointing, focus and
skydip measurement and an OnOff measurement on a calibrator.
\caloverhead{} is a multiplicative factor $(> 1)$ which takes into account
the time to slew to the pointing and/or focus source as well as the
possible need to do such calibrations twice in a row.  The number of such
calibrations is dictated by the fact that the maximum duration between two
such calibration suits must be \dcal{}. This gives
\begin{equation}
  \nsource\,\tsource \le \ncal\,\dcal
  \quad \mbox{\ie{}} \quad
  \efftel \, \ttel \le \ncal\, (\dcal+\tcal)
  \quad \mbox{or} \quad
  \frac{\efftel \, \ttel}{\dcal+\tcal} \le \ncal.
\end{equation}

The time spent per source (\tsource{}) is linked to the integration time
(\tsig{}) through the succession of \nsubscantot{} subscans, each subscan
having an on-source integration time of \tsubscan{} and an overhead time of
\tsubscanover{}. The \nsubscantot{} subscans are grouped into scans, with
an additional overhead time of \tscanover{} per scan. If one scan can
contain at most \nsubscanmax{} subscans, the number of scans (\nscan{}) and
the residual number of subcans (\nsubscanres{}) are computed through
\begin{eqnarray}
  \nscan &=& \floor\paren{\frac{\nsubscantot}{\nsubscanmax}}, \\
  \nsubscanres &=& \nsubscantot - \nscan \nsubscanmax.
\end{eqnarray}
We note that the actual number of scan is $\nscan+1$ when $\nsubscanres \ge
1$ and \nscan{} when $\nsubscanres = 0$. The time spent per source is thus given by
\begin{eqnarray}
  \tscan & = &\nsubscanmax\,(\tsubscan+\tsubscanover) + \tscanover,\\
  \tsource & = & \nscan\,\tscan + \bracket{\nsubscanres (\tsubscan+\tsubscanover) + \tscanover}.
\end{eqnarray}

\section{OnOff}

In the OnOff observing mode, the secondary is symmetrically wobbled around
the sky direction to be observed. In this case, Eq.~\ref{eq:bolo} holds
with
\begin{equation}
  \tsig = \nsubscantot \, \tsubscan.
\end{equation}
In this case, the maximum number of subscans per scan and the subscan times
are usually fixed to a conventional value.

\section{Mapping}

\subsection{Observing strategy}

A bolometer measures other contributions (\eg{} the atmospheric emission),
which usually domintes the measured signal. Moreover, MAMBO bolometers have
a finite time response. The strategy to map a source must take care of both
effects. One way is to wobble the secondary in the scanning direction. We
note that it is customary to scan in the azimuthal direction because this
allows to scan at nearly constant airmass (\ie{} at constant elevation).
However, when mapping an elongated source (\eg{} an edge-on galaxy disk),
the restoration algorithms work best when scanning along the smallest
source size. In addition, the observing mode (wobbling) introduces strong
boundary conditions, which in general implies that the whole array must
scan over the full source size. In addition, a portion of blanked sky
(typically 3 times the full width at half maximum of the telescope beam)
must be be observed to baseline the data.

In summary, if the PI wants to map a source of size $\dparasou \times
\dperpsou$, the total scanned size will have to be $\dparatot \times
\dperptot$ with
\begin{eqnarray}
  \dperptot & = & \dperpsou, \\
  \dparatot & = & \dparasou + \darray + \dthrow + \dbase,
\end{eqnarray}
where \darray{} is the linear array size, \dthrow{} is the wobbler throw
and \dbase{} is the size of blanked sky used for baselining. The rows of
the map (\ie{} the subscans) are scanned at constant velocity, \vlin{}. The
size of the row will be \dparatot{}. Each row will be an independent
subscan of duration \tsubscan{}. The separation between two rows will be
\rowsep{}. If the area to be mapped is called \Amap{}, the time to cover it
once is called \tcover{} and the number of subscans per coverage is called
\nsubscancov{}, the following relationships hold
\begin{equation}
  \Amap = \nsubscancov\,\rowsep\,\dparatot
  \quad \mbox{with} \quad
  \nsubscancov = \ceil\paren{\frac{\dperptot}{\rowsep}+1};
\end{equation}
\begin{equation}
  \dparatot = \vlin\,\tsubscan
  \quad \mbox{and} \quad
  \tcover = \nsubscancov\,\tsubscan;
\end{equation}
\begin{equation}
  \Amap = \tcover\,\rowsep\,\vlin.
\end{equation}
Note that the grouping of the subscans in coverages is independent of the
grouping of the subscans in scans, \eg{} the same scan can finish a
coverage of the source and start a new one.

\subsection{EKH vs shift-and-add restoration}

Two kinds of restoration algorithms for wobbler switched data are
available: The EKH~\cite{emerson79} and shift-and-add algorithms. EKH is
much more elaborated and it enables to recover all the source structure as
long as the source stays undetected at the edges of the map along the
scanning direction. However, it works well only for relatively small source
size (\ie{} $\dparasou < 0.5^\circ$). Now, there are scientific projects
which search for point sources (at least sources whose size is smaller than
the half wobbler throw) on much larger sky areas. For these (\ie{} search
for point sources on very large field of views), the shift-and-add
restoration method works well.

We thus offer the user the following choice:
\begin{description}
\item[EKH restoration] The PI must give the source size in both
  perpendicular directions: $\dparasou \times \dperpsou$. The PI can
  request \nsource{} unrelated sources in this mode (the sources must share
  the same pointing calibrator...).
\item[Shift-and-add restoration] The PI must give the sizes of the final
  mosaic: $\dparamos \times \dperpmos$. We then assume that this area will
  be observed in square submaps, whose typical duration is set to
  \dsubmap{} so that $\dcal/\dsubmap$ is an integer number. If we define
  $\dedge = \darray+\dthrow+\dbase$, we then find the size \Dsubmap{}
  through the following equation:
  \begin{equation}
    \Dsubmap\,(\Dsubmap+\dedge) = \dsubmap\,\rowsep\,\vlin.
  \end{equation}
  This second order equation has a single physical solution
  \begin{equation}
    \Dsubmap = \frac{\sqrt{\dist[2]{edge}+4\dsubmap\,\rowsep\,\vlin}-\dedge}{2}.
  \end{equation}
  There are then two cases:
  \begin{enumerate}
  \item If $\dparamos\,\dperpmos \le \dist[2]{submap}$, then we use the user
    inputs:
    \begin{eqnarray}
      \dperptot & = & \dperpmos, \\
      \dparatot & = & \dparamos + \darray + \dthrow + \dbase,\\
      \nsource  & = & 1.
    \end{eqnarray}
  \item Else we use:
    \begin{eqnarray}
      \dperptot & = & \Dsubmap, \\
      \dparatot & = & \Dsubmap + \darray + \dthrow + \dbase,\\
      \nsource  & = & \frac{\dparamos\,\dperpmos}{\dist[2]{submap}}.
    \end{eqnarray}
    We note that in this case, \nsource{} is not a real number of sources
    in this case. It is a number of submap and it thus does not need to be
    an integer.
  \end{enumerate}
\end{description}

\subsection{Associated noise}

When mapping, the noise per independent resolution element in the map
(\noisebeam) is given by
\begin{equation}
  \noisebeam = \frac{\nefd\,\exp\paren{\A\,\tauzen}}{\sqrt{\tsigbeam}}
  \quad \mbox{with} \quad
  \tsigbeam = \frac{\ncover\,\tcover}{\nbeambol},
\end{equation}
where \tsigbeam{} is the total integration time per independent resolution
element, \ncover{} is the number of repeated coverages and \nbeambol{} is
the number of independent resolution elements per bolometer of the
array. This number is easily obtained through
\begin{equation}
  \nbeambol = \frac{\Amap}{\nboltot\,\Abeam}
  \quad \mbox{with} \quad
  \nboltot = \nbolmax - \nboldead
  \quad \mbox{and} \quad
  \Abeam = \frac{\grideff\,\pi\,\beam^2}{4\,\ln(2)},
\end{equation}
where \nboltot{} is the total number of valid bolometers (equal to the
maximum number of bolometers minus the number of dead ones), \Abeam{} is
the solid angle of the resolution element in the map (assumed to be a
Gaussian), \grideff{} is the factor due to gridding and \beam{} is the
telescope full width at half maximum. Using the equations derived from the
mapping strategy, it is easy to obtain
\begin{equation}
  \noisebeam = \frac{\nefd}{\sqrt{\nboltot\,\Abeam}}\,\exp\paren{\A\,\tauzen}\,\sqrt{\frac{\rowsep\,\vlin}{\ncover}}.
\end{equation}
In the case of MAMBO,
\begin{equation}
  \frac{\nefd}{\sqrt{\nboltot\,\Abeam}} \simeq 0.2\,\mbox{(mJy/Beam)}\,\sqrt{\mbox{s}}\,/''.
\end{equation}
However, this noise value stands before any data processing. The
restoration will multiply the above noise level by the square root of the
number of chopper throws used to compute the brightness at any given
position. This makes the actual noise value dependent on the total map size
in the scanning direction. Moreover, the methods to restore the source are
not perfect\footnote{The imperfections are dominated by the baselining
  step.}. Altogether, we thus use
\begin{equation}
  \noise[actual] = \csf(\dparasou)\,\exp\paren{\A\,\tauzen}\,\sqrt{\frac{\rowsep\,\vlin}{\ncover}},
\end{equation}
where $\csf(\dparasou)$ value is deduced from the experience of the
previous bolometer pools with MAMBO at the IRAM-30m.

\subsection{Maximum number of subscans in a scan}

To compute the maximum number of subscans in a scan (\nsubscanmax{}), we
assume that the maximum duration of a scan is \dscan{} so that
$\dcal/\dscan$ is an integer number. The value \nsubscanmax{} is then
defined with
\begin{equation}
  \nsubscanmax\,(\tsubscan+\tsubscanover)+\tscanover \le \dscan
  \quad \mbox{or} \quad
  \nsubscanmax \le \frac{\dscan-\tscanover}{\tsubscan+\tsubscanover}.
\end{equation}

\section{Algorithms}

\subsection{Sensitivity estimation}

\begin{description}
\item[Step \#1: Initialization] Initialize the values of \efftel{},
  \dsubmap{}, \dscan{}, \dcal{}, \caloverhead{}, \tpointing{}, \tfocus{},
  \tskydips{}, \tscanover{}, \tsubscanover{}, \darray{}, \dthrow{},
  \dbase{}, etc...
\item[Step \#2: User input] Get the telescope time (\ttel{}), the number
  of sources (\nsource{}) and the elevation (\elev{}). For mapping, get the
  map sizes. There are two cases:
  \begin{description}
  \item[EKH restoration] The following checks and computations must be done.
    \begin{eqnarray}
      \dparasou &\le& 0.5^\circ,\\
      \dperptot & = & \dperpsou, \\
      \dparatot & = & \dparasou + \darray + \dthrow + \dbase\\
      \csf & = & \mbox{an empirical increasing function of \dparasou{}.}
    \end{eqnarray}
  \item[Shift-and-add restoration] The following checks and computations must be done.
    \begin{enumerate}
    \item \csf{} is set to the minimum of the empirical increasing function
      of \dparasou{} because this restoration algorithm assumes that the
      restored sources are almost point-like.
    \item $\Dsubmap = 0.5\,\paren{\sqrt{\dist[2]{edge}+4\dsubmap\,\rowsep\,\vlin}-\dedge}$
      with $\dedge = \darray+\dthrow+\dbase$.
    \item If $\dparamos\,\dperpmos \le \dist[2]{submap}$, then
      \begin{eqnarray}
        \dperptot & = & \dperpmos, \\
        \dparatot & = & \dparamos + \darray + \dthrow + \dbase,\\
        \nsource  & = & 1.
      \end{eqnarray}
    \item Else
      \begin{eqnarray}
        \dperptot & = & \Dsubmap, \\
        \dparatot & = & \Dsubmap + \darray + \dthrow + \dbase,\\
        \nsource  & = & \frac{\dparamos\,\dperpmos}{\dist[2]{submap}}.
      \end{eqnarray}
      We note that in this case, \nsource{} is not here a real number of
      source but more a number of submap: It does not need to be an
      integer.
    \end{enumerate}
  \end{description}
\item[Step \#3: Computation of \ncal{} and \tsource{}] \mbox{}
  \begin{eqnarray}
    1. & & \ncal = \ceil \paren{\frac{\efftel\,\ttel}{\dcal+\tcal}}, \\
    2. & & \tsource = \frac{\efftel\,\ttel-\ncal\,\tcal}{\nsource}.
  \end{eqnarray}
  If $\tsource < 0$, then return the following error message: ``The
  telescope time must at least be $\tcal/\efftel$.''
\item[Step \#4: Computation of \tsubscan{}, \nsubscanmax{} and \tscan{}] \mbox{}
  \begin{description}
  \item[OnOff] \mbox{}
    \begin{eqnarray}
      1. & & \mbox{\tsubscan{} and \nsubscanmax{} are fixed,}\\
      2. & & \tscan = \nsubscanmax \, (\tsubscan + \tsubscanover) + \tscanover.
    \end{eqnarray}
  \item[Mapping] \mbox{}
    \begin{eqnarray}
      1. & & \tsubscan = \frac{\dparatot}{\vlin},\\
      2. & & \nsubscanmax = \floor\paren{\frac{\dscan-\tscanover}{\tsubscan+\tsubscanover}},\\
      3. & & \mbox{if} \quad \nsubscanmax < 1, \quad \mbox{then send an error message advising to increase \dscan,}\\
      4. & & \tscan = \nsubscanmax \, (\tsubscan + \tsubscanover) + \tscanover.
    \end{eqnarray}
  \end{description}

\item[Step \#5: Computation of \nscan{}, \nsubscanres{} and \nsubscantot{}] \mbox{}
  \begin{eqnarray}
    1. & & \nscan = \floor\paren{\frac{\tsource}{\tscan}},\\
    2. & & \nsubscanres = \floor\paren{\frac{\tsource-\nscan\tscan-\tscanover}{\tsubscan+\tsubscanover}},\\
    3. & & \nsubscantot = \nscan \nsubscanmax + \nsubscanres.
  \end{eqnarray}
\item[Step \#6: Computation of \ncover{} (Mapping only)] \mbox{}
  \begin{eqnarray}
    1. & & \nsubscancov = \ceil\paren{\frac{\dperptot}{\rowsep}+1},\\
    2. & & \ncover = \floor\paren{\frac{\nsubscantot}{\nsubscancov}},\\
    3. & & \mbox{if} \quad \ncover < 1, \quad \mbox{then send an error
      message advising to increase \ttel{}},\\
    4. & & \nsubscantot = \ncover \, \nsubscancov.
  \end{eqnarray}
\item[Step \#7: Computation of actual \nscan{} and \nsubscanres{} (Mapping only)] \mbox{}
  \begin{eqnarray}
    1. & & \nscan = \floor\paren{\frac{\nsubscantot}{\nsubscanmax}}, \\
    2. & & \nsubscanres = \nsubscantot - \nscan \nsubscanmax.
  \end{eqnarray}
\item[Step \#8: Computation of \noise{}] \mbox{}
  \begin{description}
  \item[OnOff] 
    \begin{eqnarray}
      1. & & \tsig = (\nscan \, \nsubscanmax + \nsubscanres) \, \tsubscan,\\
      2. & & \noise = \frac{\nefd\,\exp\paren{\A\,\tauzen}}{\sqrt{\tsig}}.
    \end{eqnarray}
  \item[Mapping]
    \begin{equation}
      \noise = \csf\,\exp\paren{\A\,\tauzen}\,\sqrt{\frac{\rowsep\,\vlin}{\ncover}},
    \end{equation}
  \end{description}
\item[Step \#9: Computation of the actual \tsource{}, \ncal{} and \ttel{}]
  We note that 1) the actual number of scan is $\nscan+1$ when
  $\nsubscanres \ge 1$ and \nscan{} when $\nsubscanres = 0$ and 2) the true
  elapsed telescope time might be smaller than the user input.
  \begin{eqnarray}
    1. & & \tsource = \nscan\,\tscan + \bracket{\nsubscanres (\tsubscan+\tsubscanover) + \tscanover},\\
    2. & & \ncal = \ceil\paren{\frac{\nsource\,\tsource}{\dcal}},\\
    3. & & \ttel = \frac{\nsource\,\tsource + \ncal\,\tcal}{\efftel}.
  \end{eqnarray}
\end{description}
The noise computation is done for three different values of \tauzen{}
(excellent, good and average conditions).

\subsection{Time estimation}

\begin{description}
\item[Step \#1: Initialization] Initialize the values of \efftel{},
  \dsubmap{}, \dscan{}, \dcal{}, \caloverhead{}, \tpointing{}, \tfocus{},
  \tskydips{}, \tscanover{}, \tsubscanover{}, \darray{}, \dthrow{},
  \dbase{}, etc...
\item[Step \#2: User input] Get the rms noise (\noise{}), the number
  of sources (\nsource{}) and the elevation (\elev{}). For mapping, get the
  map sizes and transform them using the same formula as Step
  \#2 in the sensitivity estimation.
\item[Step \#3: Computation of \tsubscan{}, \nsubscanmax{} and \tscan{}] Same as Step
  \#4 in the sensitivity estimation.
\item[Step \#4: Computation of \nsubscantot{} from \noise{}] \mbox{}
  \begin{description}
  \item[OnOff] 
    \begin{eqnarray}
      1. & & \tsig = \bracket{\frac{\nefd\,\exp\paren{\A\,\tauzen}}{\noise}}^2,\\
      2. & & \nsubscantot = \ceil\paren{\frac{\tsig}{\tsubscan}}.
    \end{eqnarray}
  \item[Mapping] \mbox{}
    \begin{eqnarray}
      1. & & \ncover = \floor\cbrace{\rowsep\,\vlin\,\bracket{\frac{\csf\,\exp(\A\,\tauzen)}{\noise}}^2},\\
      2. & & \mbox{if} \quad \ncover < 1, \quad \mbox{then send an error message advising to decrease \noise{}},\\
      3. & & \nsubscancov = \ceil\paren{\frac{\dperptot}{\rowsep}+1},\\
      4. & & \nsubscantot = \ncover \nsubscancov.
    \end{eqnarray}
  \end{description}
\item[Step \#5: Computation of \nscan{} and \nsubscanres{}] Same as
  Step \#7 in the sensitivity estimation.
\item[Step \#6: Computation of \tsource{}, \ncal{} and \ttel{}] Same as
  Step \#9 in the sensitivity estimation.
\item[Step \#7: Computation of the actual noise] We note that the reached
  sensitivity will be slightly larger than requested by the user because of
  the ceil function in the computation of \nsubscanres{}. We thus recompute
  the sensitivity as in the Step \#8 of the sensitivity estimation.
\end{description}
All these computations are done for three different values
of \tauzen{} (excellent, good and average conditions).

\section{Parameter values}

\begin{minipage}[t]{0.475\textwidth}
  \TabParams{} %
\end{minipage}
\begin{minipage}[t]{0.475\textwidth}
  \TabOpacities{} %
\end{minipage}\\
\bigskip{} %
\begin{minipage}[t]{0.585\textwidth}
  \TabMap{} %
\end{minipage}
\begin{minipage}[t]{0.375\textwidth}
  \TabArray{} %
\end{minipage}\\
\begin{minipage}[t]{0.375\textwidth}
  \TabOnOff{} %
\end{minipage}

\begin{thebibliography}{9}
  \expandafter\ifx\csname natexlab\endcsname\relax\def\natexlab#1{#1}\fi
  
\bibitem[{Emerson \etal{} 1979}]{emerson79} Emerson, D.~T., Klein, U. and
  Haslam, C.~G.~T., \emph{A\&A}, 1979, 76, 92.

\end{thebibliography}

\end{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

