comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: FFT's and images: or My 4th day on what I thought would take me only 6hrs
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: FFT's and images: or My 4th day on what I thought would take me only 6hrs [message #26288] Sun, 19 August 2001 06:31
Aaron Birenboim is currently offline  Aaron Birenboim
Messages: 24
Registered: October 2000
Junior Member
Isn't the FFT of a gaussian another gaussian?
If you look it up in a book, you could compute
the PSF in the frequency domain. Could save some time.
It will be tricky because of the symetry about the origin.

As hinted at earlier, this could easily be overcome by defining
some x and y axis arrays.

So the PSF in FFT domain might look something like
psf = exp(c*((x*x+y*y)))

--
Aaron Birenboim | Black holes are where G-d divided
Albuquerque, NM | by zero.
aaron@boim.com |
boim.com/~aaron | -Steven Wright
Re: FFT's and images: or My 4th day on what I thought would take me only 6hrs [message #26308 is a reply to message #26288] Thu, 16 August 2001 22:05 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
tbowers0@yahoo.com wrote:
>
A couple of suggestions:

1) grab the routine CONVOLVE_PSF.PRO from the astronomy IDL library - I
can send you a copy that I commented a bit, if you are interested.... It
assumes that you HAVE the MTF (PSF) and the image, and it does the
blurring operation you want. It takes advantage of the fact that the PSF
is usually a lot smaller an array than the image itself.

2) Calculating a 2-D gaussian is not that bad- you can make a 2-d array
that contains the x values, a 2-d array of the same size that contains
the y values, and then you can construct the 2-D gaussian just using
regular IDL operations:
Gaussian=exp(-((x/sigma_x)^2 + (y/sigma_y)^2)))
As for normalization, you can do
PSF=PSF/total(PSF)
but you may also need an additional scaling by NX*NY depending on the
version of the FFT routine you are using. It's pretty easy to figure out
by trial and error if you are off by that factor.

3) When you use the convolution theorem to reconstruct an image, you
need to be careful of how the quadrants map back into the image - if you
are not careful, you'll find the original center wrapped into the four
corners of the image. I have a special-purpose deconvolution routine
that illustrates the technique - you would have to generalize it for
arbitrary x and y sizes.

4) You will not run into trouble by truncating the gaussian at some
radial range - the zeroes will not kill you. However, you may want to
embed your image in a larger 'canvas' of zeroes to avoid wrap-around
effects if you have a broad PSF.

5) If you are doing a LOT of processing of large images that are not 2^n
in size, the IDL FFT routine may slow you down. There exists a nice
implementation of the FFTW routine using an external callable library as
a DLM. It takes a little work to set it up, but once it is working, it
can save you an enormous amount of time if you are doing really heavy
number crunching.

If these abbreviated suggestions don't get you any closer to the answer,
then write to me at rfrench@wellesley.edu with some specifics of what
you are trying to do - if you can send an image as a tiff
or jpeg or FITS file, and a description of the PSF, I could probably
cook up a quick program to do the convolution/deconvolution for you.
I had to do this very same thing to clean up some Hubble Space Telescope
images of Saturn. My code was not written for general use, though, so
I'd have to extract the pieces you need.

Good luck!
Dick French
rfrench@wellesley.edu
************** PLEASE USE THE ABOVE EMAIL ADDRESS *********
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: on-screen slider
Next Topic: Re: Testers needed for TV benchmark

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:07:04 PDT 2025

Total time taken to generate the page: 0.00462 seconds