Include a primary beam correction for interferometer inversions #35
|
Primary beam in interferometer inversions As far as I can tell, autoarray has no primary-beam handling at present: the interferometer transform maps the image straight to visibilities, so an inversion reconstructs the apparent sky (primary beam × true sky). In pyuvimage we currently correct for the beam afterwards, and we have added an option to include it in the model. However, this correction is even more important for gravitational lens modelling, where not including the primary beam response would affect conservation of surface brightness. What it changes. With P the primary beam on the image grid, the response becomes A' = T P M, so
The w-tilde kernel, the dirty image and dᵀN⁻¹d are unchanged, because P does not enter the dirty beam. On the sparse path this is two element-wise multiplications by P around the existing convolution, so it costs nothing extra. If P is treated as constant across a mesh pixel (P_m), this reduces to F' = P_m F P_m and D' = P_m D. That is equivalent to a regularisation matrix P_m⁻¹ H P_m⁻¹ on the apparent sky, and that is how we implemented it: a wrapper around any regularization ( What we see. On a mock with emission out to P ≈ 0.3, the prior on the true sky gave a lower overall error and a total flux close to the truth, and the evidence preferred it, though faint emission near the beam edge came out biased low. So it seems a useful option rather than a new default. Mosaics. The stronger case for doing this upstream is probably mosaics, where each pointing j has its own beam and kernel:
This would need one w-tilde kernel per pointing, which Questions
|
Replies: 5 comments 1 reply
|
@HRSAstro thank you, the maths checks out for a single pointing and we would like this in autoarray. Our preferred shape: the primary beam lives on the Two things we found while checking. The regularisation-wrapper form is only exact when P is constant across a mesh pixel, and for a lensed source the mesh lives in the source plane, so evaluating P on the mesh grid is the wrong plane; applying P on the image grid avoids that. And the proposal covers the mapper only, but profile images and model visibilities go through the transformer and need P too, or a fit mixes true-sky and apparent-sky components. We will take a user-supplied beam image as the core API with a Gaussian helper (FWHM ≈ 1.13 λ/D) on top, and defer mosaics until there is a concrete target. To guide the implementation, could you share a working Python snippet or small example from your build (ideally the P ≈ 0.3 mock and the script that produced the evidence comparison), and say whether both runs there used the same regularisation coefficient? |
|
I attached a Python file that includes the primary beam methods. Note that this code also contains snippets of the matrix-free solution implementation (#39). |
|
@HRSAstro thanks for the file and the regularisation notes. We have opened PyAutoLabs/PyAutoArray#640 and the implementation is now up as PyAutoLabs/PyAutoArray#644: the beam lives on the |
|
@HRSAstro an update: the primary beam (PyAutoLabs/PyAutoArray#644) shipped in autoarray 2026.10.22.1 and is in every release since; the current release is 2026.11.13.1. We haven't yet checked your observation on the lensed mock, that the preferred Matérn coefficient shifts with the beam; it is on our list. |
|
@HRSAstro closing this, since the primary beam is released (autoarray 2026.10.22.1 onwards). Checking your observation that the preferred Matérn coefficient shifts when the beam is in the solve is tracked on our side, and we'll post the result here when we have it. |
@HRSAstro thank you, the maths checks out for a single pointing and we would like this in autoarray. Our preferred shape: the primary beam lives on the
Interferometerdataset as an optional image on the real-space mask, and is applied inside both the transformer (dense/NUFFT path) and the sparse operator, so that light profiles, linear light profiles and the mapper all see the same P.Two things we found while checking. The regularisation-wrapper form is only exact when P is constant across a mesh pixel, and for a lensed source the mesh lives in the source plane, so evaluating P on the mesh grid is the wrong plane; applying P on the image grid avoids that. And the proposal covers the mapp…