PositionWin.rst 11.7 KB
Newer Older
1
2
.. File PositionWin.rst

Emmanuel Bertin's avatar
Emmanuel Bertin committed
3
4
.. include:: global.rst

5
6
7
Windowed positional parameters
==============================

8
Measurements performed through a *window* function (an *envelope*) do not have many of the drawbacks of isophotal measurements. |SExtractor| implements “windowed” versions for most
9
of the measurements described in the :ref:`previous section<pos_iso_def>`:
10
11

.. note::
Emmanuel Bertin's avatar
Emmanuel Bertin committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  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 :param:`_WORLD`, :param:`_SKY`, :param:`_J2000` or :param:`_B1950` for |WCS|_ coordinates (see :ref:`coord_suffix`).

+-------------------------------------------------+----------------------------------------------------------+
| Isophotal parameters                            | Equivalent windowed parameters                           |
+=================================================+==========================================================+
| :param:`X`, :param:`Y`                          | :param:`XWIN`, :param:`YWIN`                             |
+-------------------------------------------------+----------------------------------------------------------+
| :param:`ERRA`, :param:`ERRB`, :param:`ERRTHETA` | :param:`ERRAWIN`, :param:`ERRBWIN`, :param:`ERRTHETAWIN` |
+-------------------------------------------------+----------------------------------------------------------+
| :param:`A`, :param:`B`, :param:`THETA`          | :param:`AWIN`, :param:`BWIN`, :param:`THETAWIN`          |
+-------------------------------------------------+----------------------------------------------------------+
| :param:`X2`, :param:`Y2`, :param:`XY`           | :param:`X2WIN`, :param:`Y2WIN`, :param:`XYWIN`           |
+-------------------------------------------------+----------------------------------------------------------+
| :param:`CXX`, :param:`CYY`, :param:`CXY`        | :param:`CXXWIN`, :param:`CYYWIN`, :param:`CXYWIN`        |
+-------------------------------------------------+----------------------------------------------------------+

The computations involved are roughly the same except that the pixel values are integrated within a circular Gaussian window as opposed to
the object’s isophotal footprint.
The Gaussian window is scaled to each object; the Gaussian FWHM is the diameter of the disk that contains half of the object flux (:math:`d_{50}`).
Note that in double-image mode (§[chap:using]) the window is scaled based on the *measurement* image.
32

33
.. _pos_win_def:
34

Emmanuel Bertin's avatar
Emmanuel Bertin committed
35
36
Windowed centroid: :param:`XWIN`, :param:`YWIN`
-----------------------------------------------
37

Emmanuel Bertin's avatar
Emmanuel Bertin committed
38
39
40
This is an iterative process.
Computation starts by initializing the windowed centroid coordinates :math:`\overline{x_{\tt WIN}}^{(0)}` and :math:`\overline{y_{\tt WIN}}^{(0)}` to their basic :math:`\overline{x}` and :math:`\overline{y}` isophotal equivalents, respectively.
Then at each iteration :math:`t`, :math:`\overline{x_{\tt WIN}}` and :math:`\overline{y_{\tt WIN}}` are refined using:
41
42

.. math::
43
  :label: xywin
44
45
46
47
48
49
50
51
52

   \begin{aligned}
   {\tt XWIN}^{(t+1)} & = & \overline{x_{\tt WIN}}^{(t+1)}
   = \overline{x_{\tt WIN}}^{(t)} + 2\,\frac{\sum_{r_i^{(t)} < r_{\rm max}}
   w_i^{(t)} I_i \ (x_i  - \overline{x_{\tt WIN}}^{(t)})}
   {\sum_{r_i^{(t)} < r_{\rm max}} w_i^{(t)} I_i},\\
   {\tt YWIN}^{(t+1)} & = & \overline{y_{\tt WIN}}^{(t+1)}
   = \overline{y_{\tt WIN}}^{(t)} + 2\,\frac{\sum_{r_i^{(t)} < r_{\rm max}}
   w_i^{(t)} I_i\ (y_i - \overline{y_{\tt WIN}}^{(t)})}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
53
54
   {\sum_{r_i^{(t)} < r_{\rm max}} w_i^{(t)} I_i},
   \end{aligned}
55
56
57

where

58
59
60
61
.. math::
  :label: wi_t

  w_i^{(t)} = \exp \left(-\frac{r_i^{(t)^2}}{2s_{\tt WIN}^2} \right),
62
63
64
65

with

.. math::
66
  :label: ri_t
67
68
69
70

   r_i^{(t)} = \sqrt{\left(x_i - \overline{x_{\tt WIN}}^{(t)}\right)^2 + \left(y_i
   - \overline{y_{\tt WIN}}^{(t)}\right)^2}

Emmanuel Bertin's avatar
Emmanuel Bertin committed
71
72
73
74
75
76
and :math:`s_{\tt WIN} = d_{50} / \sqrt{8 \ln 2}`.
Process stops when the change in position between two iterations is less than :math:`2\times10^{-4}` pixel, a condition which is achieved in about 3 to 5 iterations in practice.

Although they are slower, it is recommended to use whenever possible windowed position parameters instead of their isophotal equivalents; the measurements they provide are generally much more accurate (:numref:`fig_xwinprec`).
The centroiding accuracy of :param:`XWIN_IMAGE` and :param:`YWIN_IMAGE` is actually very close to that of PSF-fitting on focused and properly sampled star images. Windowed measurements can also be applied to galaxies.
It has been verified that for isolated objects with Gaussian-like profiles, their accuracy is close to the theoretical limit set by image noise [#win_accuracy]_.
77
78
79
80
81
82
83

.. _fig_xwinprec:

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

Emmanuel Bertin's avatar
Emmanuel Bertin committed
84
85
86
   Comparison between isophotal and windowed centroid measurement residuals on simulated, background noise-limited images.
   *Left*: histogram of the difference between :param:`X_IMAGE` and the true centroid in x.
   *Right*: histogram of the difference between :param:`XWIN_IMAGE` and the true centroid in x.
87

88
89
.. _moments_win_def:

Emmanuel Bertin's avatar
Emmanuel Bertin committed
90
91
Windowed 2nd order moments: :param:`X2`, :param:`Y2`, :param:`XY`
-----------------------------------------------------------------
92

93
Windowed second-order moments are computed on the image data once the :ref:`centering process <pos_win_def>` has converged:
94
95

.. math::
96
  :label: x2y2win
97
98
99
100
101
102
103
104
105
106
107
108
109

   \begin{aligned}
   {\tt X2WIN} & = \overline{x_{\tt WIN}^2}
   = & \frac{\sum_{r_i < r_{\rm max}} w_i I_i (x_i - \overline{x_{\tt WIN}})^2}
   {\sum_{r_i < r_{\rm max}} w_i I_i},\\
   {\tt Y2WIN} & = \overline{y_{\tt WIN}^2}
   = & \frac{\sum_{r_i < r_{\rm max}} w_i I_i (y_i - \overline{y_{\tt WIN}})^2}
   {\sum_{r_i < r_{\rm max}} w_i I_i},\\
   {\tt XYWIN} & = \overline{xy_{\tt WIN}}
   = & \frac{\sum_{r_i < r_{\rm max}} w_i I_i (x_i - \overline{x_{\tt WIN}})
   (y_i - \overline{y_{\tt WIN}})}
   {\sum_{r_i < r_{\rm max}} w_i I_i}.\end{aligned}

Emmanuel Bertin's avatar
Emmanuel Bertin committed
110
Windowed second-order moments are typically twice smaller than their isophotal equivalent.
111

112
113
.. _shape_win_def:

Emmanuel Bertin's avatar
Emmanuel Bertin committed
114
115
Windowed shape parameters: :param:`AWIN`, :param:`BWIN`, :param:`THETAWIN`
--------------------------------------------------------------------------
116
117

They are computed from the windowed 2nd order moments exactly the same
Emmanuel Bertin's avatar
Emmanuel Bertin committed
118
way as in :eq:`theta0_3` and :eq:`aimage_2` from the :ref:`isophotal shape parameter<shape_iso_def>` section:
119
120
121
122
123
124
125
126
127
128
129
130
131

.. math::
  :label: shapewin

   \begin{aligned}
   {\tt AWIN}^2 & = & \frac{\overline{x_{\tt WIN}^2}+\overline{y_{\tt WIN}^2}}{2}
       + \sqrt{\left(\frac{\overline{x_{\tt WIN}^2}-\overline{y_{\tt WIN}^2}}{2}\right)^2 + \overline{xy_{\tt WIN}}^2},\\
   {\tt BWIN}^2 & = & \frac{\overline{x_{\tt WIN}^2}+\overline{y_{\tt WIN}^2}}{2}
       - \sqrt{\left(\frac{\overline{x_{\tt WIN}^2}-\overline{y_{\tt WIN}^2}}{2}\right)^2 + \overline{xy_{\tt WIN}}^2},\\
   \tan (2\,{\tt THETAWIN}) & = & 2 \frac{\overline{xy_{\tt WIN}}}{\overline{x_{\tt WIN}^2} - \overline{y_{\tt WIN}^2}}.
   \end{aligned}


132
133
.. _ellipse_win_def:

Emmanuel Bertin's avatar
Emmanuel Bertin committed
134
135
Windowed ellipse parameters: :param:`CXXWIN`, :param:`CYYWIN`, :param:`CXYWIN`
------------------------------------------------------------------------------
136

Emmanuel Bertin's avatar
Emmanuel Bertin committed
137
Ellipse parameters are computed from the windowed 2nd order moments exactly the same way as in :eq:`ellipse_2` describing the :ref:`isophotal ellipse parameters<ellipse_iso_def>`:
138
139
140
141
142
143
144
145
146
147
148
149
150

.. math::
  :label: ellipsewin_2

   \begin{aligned}
   {\tt CXXWIN} & = & \frac{\cos^2 {\tt THETAWIN}}{{\tt AWIN}^2} + \frac{\sin^2
   {\tt THETAWIN}}{{\tt BWIN}^2} =
   \frac{\overline{y_{\tt WIN}^2}}{\overline{x_{\tt WIN}^2} \overline{y_{\tt WIN}^2} - \overline{xy_{\tt WIN}}^2}\\
   {\tt CYYWIN} & = & \frac{\sin^2 {\tt THETAWIN}}{{\tt
   AWIN}^2} + \frac{\cos^2 {\tt THETAWIN}}{{\tt BWIN}^2} =
   \frac{\overline{x_{\tt WIN}^2}}{\overline{x_{\tt WIN}^2} \overline{y_{\tt WIN}^2} - \overline{xy_{\tt WIN}}^2}\\
   {\tt CXYWIN} & = & 2 \,\cos {\tt THETAWIN}\,\sin {\tt
   THETAWIN} \left( \frac{1}{{\tt AWIN}^2} - \frac{1}{{\tt BWIN}^2}\right) = -2\,
Emmanuel Bertin's avatar
Emmanuel Bertin committed
151
152
   \frac{\overline{xy_{\tt WIN}}}{\overline{x_{\tt WIN}^2} \overline{y_{\tt WIN}^2} - \overline{xy_{\tt WIN}}^2}.
   \end{aligned}
153

154
155
.. _poserr_win_def:

Emmanuel Bertin's avatar
Emmanuel Bertin committed
156
157
Windowed position uncertainties: :param:`ERRX2WIN`, :param:`ERRY2WIN`, :param:`ERRXYWIN`, :param:`ERRAWIN`, :param:`ERRBWIN`, :param:`ERRTHETAWIN`, :param:`ERRCXXWIN`, :param:`ERRCYYWIN`, :param:`ERRCXYWIN`
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
158

159
Windowed position uncertainties are computed on the image data once the centering process of the :ref:`windowed centroid <pos_win_def>` has converged.
Emmanuel Bertin's avatar
Emmanuel Bertin committed
160
Assuming that noise is uncorrelated among pixels, standard error propagation applied to :eq:`xywin` writes:
161
162

.. math::
163
  :label: errwin
164
165
166

   \begin{aligned}
   {\tt ERRX2WIN} & = {\rm var}(\overline{x_{\tt WIN}})
167
   = & 4\,\frac{\sum_{r_i < r_{\rm max}} w_i^2 \sigma^2_i (x_i-\overline{x_{\tt WIN}})^2}
168
169
   {\left(\sum_{r_i < r_{\rm max}} w_i I_i\right)^2},\\
   {\tt ERRY2WIN} & = {\rm var}(\overline{y_{\tt WIN}})
170
   = & 4\,\frac{\sum_{r_i < r_{\rm max}} w_i^2 \sigma^2_i (y_i-\overline{y_{\tt WIN}})^2}
171
172
173
174
   {\left(\sum_{r_i < r_{\rm max}} w_i I_i\right)^2},\\
   {\tt ERRXYWIN} & = {\rm cov}(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})
   = & 4\,\frac{\sum_{r_i < r_{\rm max}}
   w_i^2 \sigma^2_i (x_i-\overline{x_{\tt WIN}})(y_i-\overline{y_{\tt WIN}})}
Emmanuel Bertin's avatar
Emmanuel Bertin committed
175
176
   {\left(\sum_{r_i < r_{\rm max}} w_i I_i\right)^2}.
   \end{aligned}
177

178
Semi-major axis :param:`ERRAWIN`, semi-minor axis :param:`ERRBWIN`, and position angle :param:`ERRTHETAWIN` of the :math:`1\sigma` position error ellipse are computed from the covariance matrix elements :math:`{\rm var}(\overline{x_{\tt WIN}})`, :math:`{\rm var}(\overline{y_{\tt WIN}})`, :math:`{\rm cov}(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})`, similarly to the :ref:`isophotal error ellipse <poserr_iso_def>`:
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

.. math::
  :label: errabthetawin

   \begin{aligned}
   {\tt ERRAWIN}^2 & = & \frac{{\rm var}(\overline{x_{\tt WIN}})+{\rm var}(\overline{y_{\tt WIN}})}{2}
       + \sqrt{\left(\frac{{\rm var}(\overline{x_{\tt WIN}})-{\rm var}(\overline{y_{\tt WIN}})}{2}\right)^2
       + {\rm cov}^2(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})},\\
   {\tt ERRBWIN}^2 & = & \frac{{\rm var}(\overline{x_{\tt WIN}})+{\rm var}(\overline{y_{\tt WIN}})}{2}
       - \sqrt{\left(\frac{{\rm var}(\overline{x_{\tt WIN}})-{\rm var}(\overline{y_{\tt WIN}})}{2}\right)^2
       + {\rm cov}^2(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})},\\
   \tan (2{\tt ERRTHETAWIN}) & = & 2 \,\frac{{\rm cov}(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})}
                       {{\rm var}(\overline{x_{\tt WIN}}) - {\rm var}(\overline{y_{\tt WIN}})}.
    \end{aligned}

Emmanuel Bertin's avatar
Emmanuel Bertin committed
194
The error ellipse parameters are:
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215

.. math::
  :label: errellipsewin

   \begin{aligned}
   {\tt ERRCXXWIN} & = & \frac{\cos^2 {\tt ERRTHETAWIN}}{{\tt ERRAWIN}^2} +
   \frac{\sin^2 {\tt ERRTHETAWIN}}{{\tt ERRBWIN}^2} = \frac{{\rm
   var}(\overline{y_{\tt WIN}})}{{\rm var}(\overline{x_{\tt WIN}}) {\rm var}(\overline{y_{\tt WIN}}) -
   {\rm cov}^2(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})},\\
   {\tt ERRCYYWIN} & = & \frac{\sin^2 {\tt ERRTHETAWIN}}{{\tt ERRAWIN}^2} +
   \frac{\cos^2 {\tt ERRTHETAWIN}}{{\tt ERRBWIN}^2} =
   \frac{{\rm var}(\overline{x_{\tt WIN}})}{{\rm var}(\overline{x_{\tt WIN}}) {\rm var}(\overline{y_{\tt WIN}}) -
   {\rm cov}^2(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})},\\
   {\tt ERRCXYWIN} & = & 2 \cos {\tt
   ERRTHETAWIN}\sin {\tt ERRTHETAWIN} \left( \frac{1}{{\tt ERRAWIN}^2} -
   \frac{1}{{\tt ERRBWIN}^2}\right)\\ & = & -2 \frac{{\rm
   cov}(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})}{{\rm var}(\overline{x_{\tt WIN}}) {\rm var}(\overline{y_{\tt WIN}}) -
   {\rm cov}^2(\overline{x_{\tt WIN}},\overline{y_{\tt WIN}})}.
   \end{aligned}


216

217
.. [#win_accuracy] See http://www.astromatic.net/forum/showthread.php?tid=581 .
218