Python tools for optical design
Switch branches/tags
Nothing to show
Clone or download
wcamilo96 and ijpulidos Tutorial and rotation test added (#53)
Adding tutorial and rotation test notebooks. Better documentation of current pyoptools capabilities.
Latest commit 503e732 Sep 25, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
Tutorial Tutorial and rotation test added (#53) Sep 25, 2018
debs Adding readme and debs directory/files Apr 15, 2015
doc Misc. typos Mar 25, 2018
examples/basic_course Misc. typos Mar 25, 2018
pyoptools Trying to clean up the mess a little bit by reformatting files to mee… Mar 26, 2018
.gitignore replacing plot3D for a class, that basic repr is the ipython jpeg, th… Sep 16, 2015
.travis.yml fixing travis file Sep 14, 2015
LICENSE.txt Update LICENSE (relicensing) Jun 29, 2017 se anadieron al Manifest.ini los archivos *.mat y *.cmp que correspon… Aug 11, 2017
Makefile Se adiciona un nuevo componente para crear espejos planos de apertura… Jun 29, 2017 Adding install instructions, now supporting Anaconda environment as r… May 21, 2018 fixing travis file Sep 14, 2015
debian8_notes Se adiciona un nuevo componente para crear espejos planos de apertura… Jun 29, 2017
description-pak Se eliminaron algunos archivos no necesarios Jul 4, 2012 fixing travis file Sep 14, 2015 Misc. typos Mar 25, 2018
ipyoptools Changing ipython launch command to support both python2 and python3 d… Feb 2, 2016
logger.ini Se eliminaron algunos archivos no necesarios Jul 4, 2012
pyoptools_env.txt Adding (ana)conda environment file to create conda environment easily… May 21, 2018
requirements.txt Completing requirements file with correct working versions. May 21, 2018
setup.cfg Registered project in PIP. Changing setup files for it. Aug 1, 2017 Misc. typos Mar 25, 2018 Se eliminaron algunos archivos no necesarios Jul 4, 2012 adding simple test for components Sep 16, 2015
valgrind-python.supp Se eliminaron algunos archivos no necesarios Jul 4, 2012


pyOpTools is a set of packages that allow the simulation of optical systems by raytracing as well as some calculations involving wavefronts, currently under development. It is written in Python and Cython, and is being developed by the technological development group of Combustión Ingenieros S.A.S, and the applied optics group of the Universidad Nacional de Colombia.

The pyOpTools is divided in several packages that contain the different library's functionalities:


This package contains the classes and functions used to perform the simulation of optical systems using 3D non-sequential raytracing algorithms.


This package contains miscellaneous classes and functions used by the other packages, but that can not be classified in any of them.


The requirements are found in the requirements.txt file in the root of this repository. Please check it and adapt to your current system setup to install PyOpTools requirements. If you choose to install PyOptools using the Anaconda Python distribution as noted in the How to install section below, you can skip this step.

Inside a Python virtualenv

If you have setup already a Python virtualenv you could just install the requirements using the following command

pip install -r requirements.txt

For Debian/Ubuntu systems

The following steps work to install the packages required to run pyoptools in an ipython notebook under debian 8. These instructions are far from complete, but they will give an idea.

  1. Install stdeb. in you can find instructions on how to do it.
  2. Install ipython: sudo pypi-install ipython --release 3.2.1 (had problems with the latest one)
  3. sudo apt-get install python-setuptools
  4. sudo pypi-install backports.ssl_match_hostname
  5. sudo pypi-install certifi
  6. sudo pypi-install tornado
  7. sudo apt-get install python-jsonschema
  8. sudo apt-get install libosmesa6
  9. sudo apt-get install python-wxgtk3.0
  10. sudo pypi-install PyOpenGL --release 3.1.0

NOTE: These instructions will only work for debian using stdeb, adapt accordingly for your platform/OS.

How to install

Pyoptools can be installing using one of the ways described in the following subsections.

Please take into account that PyOpTools is being developed almost exclusively in Linux operating systems. We suggest using a *NIX operating system when using pyoptools. Anyways, Windows users can check the "Windows" subsection for instructions on building/installing pyoptools in MS Windows operating system.

This assumes you have cloned PyOpTools repository already.

Anaconda environment (Recommended)

Probably the most portable and direct way of installing PyOpTools is to use the Anaconda python distribution. Once you have set up Anaconda you can create an environment for the PyOpTools software via the following command

conda env create --file pyoptools_env.txt --name pyoptools

running it inside the directory where you cloned the PyOpTools repository, since the file pyoptools_env.txt is in the root of this repository.


We develop pyoptools using almost debian/*buntu Linux distributions exclusively so this is the way that's most tested and have better chances of working. Once you have setup up your requirements (check requirements section above), to compile a deb package you just need to run:

make deb

This will create a .deb installer file inside the deb_dist directory in your source root tree of pyoptools. Which you can install using the command (with admin privileges), changing the version/release/platform accordingly:

dpkg -i python-pyoptools_<version>-<release>_<platform>.deb

Using this method you will have control of versions installed via dpkg/APT package manager.

PyPI install (using pip - advanced users)

Note: Windows users please check windows subsection.

Pyoptools is hosted in the Python Package Index since Jul-17, therefore you can just use pip to install it via command line with the following command

pip install pyoptools

Please note that this may alter your system libs, it's recommended to use this inside a virtualenv python environment.

Windows (using Cygwin)

So far the only success attempt at building and installing pyoptools is using Cygwin (check This is mainly because of some issues when dealing with Microsoft compiler/SDK tools. You need a working Cygwin setup with all the dependencies installed. A list of the Cygwin packages can be found here:

Other than the listed packages in the previous link you need to manually install/upgrade some dependencies by running the following pip commands (this setup uses python2):

pip2 install -U pip
pip2 install -U ipython jupyter scipy matplotlib

After that you might just clone the pyoptools repository by issuing the following command in a Cygwin terminal

git clone
cd pyoptools
python2 install

And you should be ready to use pyoptools in Windows inside your Cygwin environment if all went well.

Virtual machine (Deprecated - old)

We have created a virtualbox image of a debian 8 installation with the pyoptools running. This image can be downloaded from

  • user name: usuario
  • password: usuario

This is to help people interested in testing this tool, while the documentation and installation instructions get updated.