Authors: Konstantin Sering, Dominik Wabersich, & Nora Umbach
Keywords: ctypes, wrapper, EyeOne Pro photometer, color perception, achrolab
This poster presentation gives a short overview, how we run our vision laboratory in Python and focuses on some technical details of our Python module achrolab. Especially, how we achieved to control our photometer and how we wrote two wrappers to have a simple interface for our hardware.
In our vision laboratory, we wanted to match the luminance and color of the walls with the luminance and color of the monitor. We had a photometer to measure the (reflected) color of the wall and the emitted color of the monitor. Unfortunately, the software of the photometer was designed to only measure the surface color and emitting color, but not to measure reflecting color from a distance. A second drawback was, that measuring the color with that software had to be done manually and was very time consuming.
The hardware we used is not shipped with native Python support, but we had Software Development Kits (SDK), which describe how to use the hardware with C/C++ or Java. With the SDK and the corresponding header files for C/C++ we wrote two small ctypes wrappers that give us a convenient interface to the photometer (EyeOne Pro) and for controlling fluorescent tubes with a multifunction card (IODA-PCI12K4EXTENDED PCI 12 bit multifunction card with 4 analogous outputs). Implementation of these wrappers turned out to be straight forward. We included some features like a dummy mode, which is initialized when no dll-file is found. In dummy mode, you can dry run your experiment while programming it, without having access to a real EyeOne Pro photometer or a real wasco multifunction card.
This poster presentation will show how these wrappers are implemented and how easy it is for a scientist to build his/her own wrapper for non-Python supported devices, if a SDK for C/C++ is available. Additionally, we will show how we wrapped up all the code in a Python module called achrolab that also includes a simple procedure to match the luminance and color of the walls and the monitor. We are very interested in feedback, especially, how we can improve our code and are happy to share our experiences and code.
For the more general story how we build up our laboratory using Python see Umbach, Sering, and Wabersich, 2011.
Umbach, Sering, & Wabersich (2011). Controlling the equipment of a vision laboratory with Python. To be presented at EuroSciPy 2011, August 25-28, Paris, France