source: trunk/docs/intro.tex @ 285

Last change on this file since 285 was 285, checked in by Matthew Whiting, 17 years ago

Changes worth talking about are:

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