Re: Using FFT convolve() : centering error? [message #68418] |
Tue, 27 October 2009 06:45  |
Chris W
Messages: 12 Registered: May 2007
|
Junior Member |
|
|
On Oct 26, 4:51 pm, Kyle <kdpen...@gmail.com> wrote:
> Hi everyone,
>
> I'm trying to convolve a fake image with a point spread function (PSF)
> using FFT. The IDL function I'm using is this:http://idlastro.gsfc.nasa.gov/ftp/pro/image/convolve.pr o
>
> Basically, my problem is this: I have an image array, and a PSF
> array. The PSF is *not* symmetric in it's array (that is: the maximum
> value of the PSF does not occur at FLOOR((X-1)/2) and FLOOR((Y-1)/2),
> where X and Y are the number of elements in each dimension). To me,
> this means that everything in the fake image should shift after
> convolving with the PSF. However, that is not the case. Here's an
> example:
>
> image = dblarr(679,695) ; the psf is an array that's 678x694
> image[100,100]=100.
> test = convolve(image, psf)
> print, array_indices(test, where(test eq max(test)))
> ; the output is 100, 100, exactly where it was before
>
> I would expect the maximum of the fake image array to have shifted
> because the PSF is not centered in it's array. To complicate things,
> I can compute the convolution with the conjugate of the PSF array
> (this is done by adding the /correlate keyword):
>
> test = convolve(image, psf, /correlate)
> print, array_indices(test, where(test eq max(test)))
> ; the output is 101, 101! The maximum shifted, exactly like I
> expected it too!
>
> I think I know what's going on -- convolve() is definitely calculating
> the centers of both arrays incorrectly -- but I can't figure out how
> to fix it. Does anyone have experience with convolve() or convolution
> by FFT?
>
> Thanks!
Could the shift be due to different sizes of the image and the psf?
|
|
|