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

Add Interpol option in Fresnel and Forvard #58

Open
jmmelko opened this issue Feb 9, 2021 · 1 comment
Open

Add Interpol option in Fresnel and Forvard #58

jmmelko opened this issue Feb 9, 2021 · 1 comment

Comments

@jmmelko
Copy link
Contributor

jmmelko commented Feb 9, 2021

Hi guys,

I suggest adding newsize and Nnew as optional parameters to the Fresnel and Forvard methods.
They would by used to call Interpol within the function.

This would make the three main integration methods homogeneous in terms of arguments.

I have implemented this in my own code, to be able to switch between methods, by changing the values of a Methods dictionary/list defined at the beginning of my script. Indeed, it is often the case that we have to change the method depending on the conditions (focusing or not, long or short propagation distance, etc.)

besides, this would not be shocking as other LightPipes function already integrate coordinate changes, LendForvard for instance that uses spherical coordinates.

@jmmelko
Copy link
Contributor Author

jmmelko commented Feb 9, 2021

here is what I did in my code:

def Forward(Fin, z, sizenew, Nnew):
    return LightPipes.Forward(Fin=Fin, z=z, sizenew=sizenew, Nnew=Nnew)
    
def Fresnel(Fin, z, sizenew, Nnew):
    return LightPipes.Fresnel(Fin=LightPipes.Interpol(Fin, sizenew, Nnew), z=z)

def Forvard(Fin, z, sizenew, Nnew):
    return LightPipes.Forvard(Fin=LightPipes.Interpol(Fin, sizenew, Nnew), z=z)

Maybe we can put that in light Pipes, provided that Interpol never crashes

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

No branches or pull requests

1 participant