Giter VIP home page Giter VIP logo

Comments (3)

FredvanGoor avatar FredvanGoor commented on July 30, 2024

In general, and especially with lenses, you have to be careful not to violate the Nyquist criterium. The maximum spatial frequency of your problem (= max(derivative of the phase with respect to x and y coordinate) ) should be smaller than the maximum spatial frequency given by the grid-spacing (= N/2/size)

from lightpipes.

FELman2011 avatar FELman2011 commented on July 30, 2024

When you propagate from a source plane (here optical field after the thin lens) to a target plane at various distances, it is best practice to preserve the source and repeatedly propagate from source plane to new target plane. This avoids buildup of errors during the propagation. For example, when you want to propagate the optical field Field at the source plane to target planes that are in the range z_start to z_end away from the source plane, you could use:

Nz=50                                    # number of steps in range z_start to z_end
z0 = z_start
dz = (z_end -z_start)/Nz

I1=np.zeros((Nz,GridDimension))
I2=np.zeros((Nz,GridDimension))

for i in range(Nz):
   F = Forvard(Field,z0)
   I = np.array(Intensity(F))
   I1[i,:] = I[int(GridDimension/2),:]
   I2[i,:] = I[:,int(GridDimension/2)]
   z0 += dz

from lightpipes.

IvanOstr avatar IvanOstr commented on July 30, 2024

FELman2011:
Unfortunately I'm simulating an effect that has to be propagated step by step (if you are more insterested - self foucing via kerr effect), so I can't run from this problem. In a matter of fact, the errors of propagation with steps and without them are quite small so my problem is mainly the inefficient running time.

FredvanGoor:
Thanks, thats a good tip.

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.