## Appendix D

SCUBA-2 Matched Filter

In order to optimally find sources that are the size of the telescope beam, and suppress this residual large-scale
noise, the Picard recipe `SCUBA2_MATCHED_FILTER`

may be used. If there were no large-scale noise in the map, the
filtered signal map would be calculated as follows:

$$\mathcal{\mathcal{M}}=\frac{\left[M\left(x,y\right)/{\sigma}^{2}\left(x,y\right)\right]\otimes P\left(x,y\right)}{\left[1/{\sigma}^{2}\left(x,y\right)\right]\otimes \left[{P}^{2}\left(x,y\right)\right]},$$ | (D.1) |

where $M\left(x,y\right)$
and $\sigma \left(x,y\right)$
are the signal and RMS noise maps respectively produced by Smurf, and
$P\left(x,y\right)$ is a map of the
PSF. Here $\otimes $
denotes the 2-dimensional cross-correlation operator. Similarly, the variance map would be calculated
as

$${\mathcal{\mathcal{N}}}^{2}=\frac{1}{\left[1/{\sigma}^{2}\left(x,y\right)\right]\otimes \left[{P}^{2}\left(x,y\right)\right]}.$$ | (D.2) |

This operation is equivalent to calculating the maximum-likelihood fit of the PSF
centered over every pixel in the map, taking into account the noise. Presently
$P\left(x,y\right)$ is
simply modelled as an ideal Gaussian with a FWHM set to the diffraction limit of the telescope.

However, since there is large-scale (and therefore correlated from pixel to pixel) noise, the recipe
also has an additional step. It first smooths the map by cross-correlating with a larger Gaussian
kernel to estimate the background, and then subtracts it from the image. The same operation is also
applied to the PSF to estimate the effective shape of a point-source in this background-subtracted
map.

Before running Picard, a simple parameters file called `smooth.ini`

may be created.

[SCUBA2_MATCHED_FILTER]

SMOOTH_FWHM = 15

where `SMOOTH_FWHM = 15`

indicates that the background should be estimated by first smoothing the map and
PSF with a 15 arcsec FWHM Gaussian. The recipe is then executed as follows:

% picard -recpars smooth.ini SCUBA2_MATCHED_FILTER map.sdf

The output of this operation is a smoothed image called `map_mf.sdf`

. By default, the recipe
automatically normalizes the output such that the peak flux densities of point sources are conserved.
Note that the accuracy of this normalization depends on how closely the real PSF matches the
7.5 arcsec and 14 arcsec full-width at half-maximum (FWHM) Gaussian shapes assumed at
450$\mu $m and
850$\mu $m,
respectively (an explicit PSF can also be supplied using the `PSF_MATCHFILTER`

recipe parameter).

Copyright © 2014-2021 Science and Technology Facilities Council,

East Asian Observatory