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

Open
douglase opened this issue Nov 7, 2015 · 4 comments
Open

Anti-aliased apertures needed to increase numerical accuracy #129

douglase opened this issue Nov 7, 2015 · 4 comments
Milestone

Comments

@douglase
Copy link
Contributor

douglase commented Nov 7, 2015

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
Owner

mperrin commented Nov 10, 2015

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.5 milestone Nov 18, 2015
@mperrin
Copy link
Owner

mperrin commented Feb 9, 2016

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
Owner

mperrin commented Jun 6, 2016

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

@mperrin mperrin modified the milestones: 0.5.1, 0.5 Jun 6, 2016
@mperrin
Copy link
Owner

mperrin commented Sep 26, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants