Skip to content
Python tools for optical design
Python Jupyter Notebook
Branch: master
Clone or download
Latest commit c2da70b Aug 14, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
Tutorial The Plot3D baser in pythreejs is almost ready. Is a bit slow, but all… Aug 6, 2019
debian Mas arreglos para python 3 Aug 5, 2019
doc restore autodoc for cython extensions Aug 13, 2019
examples/basic_course Misc. typos Mar 25, 2018
pyoptools The Plot3D baser in pythreejs is almost ready. Is a bit slow, but all… Aug 6, 2019
.gitignore add doc/_build/ to .gitignore Aug 13, 2019
.travis.yml fixing travis file Sep 14, 2015
LICENSE.txt se anadieron al Manifest.ini los archivos *.mat y *.cmp que correspon… Aug 11, 2017
Makefile Se adicionan archivos para generar deb de python 3. No se va a soport… Jul 5, 2019 CI link was added in the README Aug 5, 2019 Se adicionan archivos para generar deb de python 3. No se va a soport… Jul 5, 2019
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 update requirements.txt Aug 11, 2019
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

New Instructions for Debian 10 (should work on any debian derivative)

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 outside the pyoptool's source root tree. Which you can install using the command (with admin privileges), changing the version/release/platform accordingly:

dpkg -i python3-pyoptools_<version>_<platform>.deb

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

To use pyoptools together with jupyter, the jupyter plugin pythreejs must be installed. To install it in the user directory, use the following instructions.

  1. pip3 install pythreejs --user
  2. jupyter nbextension install --user --py pythreejs
  3. jupyter nbextension enable pythreejs --user --py

after this is done, you will be able to visualize the simulations using the Plot3D command.

For Debian/Ubuntu systems (old instructions)

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.

PyPI install (using pip - advanced users) The version in pip is outdated. Do not use this for the moment.

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) (not tested for python3 may not work anymore)

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.

You can’t perform that action at this time.