vis_clean#
- xrayvision.clean.vis_clean(vis, shape, pixel, clean_beam_width=4.0, niter=5000, map=True, gain=0.1, **kwargs)[source]#
Clean the visibilities using Hogbom’s original method.
A wrapper around lower level
clean
which calculates the dirty map and psf- Parameters:
vis (
xrayvision.visibility.Visibly
) – The visibilities to cleanshape – Size of map
pixel – Size of pixel
map (
boolean
optional) – Return ansunpy.map.Map
by default or data only ifFalse
clean_beam_width (
float
) – The width of the gaussian to convolve the model with. If set to 0.0 the gaussian to convolution is disabledgain (
float
) – The gain per loop or loop gainthres (
float
) – Terminates clean whenresidual.max() <= thres
niter (
int
) – Maximum number of iterations to perform
- Returns:
numpy.ndarray
– The CLEAN image 2D
Notes
The CLEAN algorithm can be summarised in pesudo code as follows:
\[\begin{split}& \textrm{CLEAN} \left (I^{D}(l, m),\ B(l,m),\ \gamma,\ f_{Thresh},\ N \right ) \\ & I^{Res} = I^{D},\ M = \{\},\ i=0 \\ & \textbf{while} \ \operatorname{max} I^{Res} > f_{Thresh} \ \textrm{and} \ i \lt N \ \textbf{do:} \\ & \qquad l_{max}, m_{max} = \underset{l,m}{\operatorname{argmax}} I^{Res}(l,m) \\ & \qquad f_{max} = I^{Res}(l_{max}, m_{max}) \\ & \qquad I^{Res} = I^{Res} - \alpha \cdot f_{max} \cdot \operatorname{shift} \left ( B(l,m), l_{max}, m_{max} \right ) \\ & \qquad M = M + \{ l_{max}, m_{max}: \alpha \cdot f_{max} \} \\ & \qquad i = i + 1 \\ & \textbf{done} \\ & \textbf{return}\ M,\ I^{Res}\end{split}\]