Giter VIP home page Giter VIP logo

Comments (1)

kicklop avatar kicklop commented on July 16, 2024

Hello,
I think the best approach for you would be to propagate the beam into the focus of the KB by using LensFarField and then use Forvard to propagate back and forth around the focus. The result of LensFarField is a Field in the focal plane of a lens. The LightPipes LensFarField is not yet deployed, but you can input this function into your script and use it (taken from 0e83735). There is a question about correct amplitude of the field but that doesn't have to concern you since you normalize the beams. The dimension of grid scaling should be correct.:

def TestLensFarField(Fin, f):
"""
    Use a direct FFT approach to calculate the far field of the input field.
    Given the focal length f, the correct scaling is applied and the
    output field will have it's values for size and dx correctly set.
    Also applies correct prefactors to field as calculated from Fresnel
    approximation and lens as square phase.
    Parameters
    ----------
    f : double
        Focal length in meters/ global units
    Fin : lp.Field
        The input field.
    Returns
    -------
    The output field.
    """
    dx = Fin.dx
    lam = Fin.lam
    k = 2*_np.pi/lam
    L_prime = lam * f / dx
    Fout = PipFFT(Fin, index=1)
    Fout.siz = L_prime
    Fout.field *= Fin.dx**2 # hope this is correct, should be as long as numpy normalization = backward (none for forward)
    Fout.field *= 1/(1j*lam*f) * _np.exp(1j*k*f)
    Fout.field *= np.exp(1j*k/(2*f)*(Fout.mgrid_Rsquared))
    Fout._IsGauss=False
    return Fout

Getting a nice image in the Lens far field requires playing with number of grid points and grid size (bigger beam in the image at the start => smaller beam in the image in the lens far field)

As to the propagation from KB somewhere closer to focus with LensForvard/LensFresnel. The thing is that the real dimension [m] of your grid is getting smaller while the image is not changing that much. I think that this is your problem for the steps vs. x[mm] plots, where you don't see the focusing. You probably plot steps vs. pixels, but the scaling of pixels to mm changes and you don't reflect this in your plots and can't see the focusing.

I gained this result of beam dimension against propagation distance (it is distance from the focus at 3m from the KB, so 0 um is at 3 m from KB, -1000um is at 2.999m from KB). Green dotted lines show positions where propagation for (something like) LensForvard was changed to propagation around focus by LensFarField and Forvard, red dotted line is change from LensFarField to "LensForvard".
image_2023-11-18_125847274

I something like LensForvard, but not quite that, so I can't tell you the parameters to set, however getting a nice image should requite playing with f2, grid_size, number of grid points.

And lastly to the physics. I have some experience with X-ray beams focused by KB optics and the beam in the focus is quite different from Gaussian. There is always astigmatism from KB, the beam itself has wavefront distortions that show in the close to the focal plane. You can use this simulation as a best case scenario but you should count with having a different beam in the focus. A reconstruction of a beam profile in the focus can be found for example here: https://doi.org/10.1364/OE.21.026363.
And if your experiment is highly dependent of the intensity distribution in the focus, you should consider measuring the real intensity distribution there, for example by the method in the article or by different methods.

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.