Giter VIP home page Giter VIP logo

Comments (1)

ldoyle avatar ldoyle commented on June 13, 2024

Hello Tess,

are you referring to Fred's example in Examples/Zernike/Shack_HartmannDemo[2...3].py?
As you can see from the plots, the examples work and create the expected abberated patterns.
What might be confusing, esp. in the first demo, is that the field at the plane of the sensor is stored in F, while Forvard is applied and stored as a new variable F1 and the Zernike aberration is only applied and propagated in F2, which is never plotted. So maybe the "plot2" and "plot3" examples are more instructive.

However in all cases, the order of commands has the correct outcome:

  • A large empty field is created
  • A small field is created with a circular lens of the right size
  • The small field is inserted in a grid in the large field
  • Before propagating further, i.e. in the plane of the microlens array, the aberration is applied.
  • Then the propagation to the focal plane of the microlenses (i.e. the plane of the camera) is calculated with either Forvard or Fresnel

In the same plane, e.g. the plane of the microlens array, the order of phase/intensity modulations is physically irrelevant as they are complex multiplications. So applying the phase shift due to the microlens first or the aberration first has the same outcome. You can plot the unwrapped phase after applying the microlens pattern and Zernike aberration, but before propagation.

So much for the example code. In your use case, it sounds like you would like to use an arbitrary input field and then apply the microlens array, which probably makes more sense in everday applications. This can still be done. The quickest way I can think of is to construct the Shack-Hartmann field like the example, with an unaberrated beam. Then, you can save the intensity distribution and (wrapped) phase in two variables, and use MultPhase and MultIntensity on your actual field to simulate the effect of the microlens array. A final Fresnel(F, f_microlenses) should then give you the expected distribution on the camera.

Let us know if this helps, maybe I can create an example with the method I described if you get stuck.

from lightpipes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.