Skip to content

Commit

Permalink
Added another example for fresnel diffraction due to a beam-stop.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryancole committed Jan 30, 2021
1 parent bc8dd8c commit aee0ff4
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 8 deletions.
19 changes: 19 additions & 0 deletions doc/source/examples/fresnel_diffraction_example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Fresnel Diffraction From A BeamStop
===================================

We simply invert an aperture to create a beam-stop. Placing this the path of a collimated beam
created interesting Fresnel-diffraction effects, including a bright spot at the centre of the blocked path,
known as the Spot of Arago.

.. literalinclude:: /../../examples/fresnel_diffraction.py

The model looks as follows:

.. image:: ../images/inverted_aperture.png

However, the seem the detail in the Fresnel diffraction pattern, you need lots of Gausslets. Turn up the
source resolution to at least 40.

.. image:: ../images/fresnel_diffraction.png

.. image:: ../images/spot_of_arago.png
3 changes: 2 additions & 1 deletion doc/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Examples

.. toctree::

bessel_beam_example
bessel_beam_example
fresnel_diffraction_example
Binary file added doc/source/images/fresnel_diffraction.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/inverted_aperture.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/spot_of_arago.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions examples/aperture_demo.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@


from raypier.apertures import CircularAperture

from raypier.tracer import RayTraceModel

from raypier.sources import ConfocalRayFieldSource
from raypier.api import CircularAperture, ConfocalRayFieldSource, RayTraceModel


src = ConfocalRayFieldSource(centre=(0,0,0),
Expand Down
56 changes: 56 additions & 0 deletions examples/fresnel_diffraction.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

from raypier.tracer import RayTraceModel
from raypier.sources import HexagonalRayFieldSource, ConfocalRayFieldSource
from raypier.lenses import PlanoConvexLens
from raypier.apertures import CircularAperture
from raypier.fields import EFieldPlane
from raypier.constraints import BaseConstraint
from raypier.intensity_image import IntensityImageView
from raypier.intensity_surface import IntensitySurface

from traits.api import Range, on_trait_change
from traitsui.api import View, Item


aperture = CircularAperture(centre=(0,0,10), direction=(0,0,1),
hole_diameter = 0.5, edge_width=0.001, invert=True)

src = HexagonalRayFieldSource(resolution=10.0, direction=(0,0,1),
radius=2.0,
wavelength=1.0)

probe = EFieldPlane(source=src,
centre=(0,0,50),
direction=(0,1,0),
exit_pupil_offset=100.,
width=2.0,
height=100.0,
size=100)

img = IntensityImageView(field_probe=probe)
surf = IntensitySurface(field_probe=probe)


class FocalPlane(BaseConstraint):
z_pos = Range(50.0,130.0, 57.73)

traits_view = View(Item("z_pos"))

def __init__(self, *args, **kwds):
super().__init__(*args, **kwds)
self.on_change_z_pos()

@on_trait_change("z_pos")
def on_change_z_pos(self):
probe.centre = (0,0,self.z_pos)



model = RayTraceModel(sources=[src], optics=[aperture],
probes=[probe], constraints=[FocalPlane()],
results=[img, surf])



model.configure_traits()

2 changes: 0 additions & 2 deletions examples/test_hexagonal_ray_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
radius=2.0,
wavelength=1.0)

src.InputRays

probe = EFieldPlane(source=src,
centre=(0,0,50),
direction=(0,1,0),
Expand Down
2 changes: 2 additions & 0 deletions raypier/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@

from .probes import RayCapturePlace, GaussletCapturePlane

from .apertures import CircularAperture, RectangularAperture

from .intensity_surface import IntensitySurface

0 comments on commit aee0ff4

Please sign in to comment.