Calculate encircled energy from point spread function
Mostrar comentarios más antiguos
Hi all,
I have a point spread function and I am trying to reproduce the encircled energy (EE) plot to find the encircled energy of it (see example of what I would like). I have attempted to calculate the EE and plot the EE against the radial distance from the centre of the PSF. However, the EE should be from 0 to 1 on the y axis but in my plot (see attached), it doesn’t seem to be the case. I have attached the code that I have used:
horizontalProfile = psf(128, :);
cdf = cumsum(horizontalProfile(128:end));
% Normalize
cdf = cdf / sum(cdf);
plot(cdf)
The value 128 is the location of the centre of the PSF (grid size 256 x 256). If anyone could kindly look at it and tell me what I am doing wrong, I would be so grateful! I have also attached the image of the PSF generated.


3 comentarios
Vanessa
el 9 de Sept. de 2017
David Goodmanson
el 9 de Sept. de 2017
Editada: David Goodmanson
el 9 de Sept. de 2017
Hi Vanessa, I withdrew the answer. It was not quite right because you have 2-d situation. And that is related to why you are getting a start of .2.
The 256x256 psf matrix, do the rows and columns correspond to variables r and theta, or to variables x and y? I would guess it's x and y, in which case it takes some work to get the answer unless you use the approximation that the psf function is axially symmetric and does not depend on theta. I will repost an answer in awhile.
Vanessa
el 10 de Sept. de 2017
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
