These examples correspond to the simulations with lenses, whose explanation can be found in this video. A further discussion and its mathematical background can be found in this article.
pip install diffractsim
Alternatively, to download the examples and the apertures as well, you can also build from source by cloning the repository and running from the main folder project on the command prompt:
python setup.py install
To perform the simulations, just run from the examples subdirectory the corresponding Python scripts on the command prompt:
python bahtinov_mask.py
python optical_imaging_system.py
python object_behind_the_lens.py
python spatial_filter.py
python hexagonal_aperture_lens.py
python circular_aperture_lens.py
python beyond_the_focal_length.py
The scripts uploaded only render the diffraction pattern at a single screen distance. If you want to create an animation, you must loop through the different distances and then merging the rendered frames to a video, for example, using FFmpeg.