brandondube / prysm

physical optics: integrated modeling, phase retrieval, segmented systems, polynomials and fitting, sequential raytracing...
https://prysm.readthedocs.io/en/stable/
MIT License
268 stars 46 forks source link

mft.x already a meshgrid, prysm.psf.encircled_energy(psf, dx, radius) tries to meshgrid a meshgrid #113

Closed courtney-barrer closed 3 months ago

courtney-barrer commented 3 months ago

Hello, I'm enjoying using prysm.version '0.21.1'. However noticed that prysm.psf.encircled_energy keeps crashing. When inspecting I've realised on line 314 we have nx, ny = np.meshgrid(mtf.x, mtf.y). However mtf.x , mtf.y is already a meshgrid. So the function is meshgriding a meshed grid. Setting nx, ny = mtf.x, mtf.y seems to fix the issue. Thanks for the great work!

brandondube commented 3 months ago

Thanks for the bug report, I fixed this just now in e41a038! Glad you're enjoying the library :)