source: trunk/docs/sourceParameterisation.tex @ 1441

Last change on this file since 1441 was 1437, checked in by MatthewWhiting, 7 years ago

Fixing equation typo as per #523

File size: 16.9 KB
Line 
1% -----------------------------------------------------------------------
2% outputs.tex: Section detailing the different forms of text- and
3%              plot-based output.
4% -----------------------------------------------------------------------
5% Copyright (C) 2006, Matthew Whiting, ATNF
6%
7% This program is free software; you can redistribute it and/or modify it
8% under the terms of the GNU General Public License as published by the
9% Free Software Foundation; either version 2 of the License, or (at your
10% option) any later version.
11%
12% Duchamp is distributed in the hope that it will be useful, but WITHOUT
13% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15% for more details.
16%
17% You should have received a copy of the GNU General Public License
18% along with Duchamp; if not, write to the Free Software Foundation,
19% Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
20%
21% Correspondence concerning Duchamp may be directed to:
22%    Internet email: Matthew.Whiting [at] atnf.csiro.au
23%    Postal address: Dr. Matthew Whiting
24%                    Australia Telescope National Facility, CSIRO
25%                    PO Box 76
26%                    Epping NSW 1710
27%                    AUSTRALIA
28% -----------------------------------------------------------------------
29\secA{Source Parameterisation}
30\label{sec-sourceparam}
31
32Once sources have been located, numerous measurements are made so that
33they can be placed in a catalogue. This section details each of the
34source parameters, explaining what they are and how they are
35calculated. Each parameter is referred to by the heading of the
36relevant column(s) in the output source list (see
37\S\ref{sec-output}).
38
39\secB{Object ID, \texttt{Obj\#}}
40\label{sec-objectID}
41
42The ID  of the detection is an integer, simply the sequential count for the
43list. The default is ordering by increasing spectral coordinate, or channel
44number, if the WCS is not good enough to determine the spectral world
45coordinate, but this can be changed by the \texttt{sortingParam} input
46parameter. See Sec~\ref{sec-results} for details.
47
48\secB{Object Name, \texttt{Name}}
49
50This is the ``IAU''-format name of the detection, derived from the WCS
51position if available.  For instance, a source that is centred on the
52RA,Dec position 12$^h$53$^m$45$^s$, -36$^\circ$24$'$12$''$ will be
53given the name J125345$-$362412, if the epoch is J2000, or the name
54B125345$-$362412 if it is B1950. The precision of the RA and Dec
55values is determined by the pixel size, such that sufficient precision
56is used to uniquely define a position. The RA value will have one
57figure greater precision than Dec.
58
59An alternative form is used for Galactic coordinates: a source centred
60on the position ($l$,$b$) = (323.1245, 5.4567) will be called
61G323.124$+$05.457.
62
63If the WCS is not valid (\ie is not present or does not have all the
64necessary information), the name will instead be of the form
65``ObjXXX'', where XXX is replaced with the objectID, padded
66sufficiently with zeros.
67
68\secB{Pixel locations}
69
70There are three ways in which the pixel location of the detection is
71calculated:
72\begin{itemize}
73\item Peak: the pixel value in which the detection has its peak
74  flux. Appears in the results file under columns \texttt{X\_peak,
75    Y\_peak, Z\_peak}.
76\item Average: the average over all detected pixels. Specifically,
77  $x_\text{av}=\sum x_i / N$ and similarly for $y_\text{av}$ and
78  $z_\text{av}$. Appears in the results file under columns \texttt{X\_av,
79    Y\_av, Z\_av}.
80\item Centroid: the flux-weighted average over all detected pixels. Specifically,
81  $x_\text{cent}=\sum F_i x_i / \sum F_i$ and similarly for $y_\text{cent}$ and
82  $z_\text{cent}$. Appears in the results file under columns \texttt{X\_cent,
83    Y\_cent, Z\_cent}.
84\end{itemize}
85
86All three alternatives are calculated, and written to the results
87file, but the choice of the \texttt{pixelCentre} input parameter will
88determine which option is used for the reference values \texttt{X, Y,
89  Z}.
90
91\secB{Spatial world location, \texttt{RA/GLON, DEC/GLAT}}
92
93These are the conversion of the \texttt{X} and \texttt{Y} pixel
94positions to world coordinates (that is, the pixel position determined
95by \texttt{pixelCentre}). These will typically be Right Ascension and
96Declination, or Galactic Longitude and Galactic Latitude, but the
97actual names used in the output file will be taken from the WCS
98specification.
99
100If there is no useful WCS, these are not calculated.
101
102\secB{Spectral world location, \texttt{VEL}}
103\label{sec-vel}
104
105The conversion of the \texttt{Z} pixel position to the spectral world
106coordinates. This is dictated by the WCS of the FITS file plus the
107input parameter \texttt{spectralType}. The name of the output column
108will come from the CTYPE of the spectral axis (or
109\texttt{spectralType} -- see \S\ref{sec-wcs}), specifically , the
110  4-character S-type code) (\ie not necessarily ``VEL'')
111
112The spectral units can be specified by the user, using the input
113parameter \texttt{spectralUnits} (enter it as a single string with no
114spaces). The default value comes from the FITS header.
115
116\secB{Spatial size, \texttt{MAJ, MIN, PA}}
117\label{sec-shape}
118
119The spatial size of the detection is measured from the moment-0 map
120(in the case of three-dimensional data) or the two-dimensional image,
121and is parameterised by the FWHM of the major and minor axes, plus the
122position angle of the major axis.
123
124The position angle will be measured in the usual astronomical sense,
125in degrees East of North. The major and minor axes will be specified
126in angular units (assuming the WCS allows this), with the units chosen
127such that the numbers are not too small.
128
129The method for calculating these parameters is to form the moment-0
130map (if necessary), select all pixels greater than half the maximum
131\footnote{In the event of a negative search (see
132  \S\ref{sec-searchTechnique}), the moment map is inverted prior to
133  this selection.},
134then calculate the parameters $a$ (major FWHM), $b$ (minor FWHM) and
135$\theta$ (position angle) according to
136\begin{eqnarray*}
137\frac{1}{2} a^2  &= & S_{xx} + S_{yy} + \sqrt{ (S_{xx} -
138  S_{yy})^2 + 4 (S_{xy})^2}\\
139\frac{1}{2} b^2  &= & S_{xx} + S_{yy} - \sqrt{ (S_{xx} -
140  S_{yy})^2 + 4 (S_{xy})^2}\\
141\tan 2\theta &= &\frac{2 S_{xy}}{S_{xx} - S_{yy}}
142\end{eqnarray*}
143where the sums $S_{xx}$, $S_{yy}$ and $S_{xy}$ are calculated in one
144of two ways. First, the algorithm tries to weight each pixel by its
145flux:
146\begin{eqnarray*}
147S_{xx} &= &\sum F_i x_i^2 / \sum F_i\\
148S_{yy} &= &\sum F_i y_i^2 / \sum F_i\\
149S_{xy} &= &\sum F_i x_i y_i / \sum F_i
150\end{eqnarray*}
151Mostly, this will work. But there can be situations where the
152calculated value of $b^2$ is negative (that is, $S_{xx}+S_{yy} <
153\sqrt{(S_{xx}-S_{yy})^2+4S_{xy}^2}$, or $S_{xx}S_{yy}<S_{xy}^2$). These situations are
154often where the moment-0 map is very disordered with no clear primary
155axis.
156
157In this case, the calculation of the sums is redone without the flux
158weighting ($S_{xx} = \sum x_i^2$ etc), and the shape parameters
159recalculated. A \textbf{W} flag will be recorded for the detection to
160indicate that the weighting failed: see \S\ref{sec-flags} below.
161
162It is possible that this second calculation will fail, particuarly for
163sources with only a small number of spatial pixels. In this case, we
164revert to using the method of principle axes.
165
166We first calculate the angle of minimum moment and assign this as the
167position angle. This is defined by calculating the net moments:
168\begin{eqnarray*}
169M_{xx} &= & \sum x_i^2 - \frac{1}{N} \left(\sum x_i\right)^2\\
170M_{yy} &= & \sum y_i^2 - \frac{1}{N} \left(\sum y_i\right)^2\\
171M_{xy} &= & \sum x_i y_i - \frac{1}{N} \sum x_i \sum y_i\\
172\end{eqnarray*}
173then
174\[
175\tan \theta = \frac{(M_{xx} - M_{yy} + \sqrt{(M_{xx}-M_{yy})^2+4M_{xy}})}{2M_{xy}}.
176\]
177To find the sizes of the principle axes (the major axis aligning with
178the angle just calculated, and the minor being perpendicular to it),
179we calculate the projection along these two axes of each pixel above
180half the peak in the moment-0 map, and take the range between the
181maximum and minimum, requiring it to be at least one pixel. Note this
182is not sensitive to the flux distribution. If this calculation is
183used, a \textbf{w} flag will be recorded for the detection: see
184\S\ref{sec-flags} below.
185
186
187\secB{Spatial extent, \texttt{w\_RA/w\_GLON, w\_DEC}}
188
189The extent of the detection in each of the spatial directions is also
190calculated. This is simply the angular width of the detection (in
191arcmin), converting the minimum and maximum values of $x$ (usually RA)
192and $y$ (Dec) to the world coordinates.
193
194\secB{Spectral width, \texttt{w\_50, w\_20, w\_VEL}}
195
196Several measures of the spectral extent of a detection are
197provided. The simplest is the full spectral width, calculated as for
198the spatial extents above. This is referred to as \texttt{w\_VEL}, but
199need not be velocity. It is obtained by taking the difference in world
200coordinates of the minimum and maximum values of $z$. The units are as
201described in \S\ref{sec-vel}.
202
203Two other measures of the spectral width are provided, \texttt{w\_50}
204and \texttt{w\_20}, being the width at 50\% and 20\% of the peak
205flux. These are measured on the integrated spectrum (\ie the spectra
206of all detected spatial pixels summed together), and are defined by
207starting at the outer spectral extent of the object (the highest and
208lowest spectral values) and moving in or out until the required flux
209threshold is reached. The widths are then just the difference between
210the two values obtained. If the detection threshold is greater than
21120\% or 50\% of the peak, then these values will be the same as
212\texttt{w\_VEL}.
213
214\secB{Source flux, \texttt{F\_tot, F\_int, F\_peak}}
215\label{sec-fluxparams}
216
217%% THE FOLLOWING IS FROM THE MNRAS PAPER
218%The flux of the source is given by the peak flux and both the ``total
219%flux'', defined above as $F_T$, and the ``integrated flux'' $F_I$, or
220%the total flux integrated over the spectral extent and corrected for
221%the beam:
222%\[
223%F_I = \frac{\sum F_i \Delta v_i}{B}
224%\]
225%where $B=\pi \alpha \beta / 4 \ln(2)$ is the area of a beam of major
226%and minor axes $\alpha$ and $\beta$ (in pixels), and $\Delta v_i$ is
227%the spectral width of each voxel.
228
229There are two measurements of the total flux of the detection. The
230simplest, \texttt{F\_tot}, is just the sum of all detected pixels in
231the image: $F_\text{tot}=\sum F_i$. The alternative, \texttt{F\_int},
232is the flux integrated over the detected pixels, taking into account
233the spectral range. For the case of velocity, the expression is
234$F_\text{int} = \sum F_i \Delta v_i$, where $\Delta v_i$ is the
235velocity width of the channel containing pixel $i$. The actual units
236of the spectral range are as described in \S\ref{sec-vel}.
237
238When the cube brightness units are quoted per beam (\eg Jy/beam), then
239the integrated flux \texttt{F\_int} includes a correction for
240this. This involves dividing by the integral over the beam. This is
241calculated using the BMAJ, BMIN \& BPA header keywords from the FITS
242file. BMAJ and BMIN are assumed to be the full-width at half maximum
243(FWHM) in the major and minor axis directions of a Gaussian beam. The
244integral is calculated as follows: the functional form of a 2D
245elliptical Gaussian can be written as
246$\exp(-((x^2/2\sigma_x^2)+(y^2/2\sigma_y^2)))$, and the FWHM in a
247given direction is then $f=2\sqrt{2\ln2}\sigma$. Then, $F_\text{int} =
248(\sum F_i \Delta v_i)/C$, where
249\[
250C = \int\exp\left(-\left(\frac{x^2}{2\sigma_x^2}+\frac{y^2}{2\sigma_y^2}\right)\right)
251= 2\pi\sigma_x\sigma_y
252=\frac{\pi f_x f_y}{4\ln2}
253\]
254(with $f_x=\text{BMAJ}$ and $f_y=\text{BMIN}$) provides the correction
255factor to go from units of Jy/beam to Jy.
256
257If the FITS file does not have the beam information, the user can
258either:
259\begin{enumerate}
260\item Specify the FWHM of the beam in pixels (assuming a circular
261  beam) via the parameter \texttt{beamFWHM}.
262\item Specify the area of the beam, again in pixels, via the parameter
263  \texttt{beamArea}\footnote{Note that this is equivalent to the old
264    parameter \texttt{beamSize}, which was highlighted as being
265    ambiguous.}. This should be the value given by the equation above.
266\end{enumerate}
267If both are given, \texttt{beamFWHM} takes precendence. If neither are
268given, and there is no beam information in the header, then no
269correction to the integrated flux is made (and so it will stay in
270units of Jy/beam or equivalent).
271
272Note that these parameters are measured using \textit{only the
273  detected pixels}. The summing of the flux will not include voxels
274that fall below the detection (or growth) threshold -- which is in
275accord with the definition of the threshold as dividing source and
276non-source voxels. If the threshold is not low enough, this will bias
277the measurement of the fluxes. This applies to all parameters (with
278the exception of the \texttt{w\_50} and \texttt{w\_20} widths, which
279are measured from the integrated spectrum, including channels not
280necessarily forming part of the detection).
281
282Finally, the peak flux \texttt{F\_peak} is simply the maximum value of
283the flux over all the detected pixels.
284
285
286\secB{Error on total/integrated flux, \texttt{eF\_tot, eF\_int}}
287
288Both \texttt{F\_tot} and \texttt{F\_int} can also have their
289associated error calculated (\texttt{eF\_tot} and \texttt{eF\_int}
290respectively). This is the random error due to the noise in the image,
291and is simply the sum in quadrature of the noise on each of the
292voxels, and, in the case of \texttt{F\_int} multiplied by the spectral
293width and corrected for the beam if necessary. Since we assume a
294constant noise level in the image ($\sigma_i=\sigma\  \forall i$), we
295have:
296\begin{eqnarray*}
297eF_\text{int} &= & \sqrt{\sum\sigma_i^2} \\&= &\sigma \sqrt{N}\\
298eF_\text{tot} &= & \sqrt{\sum C^2\sigma_i^2 \Delta v_i^2} \\&= &C \sigma
299\sqrt{N} \Delta v \text{ (for the case of $\Delta v_i = \Delta v$)}
300\end{eqnarray*}
301In the case that a flux threshold is provided, these quantities are
302not calculated, since we don't measure the image noise
303statistics. Likewise, when the array is smoothed we measure the noise
304only in the smoothed image, and this value is not applicable to the
305flux measured from the original image, so the errors are not
306reported.
307
308
309\secB{Peak signal-to-noise, \texttt{S/Nmax}}
310
311This parameter converts the peak flux to a signal-to-noise value,
312based on the measured noise level in the image. As for the error
313quantities above, if no noise is measured (\ie a flux threshold is
314provided by the user), then this is not calculated.
315
316When the array is pre-processed (via smoothing or wavelet
317reconstruction), we take the peak flux here to be the peak in the
318smoothed or reconstructed array. This is because this is where the
319detection is made, and so the \texttt{S/Nmax} value can be directly
320compared to the requested signal-to-noise threshold. Note that the
321peak flux discussed in \S\ref{sec-fluxparams} is always measured from
322the original image array.
323
324\secB{Pixel ranges, \texttt{X1, X2, Y1, Y2, Z1, Z2}}
325
326These quantities give the range of pixel values spanned by the
327detection in each of the three axes. \texttt{X1, Y1, Z1} give the
328minimum pixel in each direction, while \texttt{X2, Y2, Z2} give the
329maximum pixel.
330
331\secB{Size, \texttt{Nvoxel, Nchan, Nspatpix}}
332
333The number of detected pixels that make up the detection. These
334quantities show the total number of voxels in the detection
335(\texttt{Nvoxel}), the number of distinct spectral channels
336(\texttt{Nchan}) and the number of distinct spatial pixels
337(\texttt{Nspatpix}).
338
339Note that \texttt{Nchan} here is different to the quantity tested by
340the input parameter \texttt{minChannels} (see \S\ref{sec-reject}) --
341this looks at the maximum number of \textit{adjacent} channels, not
342the total.
343
344\secB{Warning Flags, \texttt{Flag}}
345\label{sec-flags}
346
347The detection can have warning flags recorded, to highlight potential
348issues:
349\begin{itemize}
350\item \textbf{E} -- The detection is next to the spatial edge of the
351  image, meaning either the limit of the pixels, or the limit of the
352  non-BLANK pixel region.
353\item \textbf{S} -- The detection lies at the edge of the spectral
354  region.
355\item \textbf{F} -- The detection is adjacent to, or overlaps one or
356  more flagged channels (see \S\ref{sec-flagging}).
357\item \textbf{N} -- The total flux, summed over all the (non-BLANK)
358  pixels in the smallest box that completely encloses the detection,
359  is negative. Note that this sum is likely to include non-detected
360  pixels. It is of use in pointing out detections that lie next to
361  strongly negative pixels, such as might arise due to interference --
362  the detected pixels might then also be due to the interference, so
363  caution is advised.
364\item \textbf{W} -- The weighting of fluxes in the shape calculation
365  (Sec~\ref{sec-shape}) failed, so the unweighted calculation was
366  used. This likely indicates some very disordered shape for the
367  moment-0 map.
368\item \textbf{w} -- The unweighted calculation also failed, most
369  likely because there are too few pixels. In this case, we use the
370  alternate method of principle axes to estimate the shape.
371\end{itemize}
372In the absence of any of these flags, a \textbf{-} will be recorded.
373
374
375%%% Local Variables:
376%%% mode: latex
377%%% TeX-master: "Guide"
378%%% End:
Note: See TracBrowser for help on using the repository browser.