Re: Response function of a detector in IDL [message #92947] |
Thu, 31 March 2016 10:01 |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Wednesday, March 30, 2016 at 12:05:45 PM UTC+1, Helder wrote:
> Hi,
> I have a couple of detective quantum efficiency functions (inclusive modulation transfer function and noise power spectrum) of two detectors. I would like to apply these to a test image pattern and see how the two detectors would compare or "real" images. Something on the lines of what is shown in the first figure of this Wikipedia page: https://en.wikipedia.org/wiki/Optical_transfer_function
>
> Has anybody tried this in IDL?
>
> Since this is not my bread and butter, I have to think the thing through to the end. But my best guess of the steps involved are:
> 1) generate test pattern
> 2) generate test modulation image (sort of frequency space spread function)
> 3) FFT test pattern
> 4) multiply the two images in frequency space
> 5) FFT back
> 6) somehow put the noise information inside...
>
> There are maybe other shortcuts I could take, like convol_fft() or fft the modulation transfer function into real space and use that for convolution...
>
> As you see, confusion dominates. Any help appreciated.
>
> Thanks,
> Helder
Hi,
ok, I think I found sort of a solution. I'll write it down in case someone needs it.
I'll start by considering the fact that you have a dqe curve in form of an array of a wished length.
You have to define:
normFactor = 12.5
xSize = 1000l
hxSize = xSize/2
f = normFactor*findgen(xSize)/(xSize-1.0)
;generate some dqe
dqe = sin(f)/f
dqe[0] = 1.0
distImg = normFactor * dist(xSize)/double(hxSize) < normFactor
reformDistImg = reform(distImg,xSize*xSize)
reform_dqe_image = interpol(dqe, f, reformDistImg)
dqe_image = reform(reform_dqe_image,xSize,xSize)
That's it. Now you can show the image if you like:
oImg = image(dqe_image)
or do some math on a real image
filtered = abs(fft(fft(img, -1)*dqe_image,1))
I hope it helps and that there are not too many errors...
Cheers,
Helder
|
|
|