{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction to pyOpTools" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## What is pyOpTools" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The pyOpTools package is composed by a set of python modules that allow to simulate the behavior of optical systems.\n", "Initially it was only oriented to the ray tracing, but currently in the development version it has some tools which can be used to simulate optical fields and their propagation.\n", "\n", "This tutorial will introduce the simulation of optical systems by ray tracing in a Jupiter notebook.\n", "\n", "In the following video there is a small demo of an old version of pyOpTools" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from IPython.lib.display import YouTubeVideo\n", "\n", "YouTubeVideo(\"DB8sfm7pVPI\", width=640, height=480)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Some basic characteristics of pyOpTools \n", "\n", "1. It is an open source development\n", "2. It is being developed by the technological development group of [Combustión Ingenieros S.A.S](http://www.cihologramas.com), and the applied optics group of the [Universidad Nacional de Colombia](http://www.unal.edu.co).\n", "3. It is written in [python](http://www.python.org) y [cython](http://www.cython.org).\n", "4. It is written using the [object oriented programming paradigm](https://en.wikipedia.org/wiki/Object-oriented_programming.)\n", "5. It can perform non-sequential ray-tracing of complex 3D systems. \n", "6. It can be used as a module to develop programs to simulate optical systems. \n", "7. It can be used in a [Jupyter Notebook](https://www.jupyter.org) to perform interactive simulation tasks \n", "8. There is a [FreeCAD](https://www.freecadweb.org/) workbench under development, to simplify its applications to optical design tasks. This development is being hosted in https://github.com/cihologramas/freecad-pyoptools " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## A basic introduction \n", "\n", "### Importing pyoptools\n", "\n", "The fist step to simulate an optical system in pyOpTools, is to import the package. The most simple way to perform this task is to import the [pyoptools.all](../../pyoptools.all.rst) subpackage:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pyoptools.all import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After the module is imported, a simulation can be performed. In the following example we will create a simple system composer by a lens, a detector, and a light source. \n", "\n", "As a first step we will create a lens from the Edmund Scientific catalog (reference 32475), we will create a [CCD-like](../../pyoptools.raytrace.comp_lib.rst#pyoptools.raytrace.comp_lib.CCD) sensor with 20 mm X 20 mm size, and a parallel ray source with cartesian beam distribution.\n", "\n", "