[AstroPy] Convolving FITS images

Rene Plume rplume at ucalgary.ca
Mon Oct 20 06:26:47 EDT 2014


Hi Adam et al.

When I use the following command sequence to convolve my data:

from astropy.io import fits
data = fits.getdata('filename.fits')
header = fits.getheader('filename.fits')

from astropy.convolution import convolve,Gaussian2DKernel
fwhm = 5
smoothed = convolve(data, Gaussian2DKernel(stddev=fwhm/2.35))

I get the following error messages:
# Check that the number of dimensions is compatible
    144     if array_internal.ndim != kernel_internal.ndim:
--> 145         raise Exception('array and kernel have differing number of '
    146                         'dimensions.')
    147

Exception: array and kernel have differing number of dimensions.



When I use the next two commands, however, I get:

# Alternatively, display and smooth simultaneously:
fig = aplpy.FITSFigure('filename.fits')
fig.show_grayscale(smooth=fwhm/2.35)
# but this is less flexible

TypeError: x_size should be an integer

But when I put in an actual integer (say 3), these two steps work just fine.

Any thoughts?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20141020/8cafc699/attachment.html>


More information about the AstroPy mailing list