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

New subaperture optic ---NOT READY TO MERGE.--- #185

Closed
wants to merge 24 commits into from

Conversation

douglase
Copy link
Contributor

@douglase douglase commented Sep 10, 2016

Here's my first draft of a Shack-Hartmann simulator. Not a finished product, just getting it out there for feedback early.

I've tried to keep it general and make it a "sub_aperture" class which could feed into an IFS or other instrument that samples a wavefront via a regular grid.

Here's a demo notebook showing sampling a wavefront, generating an array of PSFs and a modal retrieval of the input wavefront (this is my first foray into SH wavefront sensing, so it's not at all optimized but it does seem to recover the right Zernikes): https://gist.github.com/douglase/9f70aaffbd683f3af5edf805847a444e

Things needed before merging:

  • Complete doc strings
  • I don't know why the logger isn't working

Things that raise a Not Implemented:

  • more complicated optical systems instead of direct propagation to a detector.
  • crosstalk between subapertures

Community questions:

  1. What else is missing?
  2. How does the structure seem?
  3. Should it be stored in separate file (as it is here) or just another class within optic.py (or something else?)


def __init__(self,
dimensions = (2,2),
optic_array = np.array([[CircularAperture(radius=2.,planetype=PlaneType.pupil),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josePhoenix
Copy link
Collaborator

What else is missing?

From a software-engineering perspective rather than an optics perspective, I would say documentation and testing. In particular, an example optical system in a notebook would be nice to play with (or just look at) for evaluating the ergonomics of the API. Also, since this models a physical system, a test case that, e.g., shows it really does recover the right Zernikes (to some precision) when used as a SH sensor would be a useful sanity check.

How does the structure seem?

See my line comments for things that stood out.

Should it be stored in separate file (as it is here) or just another class within optic.py (or something else?)

Hmm. optics.py is already almost 2000 lines, so I think it should be its own file. The existing optics in POPPY are exposed in the main namespace through judicious use of __all__ and from .modulename import * (see https://github.com/mperrin/poppy/blob/master/poppy/__init__.py#L97-L101 for example) so you'll probably want to add a few lines to ensure poppy.Subapertures is a valid identifier.

(It's possible there's a sensible way to split up optics.py into a package with submodules too, but that would probably be a separate PR.)

self.optic_array=optic_array
self.crosstalk=crosstalk
if crosstalk:
raise ValueError("CROSS TALK NOT IMPLEMENTED <YET>")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better, use NotImplementedError

@douglase
Copy link
Contributor Author

@josePhoenix, thanks for feedback. Yes, I thinking refactoring into some helper functions is a good idea. I have to think about the mutable arguments, thanks for the warning.

you mentioned wanting to see a notebook, do you want to see something beyond the notebook linked above? I put it in the gist because I didn't want to clog up the poppy git history with lots of iterations of notebook graphics.

@josePhoenix
Copy link
Collaborator

Hahah, I totally overlooked that link. (Maybe I was using my phone?)

That's great!

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 64.429% when pulling b50253d on douglase:new_lenslet_optic into b3852af on mperrin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 64.475% when pulling a977db8 on douglase:new_lenslet_optic into b3852af on mperrin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 64.475% when pulling 6bd713b on douglase:new_lenslet_optic into 5df300a on mperrin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 64.399% when pulling 559f5e3 on douglase:new_lenslet_optic into 5df300a on mperrin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 64.399% when pulling 4f24c2c on douglase:new_lenslet_optic into 802a249 on mperrin:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 64.399% when pulling 15459c3 on douglase:new_lenslet_optic into 802a249 on mperrin:master.

@mperrin
Copy link
Owner

mperrin commented Jul 10, 2017

@douglase is this optic still not ready to merge? I'm hoping to get a poppy release out soon, and my default plan is to leave this out unless you tell me you'd prefer otherwise. In which case, I see there is now a merge conflict with more recent edits in poppy_core that would need to get resolved...

@douglase
Copy link
Contributor Author

douglase commented Jul 11, 2017 via email

@mperrin
Copy link
Owner

mperrin commented Jul 11, 2017

No bother about the "clutter" at all! I'm perfectly happy to leave the PR open as-is. Just wanted to ask you to make sure that was the right thing to do. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants