Giter VIP home page Giter VIP logo

Comments (4)

FredvanGoor avatar FredvanGoor commented on June 13, 2024

Direct integration is very time consuming. You should use the trick with spherical coordinates to simulate the Airy disk in the focus of a lens. See the manual: https://opticspy.github.io/lightpipes/manual.html#spherical-coordinates

from lightpipes.

concord647 avatar concord647 commented on June 13, 2024

Hi Fred,

thank you very much for your reply - and for providing such a neat package of course.

Yes, it is indeed very time consuming. However, I need to propagate the field not only to the focus but also through the focus to the 2f-Plane, as in a 4f-Configuration. I couldn't figure out a way to do this using the trick with sperical coordinates. Is it possible?

Anyways, I wouldn't mind the long computation time of the direct integration method, if the results are correct. However I am still wondering about the resulting airy disc in the focal plane as shown in my original post. I adapted the source code of the spherical coordinates-example to match the physical parameters of the code shown above and this is the result:

grafik

in direct comparison to the result obtained with direct integration (as shown earlier):
grafik

Do you see a reason why the first minimum shouldn't go down to zero?

from lightpipes.

Jackzeng999 avatar Jackzeng999 commented on June 13, 2024

Hi Fred,
I also meet the problem to get the Airy side-lobs as theory.
In the code of LensFresnel_Convert_f10cm.py, you use as
F2=Lens(f1,0,0,F);
F2=LensFresnel(f2,f,F2);
but commands are defined Lens(Fin, f, x_shift=0.0, y_shift=0.0) and LensFresnel(Fin, f, z). Are they OK in both ways?

Thanks a lot.

from lightpipes.

ldoyle avatar ldoyle commented on June 13, 2024

Dear @Jackzeng999,
your question is regarding the argument order, correct? We changed this in LightPipes 2.0 so that the Field is always first (new way). This allows many optional arguments with default values, since you can just leave them out. Up to version 1.2, the field was always last, so optional arguments was tricky. All functions (expect new functions introduced in 2.0 or later) were made backward compatible and detect if Field is first or last. The example still uses the old style.
Regarding the f1 and f2 parameter, this should be clear from the manual how both lenses (a phase only lens and one geometrical spherical coord lens) combined give the focal strength f.

@concord647 and @Jackzeng999 concerning the non-existent first minimum:
This is indeed strange and I have no immediate explanation for it. This is only a guess and might be completely wrong, but could this be the evidence of spherical abberrations?

  • A perfect lens would lead to a spherical wavefront immediately after the lens. In paraxial approximation, the spherical phase front can be well approximated by a quadratic/parabolic phase.
  • Similarly, when approximating and simplifying the Kirchhoff diffraction integrals, the correct radial dependence is simplified to quadratic order for e.g. Fresnel approximation.
  • In conclusion, when using Lens command to apply a quadratic phase and e.g. Fresnel command to calculate the (quadratically approximated) propagation, this cancels out and yields a nice focus with flat wavefront.
  • In contrast, using a quadratic phase (by Lens command) but a non-approximated propagator (maybe Forward I have to check whether it is also approximated) will show spherical abberrations
  • Likewise, a correct spherical phase but with approximated propagator like Fresnel will also yield slightly wrong results.
  • I really hope this is not complete nonsense, it's about as far as I have gone into the diffraction theory so far!
  • This would mean the result using Forward can be improved by using higher order Zernikes or manually specifying a more accurate phase. Maybe someone has some theoretical insight or source for this?

@concord647 concerning the spatial filter: A PhD colleague of mine tried to do the same and successfully implemented the downscaling, filtering and upscaling using the geometrical spherical coords command. Think of the command not as a lens, but just as a geometrical transform. Imagine you want to propagate from the focal plane (size=100um) to a distance of 99mm and a size of 10mm. Apply first a Lens(F, f=1*mm) and then a LensFresnel(F, f=-1*mm, z=99*mm) and then Convert to get to the output plane. The first Lens command compensates the phase that will be added by LensFresnel since we just want to use it's geometric propagation, not it's focussing/defocussing effect. Sketch it out, hopefully it will become clear (intercept theorem). I can elaborate if the question is still relevant.

Best, Lenny

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.