Convolve an input dataset (2D image or 1D spectrum for example) with a known kernel, or make the kernel necessary to match two PSFs. The general template for Convolve is:
$ astconvolve [OPTION...] ASTRdata
One line examples:
## Convolve mockimg.fits with psf.fits: $ astconvolve --kernel=psf.fits mockimg.fits ## Convolve in the spatial domain: $ astconvolve observedimg.fits --kernel=psf.fits --domain=spatial ## Convolve a 3D cube (only spatial domain is supported in 3D). ## It is also necessary to define 3D tiles and channels for ## parallelization (see the Tessellation section for more). $ astconvolve cube.fits --kernel=kernel3d.fits --domain=spatial \ --tilesize=30,30,30 --numchannels=1,1,1 ## Find the kernel to match sharper and blurry PSF images (they both ## have to have the same pixel size). $ astconvolve --kernel=sharperimage.fits --makekernel=10 \ blurryimage.fits ## Convolve a Spectrum (column 14 in the FITS table below) with a ## custom kernel (the kernel will be normalized internally, so only ## the ratios are important). Sed is used to replace the spaces with ## new line characters so Convolve sees them as values in one column. $ echo "1 3 10 3 1" | sed 's/ /\n/g' | astconvolve spectra.fits -c14
The only argument accepted by Convolve is an input image file. Some of the options are the same between Convolve and some other Gnuastro programs. Therefore, to avoid repetition, they will not be repeated here. For the full list of options shared by all Gnuastro programs, please see Common options. In particular, in the spatial domain, on a multi-dimensional datasets, convolve uses Gnuastro’s tessellation to speed up the run, see Tessellation. Common options related to tessellation are described in Processing options.
1-dimensional datasets (for example, spectra) are only read as columns within a table (see Tables for more on how Gnuastro programs read tables). Note that currently 1D convolution is only implemented in the spatial domain and thus kernel-matching is also not supported.
Here we will only explain the options particular to Convolve. Run Convolve with --help in order to see the full list of options Convolve accepts, irrespective of where they are explained in this book.
Column containing the 1D kernel. When the input dataset is a 1-dimensional column, and the host table has more than one column, use this option to specify which column should be used.
Do not flip the kernel after reading it the spatial domain convolution. This can be useful if the flipping has already been applied to the kernel.
Do not normalize the kernel after reading it, such that the sum of its pixels is unity.
The domain to use for the convolution.
The acceptable values are ‘
spatial’ and ‘
frequency’, corresponding to the respective domain.
For large images, the frequency domain process will be more efficient than convolving in the spatial domain. However, the edges of the image will loose some flux (see Edges in the spatial domain) and the image must not contain any blank pixels, see Spatial vs. Frequency domain.
With this option a file with the initial name of the output file will be created that is suffixed with _freqsteps.fits, all the steps done to arrive at the final convolved image are saved as extensions in this file. The extensions in order are:
Do not correct the edge effect in spatial domain convolution. For a full discussion, please see Edges in the spatial domain.
If this option is called, Convolve will do PSF-matching: the output will be the kernel that you should convolve with the sharper image to obtain the blurry one (see Convolution theorem). The two images must have the same size (number of pixels). This option is not yet supported in 1-dimensional datasets. In effect, it is only necessary to give the two PSFs of your two datasets, find the matching kernel based on that, then apply that kernel to the higher-resolution (sharper image).
The image given to the --kernel option is assumed to be the sharper (less blurry) image and the input image (with no option) is assumed to be the more blurry image. The value given to this option will be used as the maximum radius of the kernel. Any pixel in the final kernel that is larger than this distance from the center will be set to zero.
Noise has large frequencies which can make the result less reliable for the higher frequencies of the final result. So all the frequencies which have a spectrum smaller than the value given to the minsharpspec option in the sharper input image are set to zero and not divided. This will cause the wings of the final kernel to be flatter than they would ideally be which will make the convolved image result unreliable if it is too high.
Some notes to on how to prepare your two input PSFs. Note that these (and several other issues that relate to an accurate estimation of the PSF) are practically described in the following tutorial: Building the extended PSF.
(=FLT) The minimum frequency spectrum (or coefficient, or pixel value in the frequency domain image) to use in deconvolution, see the explanations under the --makekernel option for more information.