source: trunk/docs/intro.tex @ 303

Last change on this file since 303 was 303, checked in by Matthew Whiting, 17 years ago
  • Update the Outputs chapter to mention the use of F_tot.
  • Fixed comments in pgplot_related.c
  • Added distribution text to tex files.
File size: 13.6 KB
Line 
1% -----------------------------------------------------------------------
2% intro.tex: Introduction, and guide to what Duchamp is doing.
3% -----------------------------------------------------------------------
4% Copyright (C) 2006, Matthew Whiting, ATNF
5%
6% This program is free software; you can redistribute it and/or modify it
7% under the terms of the GNU General Public License as published by the
8% Free Software Foundation; either version 2 of the License, or (at your
9% option) any later version.
10%
11% Duchamp is distributed in the hope that it will be useful, but WITHOUT
12% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14% for more details.
15%
16% You should have received a copy of the GNU General Public License
17% along with Duchamp; if not, write to the Free Software Foundation,
18% Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
19%
20% Correspondence concerning Duchamp may be directed to:
21%    Internet email: Matthew.Whiting [at] atnf.csiro.au
22%    Postal address: Dr. Matthew Whiting
23%                    Australia Telescope National Facility, CSIRO
24%                    PO Box 76
25%                    Epping NSW 1710
26%                    AUSTRALIA
27% -----------------------------------------------------------------------
28\secA{Introduction and getting going quickly}
29
30This document provides a user's guide to \duchamp, an object-finder
31for use on spectral-line data cubes. The basic execution of \duchamp
32is to read in a FITS data cube, find sources in the cube, and produce
33a text file of positions, velocities and fluxes of the detections, as
34well as a postscript file of the spectra of each detection.
35
36\duchamp searches fro groups of connected voxels (or pixels) that are
37all above some flux threshold. No assumption is made as to the shape
38of detections, and the only size constraints applied are those
39specified by the user.
40
41\secB{What to do}
42
43So, you have a FITS cube, and you want to find the sources in it. What
44do you do? First, you need to get \duchamp: there are instructions in
45Appendix~\ref{app-install} for obtaining and installing it. Once you
46have it running, the first step is to make an input file that contains
47the list of parameters. Brief and detailed examples are shown in
48Appendix~\ref{app-input}. This file provides the input file name, the
49various output files, and defines various parameters that control the
50execution.
51
52The standard way to run \duchamp is by the command
53\begin{quote}
54{\footnotesize
55\texttt{> Duchamp -p [parameter file]}
56}
57\end{quote}
58replacing \texttt{[parameter file]} with the name of the file listing
59the parameters.
60
61An even easier way is to use the default values for all parameters
62(these are given in Appendix~\ref{app-param} and in the file
63\texttt{InputComplete} included in the distribution directory) and use
64the syntax
65\begin{quote}
66{\footnotesize
67\texttt{> Duchamp -f [FITS file]}
68}
69\end{quote}
70where \texttt{[FITS file]} is the file you wish to search.
71
72The default action includes displaying a map of detected objects in a
73PGPLOT X-window. This can be disabled by setting the parameter
74\texttt{flagXOutput = false} or using the \texttt{-x} command-line
75option, as in
76\begin{quote}
77{\footnotesize
78\texttt{> Duchamp -x -p [parameter file]}
79}
80\end{quote}
81and similarly for the \texttt{-f} case.
82
83Once a FITS file and parameters have been set, the program will then
84work away and give you the list of detections and their spectra. The
85program execution is summarised below, and detailed in
86\S\ref{sec-flow}. Information on inputs is in \S\ref{sec-param} and
87Appendix~\ref{app-param}, and descriptions of the output is in
88\S\ref{sec-output}.
89
90\secB{Guide to terminology and conventions}
91
92First, a brief note on the use of terminology in this guide. \duchamp
93is designed to work on FITS ``cubes''. These are FITS\footnote{FITS is
94the Flexible Image Transport System -- see \citet{hanisch01} or
95websites such as
96\href{http://fits.cv.nrao.edu/FITS.html}{http://fits.cv.nrao.edu/FITS.html}
97for details.} image arrays with (at least) three dimensions. They
98are assumed to have the following form: the first two dimensions
99(referred to as $x$ and $y$) are spatial directions (that is, relating
100to the position on the sky -- often, but not necessarily,
101corresponding to Equatorial or Galactic coordinates), while the third
102dimension, $z$, is the spectral direction, which can correspond to
103frequency, wavelength, or velocity. The three dimensional analogue of
104pixels are ``voxels'', or volume cells -- a voxel is defined by a
105unique $(x,y,z)$ location and has a single value of flux, intensity
106or brightness (or something equivalent) associated with it.
107
108Sometimes, some pixels in a FITS file are labelled as BLANK -- that
109is, they are given a nominal value, defined by FITS header keywords
110\textsc{blank, bscale, \& bzero}, that marks them as not having a flux
111value. These are often used to pad a cube out so that it has a
112rectangular spatial shape. \duchamp has the ability to avoid these:
113see \S\ref{sec-blank}.
114
115Note that it is possible for the FITS file to have more than three
116dimensions (for instance, there could be a fourth dimension
117representing a Stokes parameter). Only the two spatial dimensions and
118the spectral dimension are read into the array of pixel values that is
119searched for objects. All other dimensions are ignored\footnote{This
120actually means that the first pixel only of that axis is used, and the
121array is read by the \texttt{fits\_read\_subsetnull} command from the
122\textsc{cfitsio} library.}. Herein, we discuss the data in terms of
123the three basic dimensions, but you should be aware it is possible for
124the FITS file to have more than three. Note that the order of the
125dimensions in the FITS file does not matter.
126
127With this setup, each spatial pixel (a given $(x,y)$ coordinate) can
128be said to be a single spectrum, while a slice through the cube
129perpendicular to the spectral direction at a given $z$-value is a
130single channel, with the 2-D image in that channel called a channel
131map.
132
133Detection involves locating a contiguous group of voxels with fluxes
134above a certain threshold. \duchamp makes no assumptions as to the
135size or shape of the detected features, other than having
136user-selected minimum size criteria. Features that are detected are
137assumed to be positive. The user can choose to search for negative
138features by setting an input parameter -- this inverts the cube prior
139to the search (see \S\ref{sec-detection} for details).
140
141Finally, note that it is possible to run \duchamp on a
142two-dimensional image (\ie one with no frequency or velocity
143information), or indeed a one-dimensional array, and many of the
144features of the program will work fine. The focus, however, is on
145object detection in three dimensions, one of which is a spectral
146dimension.
147
148\secB{A summary of the execution steps}
149
150The basic flow of the program is summarised here -- all steps are
151discussed in more detail in the following sections.
152\begin{enumerate}
153\item The necessary parameters are recorded.
154
155  How this is done depends on the way the program is run from the
156  command line. If the \texttt{-p} option is used, the parameter file
157  given on the command line is read in, and the parameters therein are
158  read. All other parameters are given their default values (listed in
159  Appendix~\ref{app-param}).
160
161  If the \texttt{-f} option is used, all parameters are assigned their
162  default values.
163
164\item The FITS image is located and read in to memory.
165
166  The file given is assumed to be a valid FITS file. As discussed
167  above, it can have any number of dimensions, but \duchamp only
168  reads in the two spatial and the one spectral dimensions. A subset
169  of the FITS array can be given (see \S\ref{sec-input} for details).
170
171\item If requested, a FITS file containing a previously reconstructed
172  or smoothed array is read in.
173
174  When a cube is either smoothed or reconstructed with the \atrous
175  wavelet method, the result can be saved to a FITS file, so that
176  subsequent runs of \duchamp can read it in to save having to re-do
177  the calculations (as they can be relatively time-intensive).
178
179\item \label{step-blank} If requested, BLANK pixels are trimmed from
180  the edges, and the baseline of each spectrum is removed.
181
182  BLANK pixels, while they are ignored by all calculations in
183  \duchamp, do increase the size in memory of the array above that
184  absolutely needed. This step trims them from the spatial edges,
185  recording the amount trimmed so that they can be added back in
186  later.
187
188  A spectral baseline (or bandpass) can also be removed at this point
189  as well. This may be necessary if there is a ripple or other
190  large-scale feature present that will hinder detection of faint
191  sources.
192
193\item If the reconstruction method is requested, and the reconstructed
194  array has not been read in at Step 3 above, the cube is
195  reconstructed using the \atrous wavelet method.
196
197  This step uses the \atrous method to determine the amount of
198  structure present at various scales. A simple thresholding technique
199  then removes random noise from the cube, leaving the significant
200  signal. This process can greatly reduce the noise level in the cube,
201  enhancing the detectability of sources.
202
203\item Alternatively (and if requested), the cube is smoothed, either
204  spectrally or spatially.
205
206  This step presents two options. The first considers each spectrum
207  individually, and convolves it with a Hanning filter (with width
208  chosen by the user). The second considers each channel map
209  separately, and smoothes it with a Gaussian kernel of size and shape
210  chosen by the user. This step can help to reduce the amount of noise
211  visible in the cube and enhance fainter sources.
212
213\item A threshold for the cube is then calculated, based on the pixel
214  statistics (unless a threshold is manually specified by the user).
215
216  The threshold can either be chosen as a simple $n\sigma$ threshold
217  (\ie a certain number of standard deviations above the mean), or
218  calculated via the ``False Discovery Rate'' method. Alternatively,
219  the threshold can be specified as a simple flux value, without care
220  as to the statistical significance (\eg ``I want every source
221  brighter than 10mJy'').
222
223  By default, the full cube is used for the statistics calculation,
224  although the user can nominate a subsection of the cube to be used
225  instead.
226
227\item Searching for objects then takes place, using the requested
228  thresholding method.
229
230  The cube is searched one channel-map at a time. Detections are
231  compared to already detected objects and either combined with a
232  neighbouring one or added to the end of the list.
233
234\item The list of objects is condensed by merging neighbouring objects
235  and removing those deemed unacceptable.
236
237  While some merging has been done in the previous step, this process
238  is a much more rigorous comparison of each object with every other
239  one. If a pair of objects lie within requested limits, they are
240  combined.
241
242  After the merging is done, the list is culled (although see comment
243  for the next step). There are certain criteria the user can specify
244  that objects must meet: minimum numbers of spatial pixels and
245  spectral channels, and minimum separations between neighbouring
246  objects. Those that do not meet these criteria are deleted
247  from the list.
248
249\item If requested, the objects are ``grown'' down to a lower
250  threshold, and then the merging step is done a second time.
251
252  In this case, each object has pixels in its neighbourhood examined,
253  and if they are above a secondary threshold, they are added to the
254  object. The merging process is done a second time in case two
255  objects have grown over the top of one another. Note that the
256  rejection part of the previous step is not done until the end of the
257  second merging process.
258
259\item The baselines and trimmed pixels are replaced prior to output.
260
261  This is just the inverse of step~\#\ref{step-blank}.
262
263\item The details of the detections are written to screen and to the
264  requested output file.
265
266  Crucial properties of each detection are provided, showing its
267  location, extent, and flux. These are presented in both pixel
268  coordinates and world coordinates (\eg sky position and
269  velocity). Any warning flags are also printed, showing detections to
270  be wary of. Alternative output options are available, such as a
271  VOTable or a Karma annotation file.
272
273\item Maps showing the spatial location of the detections are written.
274
275  These are 2-dimensional maps, showing where each detection lies on
276  the spatial coverage of the cube. This is provided as an aid to the
277  user so that a quick idea of the distribution of object positions
278  can be gained \eg are all the detections on the edge?
279
280  Two maps are provided: one is a 0th moment map, showing the 0th
281  moment (\ie a map of the integrated flux) of each detection in its
282  appropriate position, while the second is a ``detection map'',
283  showing the number of times each spatial pixel was detected in the
284  searching routines (including those pixels rejected at step 9 and so
285  not in any of the final detections).
286
287  These maps are written to postscript files, and the 0th moment map
288  can also be displayed in a PGPLOT X-window.
289
290\item The integrated or peak spectra of each detection are written to a
291  postscript file.
292
293  The spectral equivalent of the maps -- what is the spectral profile
294  of each detection? Also provided here are basic information for each
295  object (a summary of the information in the results file), as well
296  as a 0th moment map of the detection.
297
298\item If requested, the reconstructed or smoothed array can be written
299  to a new FITS file.
300
301  If either of these procedures were done, the resulting array can be
302  saved as a FITS file for later use. The FITS header will be the same
303  as the input file, with a few additional keywords to identify the
304  file.
305
306\end{enumerate}
307
Note: See TracBrowser for help on using the repository browser.