Convolve an input image 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 ## Find the kernel to match sharper and blurry PSF images: $ astconvolve --kernel=sharperimage.fits --makekernel=10 \ blurryimage.fits
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 convolve uses Gnuastro’s tessellation, see Tessellation and the common options related to that in Processing options.
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.
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
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.
(=INT) If this option is called, Convolve will do de-convolution (see Convolution theorem). The image specified by the --kernel option is assumed to be the sharper (less blurry) image and the input image 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. The two images must have the same size.
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 take into account for a good result:
(=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.