Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anti-aliased apertures needed to increase numerical accuracy #129

Closed
mperrin opened this issue Aug 23, 2018 · 7 comments
Closed

Anti-aliased apertures needed to increase numerical accuracy #129

mperrin opened this issue Aug 23, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@mperrin
Copy link
Collaborator

mperrin commented Aug 23, 2018

Issue by douglase
Saturday Nov 07, 2015 at 19:53 GMT
Originally opened as mperrin/poppy#129


As discussed in #106, 'gray' aperture edges, would decrease high-order aliasing and allow one-to-one comparison of POPPY Fresnel systems (#103, #108) with their PROPER equivalents.

@mperrin
Copy link
Collaborator Author

mperrin commented Aug 23, 2018

Comment by mperrin
Tuesday Nov 10, 2015 at 04:38 GMT


I started work on antialiasing in a private branch a while ago (> 6 months), but ran into some bugs and didn't yet have a chance to get back to debugging it. I don't recall the details now. I probably ought to go ahead and push that branch here, and perhaps we can collectively dig into it again.

I'm tied up in meetings for all this week so this probably won't happen right away.

@mperrin mperrin added this to the 0.7.1 milestone Aug 23, 2018
@mperrin mperrin added the enhancement New feature or request label Aug 23, 2018
@mperrin
Copy link
Collaborator Author

mperrin commented Aug 23, 2018

Comment by mperrin
Tuesday Feb 09, 2016 at 20:44 GMT


Two possible routes to implementation:

I've just noticed the photutils package has a sub package geometry which implements in Cython functions for sub pixel exact calculations of circular and rectangular apertures. We could make use of this in poppy - either by just calling that code if photutils is installed, or including a copy of that code as part of poppy (it's BSD3 and astropy affiliated so the licenses are compatible). I'm not sure we want to add a Cython module into the poppy code base given the potential installation and support headaches though?

The other path would be finishing up the implementations using the pure-python subpixel algorithms in my own code. I've just pushed the subpixel_geometry branch to here on github.
Warning, this branch does not work yet! Various tests fail, I'm not sure why. I literally have not looked at this code in any detail in about a year, so my memory is hazy at best. But this presumably could be debugged if someone has attention to devote to it.

@mperrin
Copy link
Collaborator Author

mperrin commented Aug 23, 2018

Comment by mperrin
Monday Jun 06, 2016 at 17:02 GMT


Still want to get this done - but it's not happening this week.

@mperrin
Copy link
Collaborator Author

mperrin commented Aug 23, 2018

Comment by mperrin
Monday Sep 26, 2016 at 20:44 GMT


See comments on #180 for an example of the improvements from sub-pixel sampled optics. Yes, we should still come up with some more general solution for this.

For the AnalyticOpticalElement style JWST pupil shown in #180 I simply used the matplotlib.path.Path.contains_points method, implemented brute force and inefficiently for every pixel in the full and thus slowly. If we were to use something like this more generally, we'd want to be more clever about selecting only a subset of pixels near the edge to perform the detailed calculation on.

@mperrin
Copy link
Collaborator Author

mperrin commented Nov 28, 2018

Another year, another release, and this still hasn't bubbled up to the top of the priority stack. Not going to make it into the 0.8 release.

@mperrin mperrin modified the milestones: 0.8.0, 0.8.1 Nov 28, 2018
@mperrin
Copy link
Collaborator Author

mperrin commented Mar 25, 2019

Still ought to be done. This has come up in the context of optics lab work (hicat sim and eclips) so may finally be time to get this done.

I have a mostly-working implementation in the subpixel_geometry branch in my repo. I just rebased this onto the current master, and am working through a few test failures. For instance right now one of the Fresnel tests is no longer passing within the tolerances; I'm not sure if this is a real bug or just a numerical issue that we should expect different results of this magnitude.

Meanwhile, @sdwill says he has another new/novel way to do this, which he implemented in Cython and soon will be publishing a paper on. Perhaps that should also be considered, though I'm hesitant in adding Cython build complexities as a dependency for poppy right now.

@mperrin mperrin modified the milestones: 0.8.1, Fall 2019 release May 9, 2019
@mperrin
Copy link
Collaborator Author

mperrin commented Aug 12, 2019

Implemented in #325 and #307

@mperrin mperrin closed this as completed Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant