Tempesta’s Core: GUI and communication with hardware

Tempesta is provided with its own GUI to make it user-friendly. The global layout is defined in the widget called control, and individual layouts are defined within the code of each widget.

The communication with the different instruments is initialized as soon as Tempesta is started; it tests if they are connected when possible creates an object to control them. Otherwise, it creates a Mocker, which has the same attributes but doesn’t correspond to any physical device, so it can run even without hardware.

Initiation: main


Tempesta is started from here. This function calls the different instruments from control.instruments and creates the GUI with the method TempestaGUI in control. The different devices to use are to be specified here.

Control: the GUI

class control.control.TempestaGUI(bluelaser, violetlaser, uvlaser, scanZ, daq, orcaflash, slm, *args, **kwargs)

Main GUI class. This class calls other modules in the control folder

  • bluelaser (Laser) – object controlling one laser
  • violetlaser (Laser) – object controlling one laser
  • uvlaser (Laser) – object controlling one laser
  • orcaflash (Camera) – object controlling a CCD camera
  • slm (SLMdisplay) – object controlling a SLM
closeEvent(*args, **kwargs)

closes the different devices. Resets the NiDaq card, turns off the lasers and cuts communication with the SLM

Instruments control

Created on Sun Dec 28 13:25:27 2014

@author: federico

class control.instruments.Camera

Buffer class for testing whether the camera is connected. If it’s not, it returns a dummy class for program testing.

class control.instruments.Laser

An object to communicate with a laser with a Lantz driver

class control.instruments.OneFiveLaser(port='COM10', intensity_max=0.8)

class used to control the 775 nm laser via a RS 232 interface. The commands are defined in the laser manual, must be binary and end with an LF statement

  • port (string) – specifies the name of the port to which the laser is connected (usually COM10).
  • intensity_max (float) – specifies the maximum intensity (in our case in W) the user can ask the laser to emit. It is used to protect sensitive hardware from high intensities

Method for turning on the laser


Returns actual current


Returns available commands


Returns mode of operation: constant current or current power


Returns internal measured Laser power


gets the nominal power command in W


Gets Temperature of SHG cristal


To get the laser emission power (mW)


To handle output power set point (mW)


sets current in constant current mode.


sets the pulse frequency in MHz


value=1: constant current mode value=0 : constant power mode


if manual=0, the power can be changed via this interface if manual=1, it has to be changed by turning the button (manually)


defines the trigger level in Volts, between -5 and 5V


source=0: internal frequency generator source=1: external trigger source for adjustable trigger level, Tr-1 In source=2: external trigger source for TTL trigger, Tr-2 In


Current device status

class control.instruments.SLM

This object communicates with an SLM as a second monitor, using a wxpython interface defined in slmpy.py. If no second monitor is detected, it replaces it by a Mocker with the same methods as the normal SLM object

class control.instruments.STORMCamera(*args, **kwargs)

Subclass of the Andor’s lantz driver. It adapts to our needs the whole functionality of the camera.

class control.instruments.ScanZ

Drives a stage for Z scanning

class control.instruments.Webcam

Initiates communication with a webcam with pygame