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 ## Find the kernel to match sharper and blurry PSF images: $ 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 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
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:
Note that this feature is not yet supported in 1-dimensional datasets.
(=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.