Position.rst 14.3 KB
Newer Older
1
2
.. File Position.rst

3
4
.. _position_iso:

5
6
Position and shape parameters derived from the isophotal profile
================================================================
7
8

The following parameters are derived from the spatial distribution
9
10
11
12
:math:`\cal S` of pixels detected above the analysis threshold (see :ref:`description<isophotal_measurements>`).

.. important::
  Unless otherwise noted, pixel values :math:`I_i` are taken from the (filtered) detection image.
13

14
15
.. note::
  Unless otherwise noted, all parameter names given below are only prefixes. They must be followed by _IMAGE if the results shall be expressed in pixel coordinates or _WORLD, _SKY, _J2000 or _B1950 for |WCS|_ coordinates (see :ref:`coord_suffix`).
16
17
18
19
20
21
22
23

Limits: XMIN, YMIN, XMAX, YMAX
------------------------------

These coordinates define two corners of a rectangle which encloses the
detected object:

.. math::
24
  :label: xminymax
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

   \begin{aligned}
   {\tt XMIN} & = & \min_{i \in {\cal S}} x_i,\\
   {\tt YMIN} & = & \min_{i \in {\cal S}} y_i,\\
   {\tt XMAX} & = & \max_{i \in {\cal S}} x_i,\\
   {\tt YMAX} & = & \max_{i \in {\cal S}} y_i,
   \end{aligned}

where :math:`x_i` and :math:`y_i` are respectively the x-coordinate and
y-coordinate of pixel :math:`i`.

Barycenter: X, Y
----------------

Barycenter coordinates generally define the position of the “center” of
a source, although this definition can be inadequate or inaccurate if
its spatial profile shows a strong skewness or very large wings. X and Y
are simply computed as the first order moments of the profile:

.. math::
45
  :label: xy
46
47
48

   \begin{aligned}
   {\tt X} & = & \overline{x} = \frac{\displaystyle \sum_{i \in {\cal S}}
49
50
51
   I_i x_i}{\displaystyle \sum_{i \in {\cal S}} I_i},\\
   {\tt Y} & = & \overline{y} = \frac{\displaystyle \sum_{i \in {\cal S}}
   I_i y_i}{\displaystyle \sum_{i \in {\cal S}} I_i}.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
   \end{aligned}

In practice, :math:`x_i` and :math:`y_i` are summed relative to XMIN
and YMIN in order to reduce roundoff errors in the summing.

Position of the peak: XPEAK, YPEAK
----------------------------------

It is sometimes useful to have the position XPEAK,YPEAK of the pixel
with maximum intensity in a detected object, for instance when working
with likelihood maps, or when searching for artifacts. For better
robustness, PEAK coordinates are computed on *filtered* profiles if
available. On symmetrical profiles, PEAK positions and barycenters
coincide within a fraction of pixel (XPEAK and YPEAK coordinates are
66
quantized by steps of 1 pixel, thus XPEAK_IMAGE and YPEAK_IMAGE are
67
68
69
70
71
72
73
74
integers). This is no longer true for skewed profiles, therefore a
simple comparison between PEAK and barycenter coordinates can be used to
identify asymmetrical objects on well-sampled images.

2nd order moments: X2, Y2, XY
-----------------------------

(Centered) second-order moments are convenient for measuring the spatial
75
spread of a source profile. In |SExtractor| they are computed with:
76
77

.. math::
78
  :label: x2y2
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

   \begin{aligned}
   {\tt X2} & = \overline{x^2} = & \frac{\displaystyle \sum_{i \in {\cal
   S}} I_i x_i^2}{\displaystyle \sum_{i \in {\cal S}} I_i} -
   \overline{x}^2,\\ {\tt Y2} & = \overline{y^2} = & \frac{\displaystyle
   \sum_{i \in {\cal S}} I_i y_i^2}{\displaystyle \sum_{i \in {\cal S}}
   I_i} - \overline{y}^2,\\ {\tt XY} & = \overline{xy} = &
   \frac{\displaystyle \sum_{i \in {\cal S}} I_i x_i y_i}{\displaystyle
   \sum_{i \in {\cal S}} I_i} - \overline{x}\,\overline{y},
   \end{aligned}

These expressions are more subject to roundoff errors than if the
1st-order moments were subtracted before summing, but allow both 1st and
2nd order moments to be computed in one pass. Roundoff errors are
however kept to a negligible value by measuring all positions relative
here again to XMIN and YMIN.

96
97
.. _shape_iso:

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Basic shape parameters: A, B, THETA
-----------------------------------

These parameters are intended to describe the detected object as an
elliptical shape. A and B are its semi-major and semi-minor axis
lengths, respectively. More precisely, they represent the maximum and
minimum spatial dispersion of the object profile along any direction.
THETA is the position-angle of the A axis relative to the first image
axis. It is counted positive in the direction of the second axis. Here
is how they are computed:

2nd-order moments can easily be expressed in a referential rotated from
the :math:`x,y` image coordinate system by an angle +\ :math:`\theta`:

.. math::
113
  :label: varproj
114
115
116
117
118
119
120
121
122
123
124
125
126
127

   \begin{array}{lcrrr}
   \overline{x_{\theta}^2} & = & \cos^2\theta\:\overline{x^2} & +\,\sin^2\theta\:\overline{y^2}
               & -\,2 \cos\theta \sin\theta\:\overline{xy},\\
   \overline{y_{\theta}^2} & = & \sin^2\theta\:\overline{x^2} & +\,\cos^2\theta\:\overline{y^2}
               & +\,2 \cos\theta \sin\theta\:\overline{xy},\\
   \overline{xy_{\theta}} & = & \cos\theta \sin\theta\:\overline{x^2} &
   -\,\cos\theta \sin\theta\:\overline{y^2} & +\,(\cos^2\theta -
   \sin^2\theta)\:\overline{xy}.
   \end{array}

One can find interesting angles :math:`\theta_0` for which the variance
is minimized (or maximized) along :math:`x_{\theta}`:

128
129
130
131
.. math::
  :label: theta0

  {\left.\frac{\partial \overline{x_{\theta}^2}}{\partial \theta} \right|}_{\theta_0} = 0,
132
133
134
135

which leads to

.. math::
136
  :label: theta0_2
137
138
139
140
141
142
143

   2 \cos\theta \sin\theta_0\:(\overline{y^2} - \overline{x^2})
       + 2 (\cos^2\theta_0 - \sin^2\theta_0)\:\overline{xy} = 0.

If :math:`\overline{y^2} \neq \overline{x^2}`, this implies:

.. math::
144
   :label: theta0_3
145
146
147
148
149
150

   \tan 2\theta_0 = 2 \frac{\overline{xy}}{\overline{x^2} - \overline{y^2}},

a result which can also be obtained by requiring the covariance
:math:`\overline{xy_{\theta_0}}` to be null. Over the domain
:math:`[-\pi/2, +\pi/2[`, two different angles — with opposite signs —
151
satisfy :eq:`theta0_3`. By definition, THETA is the position angle for
152
which :math:`\overline{x_{\theta}^2}` is *max*\ imized. THETA is
153
therefore the solution to :eq:`theta0_3`. that has the same sign as the
154
155
156
157
covariance :math:`\overline{xy}`. A and B can now simply be expressed
as:

.. math::
158
  :label: aimage
159
160
161
162
163
164

   \begin{aligned}
   {\tt A}^2 & = & \overline{x^2}_{\tt THETA},\ \ \ {\rm and}\\
   {\tt B}^2 & = & \overline{y^2}_{\tt THETA}.\end{aligned}

A and B can be computed directly from the 2nd-order moments, using the
165
following equations derived from :eq:`varproj` after some algebra:
166
167

.. math::
168
  :label: aimage_2
169
170
171
172

   \begin{aligned}
   {\tt A}^2 & = & \frac{\overline{x^2}+\overline{y^2}}{2}
       + \sqrt{\left(\frac{\overline{x^2}-\overline{y^2}}{2}\right)^2 + \overline{xy}^2},\\
173
   {\tt B}^2 & = & \frac{\overline{x^2}+\overline{y^2}}{2},
174
175
176
       - \sqrt{\left(\frac{\overline{x^2}-\overline{y^2}}{2}\right)^2 + \overline{xy}^2}.\end{aligned}

Note that A and B are exactly halves the :math:`a` and :math:`b`
177
178
parameters computed by the COSMOS image analyser :cite:`1980SPIE_264_208S`.
Actually, :math:`a` and :math:`b` are defined in :cite:`1980SPIE_264_208S`
179
as the semi-major and semi-minor axes of an elliptical shape with constant
180
surface brightness, which would have the same 2nd-order moments as the
181
analyzed object.
182

183
184
.. _ellipse_iso:

185
186
187
188
Ellipse parameters: CXX, CYY, CXY
---------------------------------

A, B and THETA are not very convenient to use when, for instance, one
189
wants to know if a particular |SExtractor| detection extends over some
190
191
192
193
194
195
position. For this kind of application, three other ellipse parameters
are provided; CXX, CYY and CXY. They do nothing more than describing the
same ellipse, but in a different way: the elliptical shape associated to
a detection is now parameterized as

.. math::
196
  :label: ellipse
197
198
199
200
201
202

   {\tt CXX} (x-\overline{x})^2 + {\tt CYY} (y-\overline{y})^2
       + {\tt CXY} (x-\overline{x})(y-\overline{y}) = R^2,

where :math:`R` is a parameter which scales the ellipse, in units of A
(or B). Generally, the isophotal limit of a detected object is well
203
represented by :math:`R\approx 3` (:numref:`fig_ellipse`). Ellipse
204
205
206
parameters can be derived from the 2nd order moments:

.. math::
207
  :label: ellipse_2
208
209
210
211
212
213
214
215
216
217
218
219

   \begin{aligned}
   {\tt CXX} & = & \frac{\cos^2 {\tt THETA}}{{\tt A}^2} + \frac{\sin^2
   {\tt THETA}}{{\tt B}^2} =
   \frac{\overline{y^2}}{\overline{x^2} \overline{y^2} - \overline{xy}^2}\\
   {\tt CYY} & = & \frac{\sin^2 {\tt THETA}}{{\tt
   A}^2} + \frac{\cos^2 {\tt THETA}}{{\tt B}^2} =
   \frac{\overline{x^2}}{\overline{x^2} \overline{y^2} - \overline{xy}^2}\\
   {\tt CXY} & = & 2 \,\cos {\tt THETA}\,\sin {\tt
   THETA} \left( \frac{1}{{\tt A}^2} - \frac{1}{{\tt B}^2}\right) = -2\,
   \frac{\overline{xy}}{\overline{x^2} \overline{y^2} - \overline{xy}^2}\end{aligned}

220
221
222
223
224
225
226
227
.. _fig_ellipse:

.. figure:: figures/ellipse.*
   :figwidth: 100%
   :align: center

   Meaning of shape parameters.

228
229
By-products of shape parameters: ELONGATION and ELLIPTICITY
-----------------------------------------------------------
230

231
These parameters [#elongation]_ are directly derived from A and B:
232
233

.. math::
234
  :label: elongation
235
236
237
238
239

   \begin{aligned}
   {\tt ELONGATION} & = & \frac{\tt A}{\tt B}\ \ \ \ \ \mbox{and}\\
   {\tt ELLIPTICITY} & = & 1 - \frac{\tt B}{\tt A}.\end{aligned}

240
241
.. _poserr:

242
243
Position uncertainties: ERRX2, ERRY2, ERRXY, ERRA, ERRB, ERRTHETA, ERRCXX, ERRCYY, ERRCXY
-----------------------------------------------------------------------------------------
244
245

Uncertainties on the position of the barycenter can be estimated using
246
247
248
249
250
photon statistics. In practice, such estimates are a lower-value of the full
uncertainties because they do not include, for instance, the contribution of
detection biases or contamination by neighbors. Furthermore, |SExtractor| does
not currently take into account possible correlations of the noise between adjacent
pixels. Hence variances simply write:
251
252

.. math::
253
  :label: errxy
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271

   \begin{aligned}
   {\tt ERRX2} & = {\rm var}(\overline{x}) = & \frac{\displaystyle
   \sum_{i \in {\cal S}} \sigma^2_i (x_i-\overline{x})^2} {\displaystyle
   \left(\sum_{i \in {\cal S}} I_i\right)^2},\\ {\tt ERRY2} & = {\rm
   var}(\overline{y}) = & \frac{\displaystyle \sum_{i \in {\cal S}}
   \sigma^2_i (y_i-\overline{y})^2} {\displaystyle \left(\sum_{i \in
   {\cal S}} I_i\right)^2},\\ {\tt ERRXY} & = {\rm
   cov}(\overline{x},\overline{y}) = & \frac{\displaystyle \sum_{i \in
   {\cal S}} \sigma^2_i (x_i-\overline{x})(y_i-\overline{y})}
   {\displaystyle \left(\sum_{i \in {\cal S}} I_i\right)^2}.\end{aligned}

:math:`\sigma_i` is the flux uncertainty estimated for pixel :math:`i`:

.. math:: \sigma^2_i = {\sigma_B}^2_i + \frac{I_i}{g_i},

where :math:`{\sigma_B}_i` is the local background noise and
:math:`g_i` the local gain — conversion factor — for pixel :math:`i`
272
(see :ref:`effect_of_weighting` for more details). Semi-major axis ERRA, semi-minor
273
274
275
276
277
axis ERRB, and position angle ERRTHETA of the :math:`1\sigma` position
error ellipse are computed from the covariance matrix exactly like in
[chap:abtheta] for shape parameters:

.. math::
278
  :label: errabtheta
279
280
281
282
283
284
285
286
287
288
289

   \begin{aligned}
   {\tt ERRA}^2 & = & \frac{{\rm var}(\overline{x})+{\rm var}(\overline{y})}{2}
       + \sqrt{\left(\frac{{\rm var}(\overline{x})-{\rm var}(\overline{y})}{2}\right)^2
       + {\rm cov}^2(\overline{x},\overline{y})},\\
   {\tt ERRB}^2 & = & \frac{{\rm var}(\overline{x})+{\rm var}(\overline{y})}{2}
       - \sqrt{\left(\frac{{\rm var}(\overline{x})-{\rm var}(\overline{y})}{2}\right)^2
       + {\rm cov}^2(\overline{x},\overline{y})},\\
   \tan (2{\tt ERRTHETA}) & = & 2 \,\frac{{\rm cov}(\overline{x},\overline{y})}
                       {{\rm var}(\overline{x}) - {\rm var}(\overline{y})}.\end{aligned}

290
And the error ellipse parameters are:
291
292

.. math::
293
  :label: errellipse
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313

   \begin{aligned}
   {\tt ERRCXX} & = & \frac{\cos^2 {\tt ERRTHETA}}{{\tt ERRA}^2} +
   \frac{\sin^2 {\tt ERRTHETA}}{{\tt ERRB}^2} = \frac{{\rm
   var}(\overline{y})}{{\rm var}(\overline{x}) {\rm var}(\overline{y}) -
   {\rm cov}^2(\overline{x},\overline{y})},\\
   {\tt ERRCYY} & = & \frac{\sin^2 {\tt ERRTHETA}}{{\tt ERRA}^2} +
   \frac{\cos^2 {\tt ERRTHETA}}{{\tt ERRB}^2} =
   \frac{{\rm var}(\overline{x})}{{\rm var}(\overline{x}) {\rm var}(\overline{y}) -
   {\rm cov}^2(\overline{x},\overline{y})},\\
   {\tt ERRCXY} & = & 2 \cos {\tt
   ERRTHETA}\sin {\tt ERRTHETA} \left( \frac{1}{{\tt ERRA}^2} -
   \frac{1}{{\tt ERRB}^2}\right)\\ & = & -2 \frac{{\rm
   cov}(\overline{x},\overline{y})}{{\rm var}(\overline{x}) {\rm var}(\overline{y}) -
   {\rm cov}^2(\overline{x},\overline{y})}.\end{aligned}

Handling of “infinitely thin” detections
----------------------------------------

Apart from the mathematical singularities that can be found in some of
314
the above equations describing shape parameters (and which |SExtractor|
315
316
317
318
319
320
321
322
323
324
325
326
handles, of course), some detections with very specific shapes may yield
quite unphysical parameters, namely null values for B, ERRB, or even A
and ERRA. Such detections include single-pixel objects and horizontal,
vertical or diagonal lines which are 1-pixel wide. They will generally
originate from glitches; but very undersampled and/or low S/N genuine
sources may also produce such shapes.

For basic shape parameters, the following convention was adopted: if the
light distribution of the object falls on one single pixel, or lies on a
sufficiently thin line of pixels, which we translate mathematically by

.. math::
327
  :label: singutest
328
329
330
331

   \overline{x^2}\,\overline{y^2} - \overline{xy}^2 < \rho^2,

then :math:`\overline{x^2}` and :math:`\overline{y^2}` are incremented
332
by :math:`\rho`. |SExtractor| sets :math:`\rho=1/12`, which is the
333
334
variance of a 1-dimensional top-hat distribution with unit width.
Therefore :math:`1/\sqrt{12}` represents the typical minor-axis values
335
assigned (in pixels units) to undersampled sources in |SExtractor|.
336
337
338

Positional errors are more difficult to handle, as objects with very
high signal-to-noise can yield extremely small position uncertainties,
339
just like singular profiles do. Therefore |SExtractor| first checks that
340
:eq:`singutest` is true. If this is the case, a new test is conducted:
341
342

.. math::
343
  :label: singutest2
344
345
346
347
348
349

   {\rm var}(\overline{x})\,{\rm var}(\overline{y}) - {\rm
   covar}^2(\overline{x}, \overline{y}) < \rho^2_e,

where :math:`\rho_e` is arbitrarily set to :math:`\left( \sum_{i \in {\cal S}}
\sigma^2_i \right) / \left(\sum_{i \in {\cal S}} I_i\right)^2`. If
350
:eq:`singutest2` is true, then :math:`\overline{x^2}` and
351
352
:math:`\overline{y^2}` are incremented by :math:`\rho_e`.

353
.. [#elongation] These parameters are dimensionless, and for historical reasons do not accept suffixes such as _IMAGE or _WORLD.
354
355
356

.. include:: keys.rst