Classes of achrolab

achrolab contains several classes that we use to define certain illumination conditions in our color laboratory.

CalibMonitor

This module provides the class CalibMonitor which handles measuring of the monitor.

class achrolab.calibmonitor.CalibMonitor(eyeone, psychopy_win=None)

Provides an easy interface to measure psychopy.visual.GratingStim colors with an i1 Pro.

Example:

>>> from eyeone import eyeone
>>> eyeone = eyeone.EyeOne(dummy=True)
>>> mon = CalibMonitor(eyeone)
>>> mon.measureGratingStimColor("#FF0000FF", n=2) 
Measurement mode set to SingleEmission.
Color space set to CIExyY.

Please put i1 Pro on calibration plate and press key to start calibration.
Calibration of i1 Pro done.

Please put i1 Pro in measurement position and hit button to start measurement.

Please put i1 Pro in measurement position for MONITOR and press key to start
measurement. (Measure through the Box! Not directly on the monitor.)
Starting measurement...
[(...), ...]
checkForButtonPress()

Checks for a key press and stores key press in self.e.key.

measureColor(color, n=1)

Converts xyY color (triple of floats) to psychopy.visual.GratingStim color and measures color on monitor.

Parameters:
color: triple of float
xyY color list or tuple of three floats
grating_stim_value: triple, float or string
psychopy.visual.GratingStim color value
n: 1 or any other positive integer
number of measurements

Returns: Returns list of tuples of xyY values [(x1, y1, Y1), (x2, y2, Y2), ...]

measureGratingStimColor(grating_stim_value, n=1)

Measures grating_stim_value on monitor.

Parameters:
grating_stim_value: triple, float or string
psychopy.visual.GratingStim color value
n: 1 or any other positive integer
number of measurements (positive integer)

Returns list of tuples of xyY values [(x1, y1, Y1), (x2, y2, Y2), ...]

setColor(psychopy_color, colorSpace='rgb255')

Presents one color at the monitor.

startMeasurement()

Simply prompts to move i1 Pro to measurement position and waits for button response.

waitForButtonPress()

Waits for a key press and stores button press in self.e.key.

Calibrate

The module calibrate provides the classes to match fluorescent tubes illuminating a wall and the color of a monitor to each other with a photometer.

class achrolab.calibrate.Calibrate(calibmonitor, calibtubes)

Encapsulates the hardware dependencies to the photometer and to the tubes and the monitor.

This class also implements the calibration procedure. This calibration starts, when calibrateColorTable or calibrateColorEntry are called.

  1. test if the tubes are calibrated, if not abort
  2. test if the color entry was measured at the monitor, if not skip this color entry value
  3. guess starting voltages from color entry values (or use given)
  4. start adjustManualPlot so that you can adjust the tubes by hand and see your result measured with the photometer
  5. start adjustManualVision to check if the achieved calibration is satisfactory and adjust if necessary
  6. store final calibration in color entry

Example:

>>> from achrolab.eyeone.eyeone import EyeOne
>>> from achrolab.calibmonitor import CalibMonitor
>>> from achrolab.calibtubes import CalibTubes
>>> from achrolab.colortable import ColorTable
>>> from achrolab.colorentry import ColorEntry
>>> eyeone = EyeOne()
>>> calibmonitor = CalibMonitor(eyeone)
>>> calibtubes = CalibTubes(eyeone)
>>> calibtubes.calibrate(imi=0.1, n=4, each=1) 

        Note:
        The tubes must be switched on for at least four (!!) hours in
        order to radiate a stable amount of light.

Measurement mode set to SingleEmission.
Color space set to CIExyY.

Please put i1 Pro on calibration plate and press key to start
calibration. Calibration of i1 Pro done.

Please put i1 Pro in measurement positionand hit button to start
measurement.

Please put i1 Pro in measurement position and press key to start
measurement.

Turn off blue and green tubes!
Press key to start measurement of RED tubes.
Starting measurement...
(1024, 4095, 4095)
(2047, 4095, 4095)
(3070, 4095, 4095)
(4093, 4095, 4095)

Turn off red and blue tubes!
Press key to start measurement of GREEN tubes.
Starting measurement...
(4095, 1024, 4095)
(4095, 2047, 4095)
(4095, 3070, 4095)
(4095, 4093, 4095)

Turn off red and green tubes!
Press key to start measurement of BLUE tubes.
Starting measurement...
(4095, 4095, 1024)
(4095, 4095, 2047)
(4095, 4095, 3070)
(4095, 4095, 4093)

Turn ON red, green and blue tubes!
Press key to start measurement of ALL tubes.
Starting measurement...
(1024, 1024, 1024)
(2047, 2047, 2047)
(3070, 3070, 3070)
(4093, 4093, 4093)
Measurement finished.
...
...
>>> calibtubes.is_calibrated = True
>>> calibrate = Calibrate(calibmonitor, calibtubes)

Initializing search mode complete.
>>> colortable = ColorTable()
>>> color1 = ColorEntry("darkgreen", patch_stim_value=(0,100,0))
>>> color2 = ColorEntry("darkred", patch_stim_value=(100,0,0))
>>> colortable.addColorEntry(color1)
>>> colortable.addColorEntry(color2)
>>> calibrate.calibrateColorTable(colortable)
>>> print(colortable.color_list[0].monitor_xyY) 
(..., ..., ...)
>>> print(colortable.color_list[0].voltages) 
(..., ..., ...)
>>> print(colortable.color_list[0].tubes_xyY) 
(..., ..., ...)
adjustManualPlot(xyY, start_voltages=None)

Changes the tubes with key strokes in order to match the color and luminance of the wall to a given color value.

In order to match the values they are measured with the photometer and plotted.

Returns the final triple (voltages, xyY, spectrum).

Parameters:
xyY: (x, y, Y)
triple containing the three values for the xyY color
start_voltages: None or (vol_red, vol_green, vol_blue)
triple containing three values for the voltages if None starting values are guessed
adjustManualVision(color, start_voltages=None)

Changes the tubes with key strokes in order to match the color and luminance of the wall to a given color value.

The changed values are not measured, they are simply shown on the wall and the target value is presented at the monitor. It should be possible to adjust the colors with your own visual system.

Returns the final triple of voltages.

Parameters:
color: color which can be used by monitor.Monitor.setColor
this color will be presented by monitor.Monitor.setColor and is the target color to which you want to match the tubes
start_voltages: None or (vol_red, vol_green, vol_blue)
triple containing three values for the voltages if None starting values are guessed
calibrateColorEntry(colorentry, n=5)

Convenient function to calibrate a single colorentry object. Changes the colorentry object!

Parameters:
colorentry: colorentry.ColorEntry
the ColorEntry object will be calibrated
n: 5 or int
number of repeated measurements per condition
calibrateColorTable(colortable, each=5)

Convenient function to calibrate a colortable. Changes the colortable object!

Parameters:
colortable: colortable.ColorTable
every color in the ColorTable object will be calibrated
each: 5 or int
number of repeated measurements per colorentry

CalibTubes

This module provides the class CalibTubes. An easy interface to measure a color with the i1 Pro photometer.

class achrolab.calibtubes.CalibTubes(eyeone)

CalibTubes provides an easy interface to measure a color with i1 Pro and to find corresponding voltages for a given color.

Example:

>>> from eyeone.eyeone import EyeOne
>>> eyeone = EyeOne(dummy=True)
>>> caltub = CalibTubes(eyeone)
>>> caltub.calibrate(imi=0.1, n=10, each=2)

        Note:
        The tubes must be switched on for at least four (!!) hours in
        order to radiate a stable amount of light.

Measurement mode set to SingleEmission.
Color space set to CIExyY.

Please put i1 Pro on calibration plate and press key to start
calibration. Calibration of i1 Pro done.

Please put i1 Pro in measurement positionand hit button to start
measurement.

Please put i1 Pro in measurement position and press key to start
measurement.

Turn off blue and green tubes!
Press key to start measurement of RED tubes.
Starting measurement...
(1024, 4095, 4095)
(1024, 4095, 4095)
(1365, 4095, 4095)
(1365, 4095, 4095)
(1706, 4095, 4095)
(1706, 4095, 4095)
(2047, 4095, 4095)
(2047, 4095, 4095)
(2388, 4095, 4095)
(2388, 4095, 4095)
(2729, 4095, 4095)
(2729, 4095, 4095)
(3070, 4095, 4095)
(3070, 4095, 4095)
(3411, 4095, 4095)
(3411, 4095, 4095)
(3752, 4095, 4095)
(3752, 4095, 4095)
(4093, 4095, 4095)
(4093, 4095, 4095)

Turn off red and blue tubes!
Press key to start measurement of GREEN tubes.
Starting measurement...
(4095, 1024, 4095)
(4095, 1024, 4095)
(4095, 1365, 4095)
(4095, 1365, 4095)
(4095, 1706, 4095)
(4095, 1706, 4095)
(4095, 2047, 4095)
(4095, 2047, 4095)
(4095, 2388, 4095)
(4095, 2388, 4095)
(4095, 2729, 4095)
(4095, 2729, 4095)
(4095, 3070, 4095)
(4095, 3070, 4095)
(4095, 3411, 4095)
(4095, 3411, 4095)
(4095, 3752, 4095)
(4095, 3752, 4095)
(4095, 4093, 4095)
(4095, 4093, 4095)

Turn off red and green tubes!
Press key to start measurement of BLUE tubes.
Starting measurement...
(4095, 4095, 1024)
(4095, 4095, 1024)
(4095, 4095, 1365)
(4095, 4095, 1365)
(4095, 4095, 1706)
(4095, 4095, 1706)
(4095, 4095, 2047)
(4095, 4095, 2047)
(4095, 4095, 2388)
(4095, 4095, 2388)
(4095, 4095, 2729)
(4095, 4095, 2729)
(4095, 4095, 3070)
(4095, 4095, 3070)
(4095, 4095, 3411)
(4095, 4095, 3411)
(4095, 4095, 3752)
(4095, 4095, 3752)
(4095, 4095, 4093)
(4095, 4095, 4093)

Turn ON red, green and blue tubes!
Press key to start measurement of ALL tubes.
Starting measurement...
(1024, 1024, 1024)
(1024, 1024, 1024)
(1365, 1365, 1365)
(1365, 1365, 1365)
(1706, 1706, 1706)
(1706, 1706, 1706)
(2047, 2047, 2047)
(2047, 2047, 2047)
(2388, 2388, 2388)
(2388, 2388, 2388)
(2729, 2729, 2729)
(2729, 2729, 2729)
(3070, 3070, 3070)
(3070, 3070, 3070)
(3411, 3411, 3411)
(3411, 3411, 3411)
(3752, 3752, 3752)
(3752, 3752, 3752)
(4093, 4093, 4093)
(4093, 4093, 4093)
Measurement finished.
FAILED to estimate parameters for tubes.
Look at calibration_tubes_raw_XX.txt for data.
>>> caltub.saveParameter("example_tube_calibration.pkl")
calibrate(imi=0.5, n=50, each=1)

Calibrates tubes with i1 Pro. i1 Pro should be connected to the computer. The calibration takes around 2 ?? minutes.

Parameters:
imi: 0.5 or any positive float
inter measurement interval in seconds
n: 50 or any positive integer greater 2
number of steps per tube to calibrate (must be greater or equal 2)
each: 1 or any positive integer
number of measurements per color
guessVoltages(Y)

Guesses voltages from parameters from calibration as a crude starting value and returns triple of integers.

Y is target luminance of monitor. The individual color for each channel is taken from an old calibration that looked good and assumes that the ratio of red, green, and blue is constant for different intensities. This is of course very crude!

loadParameter(filename='./lastParameterTubes.pkl')

Loads parameters used for interpolation function.

measureOneColorChannel(color, imi=0.5, n=50, each=1, insertfunction=<function voltageSteps at 0x000000001138E908>)

Measures one color of the tubes (red, green, or blue) from lowest to highest luminance.

  • color – string one of “red”, “green”, “blue”, “all”
  • imi – inter measurement interval in seconds
  • n – number of steps >= 2
  • each – number of measurements per color

Returns triple of lists (voltages, rgb, spectra).

This function immediately starts measuring. There is no prompt to start measurement.

measureVoltages(voltages, imi=0.5, each=1)

Measures color of tubes for given voltages.

Parameters:
voltages: ( (vol_r1, vol_g1, volb1), (vol_r2, vol_g2, vol_b2), ...)
a list of triples of integers
imi: 0.5 or any positive float
inter measurement interval in seconds
each: 1 or any positive integer
number of measurements per voltage

Returns list of triples (voltages, yxY, spectrum). All elements of the triples are tuples as well. For example: [( (vol_r1, vol_g1, vol_b1), (x1, y1, Y1), (l_1, l_2, l_3, ..., l_36) ), ...]

plotCalibration()

Plots luminance curves for each channel (data and fitted curve).

printNote()

Prints a note, that states what is important, when you use the tubes.

saveParameter(filename='./lastParameterTubes.pkl')

Saves parameters used for interpolation function.

setVoltages(voltages)

Sets tubes to given voltages.

If setVoltages gets an ColorEntry object, it extracts the voltages from this object and sets the tubes accordingly.

WARNING: Don’t set the tubes directly (e.g., via wasco), because the change in voltage has to be smoothly. This prevents the fluorescent tubes to accidentally give out.

startMeasurement()

Simply prompts to move i1 Pro to measurement position and to wait for button response.

voltageSteps(step, i, n=None)

ColorEntry

This modules provides the class ColorEntry which stores all important information for one color.

class achrolab.colorentry.ColorEntry(name, grating_stim_value=None, voltages=None)

ColorEntry contains all information for one color which we need in the lab.

Attributes:
name: string
name of the color
grating_stim_value: float, triple or string
a value that can be used to set the color of psychopy.GratingStim
monitor_xyY: triple of floats
measured xyY values for monitor
monitor_xyY_sd: triple of floats
standard deviation for xyY values
voltages: triple of int
corresponding voltages for color tubes
tubes_xyY: triple of floats
measured xyY values for tubes
tubes_xyY_sd: triple of floats
standard deviation for xyY values

Example:

>>> ce1 = ColorEntry(name="grey1", grating_stim_value="#404040FF")
>>> ce2 = ColorEntry(name="grey2", voltages=(0xA00, 0xA00, 0xA00))

ColorTable

class achrolab.colortable.ColorTable(filename='')

Stores colors in xyY coordinates and all data needed for psychopy.visual.GratingStim, the monitor, and the tubes.

The colors in ColorTable are indexed. So there is a first and a last color.

ColorTable is a list of ColorEntries with some useful functions defined on this list.

Example:

>>> from colorentry import ColorEntry
>>> coltab = ColorTable()
>>> coltab.addColorEntry(ColorEntry("grey1",
...    grating_stim_value="#505050FF"))
>>> ce = coltab.getColorByName("grey1")
>>> print(ce.grating_stim_value)
#505050FF
addColorEntry(ce)

Adds a color entry to the color table.

Parameters:
ce: colorentry.ColorEntry instance
object that stores a color entry
getColorByName(name)

Returns the first object in color_list for the name given.

Parameters:
name: string
name of colorentry.ColorEntry object
Returns:
out: ColorEntry
first object in color_list for the name given.
getColorsByName(names)

Returns ColorEntry objects in a list, ordered after name_list.

Parameters:
names: sequence of strings
list with names of colorentry.ColorEntry objects
Returns:
out: sequence of ColorEntry objects
list with colorentry.ColorEntry objects corresponding to the names given in names
loadFromCsv(filename)

Loads object from comma separated text file (.csv).

Parameters:
filename: string
string that gives the filename and the location of the file
loadFromPickle(filename)

Loads object from pickle file (.pkl).

Parameters:
filename: string
string that gives the filename and the location of the file
loadFromR(filename)

Loads object from R data file.

Parameters:
filename: string
string that gives the filename and the location of the file
saveToCsv(filename)

Saves object to comma separated text file (.csv).

Parameters:
filename: string
string that gives the filename and the location of the file
saveToPickle(filename)

Saves object to pickle file (.pkl).

Parameters:
filename: string
string that gives the filename and the location of the file

Convert

This module provides a class to convert xyY color values to rgb and vica versa.

class achrolab.convert.Convert

Convert object of xyY coordinates to RGB coordinates. Object must be tuple of length three.

In order to convert xyY to RGB we need two steps:

  1. Transform xyY back to XYZ.
  2. Use transformation matrix to convert XYZ to RGB. This matrix is different for different RGB spaces. Right now the class is implemented for CIE RGB with reference white E.
convertXyYToRgb(xyY)

Convert from xyY to RGB.

convertXyYToXyz(xyY)

Convert from xyY to XYZ.

convertXyzToRgb(xyz)

Convert from XYZ to RGB.

achrolab.convert.xyY2rgb(xyY)

Converts xyY coordinates to CIE RGB coordinates, white point D65.

DevKnobs

Defines a class that encapsulates the triggering and reading out for the knobs from the user.

class achrolab.devknobs.DevKnobs(dummy=False)

Encapsulates all functions getting input from the knobs.

Example:

>>> devknobs = DevKnobs(dummy=True)
>>> states = devknobs.getStates()
getStates()

Returns (red, green, blue, all) as integer values between 0 and 0xFFF.

Internally it triggers the measurement and reads out the values from the wasco card.

states

DevTubes

class achrolab.devtubes.DevTubes(dummy=False)

Encapsulates all functions controlling fluorescent tubes in the booth. It provides all low level functionality.

Example:

>>> devtub = DevTubes(dummy=True)
>>> devtub.setVoltages((1000, 1000, 1000))
setVoltages(U_rgb)

Sets voltage in list or tuple of U_rgb to wasco card. U_rgb should contain three integers between self.low_threshold and self.high_threshold.

Monitor

This module provides the class Monitor, which encapsulates the presentation of a color stimuli on the monitor.

It is deprecated to use any other code than this in order to present one color and collect key presses.

class achrolab.monitor.Event

Very small class to store a key stroke.

class achrolab.monitor.Monitor(psychopy_win=None)

Provides a convenient interface to present a color on the monitor and get key strokes.

Example:

>>> mon = Monitor()
>>> mon.setColor("#00FF00FF")
checkForButtonPress()

Checks for a key press and stores key press in self.e.key.

setColor(psychopy_color, colorSpace='rgb255')

Presents one color at the monitor.

waitForButtonPress()

Waits for a key press and stores button press in self.e.key.

CalibDataFile

This modules provides the class CalibDataFile, which provides a convenient method of writing the calibration data to a comma separated file.

class achrolab.printing.CalibDataFile(prefix='calibdata_', file_type='txt', delimiter='t')

Provides a new method to write the calibration data of the monitor/photometer to a comma separated file.

Example:

>>> import printing
>>> with printing.CalibDataFile(prefix="YourPrefixHere",
...             delimiter=" ") as filename:
>>>     #code here
>>>     filename.write_data_txt(rgb=rgb, xyY=None, voltage=None,
...             spec_list=spec_list)
>>>     #more code

If there is an error inside the with context, it will immediately close and write to the file, so data are not lost.

close()
write(text)
write_data_txt(grayvals=None, rgb=None, xyY=None, voltage=None, spec_list=None, delimiter='t')
class achrolab.printing.TubesDataFile(prefix='measure_tubes_', delimiter='t')

Provides a new method to write the calibration of the tubes data to a comma separated file.

Example:

>>> import printing
>>> with printing.CalibDataFile(prefix="YourPrefixHere",
...             delimiter=" ") as filename:
>>>     #code here
>>>     filename.write_data_txt(rgb=rgb, xyY=None, voltage=None,
...             spec_list=spec_list)
>>>     #more code

If there is an error inside the with context, it will immediately close and write to the file, so data are not lost.

close()
write(text)
write_data_txt(xyY=None, voltage=None, spec_list=None)
write_data_txt_loop(xyY=None, voltage=None, spec_list=None)

SetTubesManual

This module provides a class to manually adjust the tubes. With key strokes you can adjust the color of the tubes and then with another key stroke measure the current color with the i1 photometer. The measurements and the target color are plottet in a figure, so that you know in which direction you should change your illumination.

class achrolab.setmanual.SetTubesManualBase(tubes, knobs, start_voltages=None, target_color=None)

Base class for SetTubesManualPlot and SetTubesManualVision implementing all the stuff for the tubes.

adjustTube()

Enables up and down arrow to adjust tubes’ color step by step (lower if down and higher if up).

measureVoltage()

If you want to actually measure the tubes, you have to implement this method.

newFigure()

If you want to actually have a plot, than implement this method. It should recreate the plot and dismisses all old measurements.

onKeyPress(event)

Handles the different key presses and calls the corresponding method.

run()

Starts program to set tubes by hand. Has to be implemented by children.

setVoltagesKnobs()

Set the voltages depending on the states of the knobs.

tellme(text)

Function to write text to the stdout.

class achrolab.setmanual.SetTubesManualPlot(calibtubes, knobs, start_voltages=None, target_color=None)

Creates an interactive figure with matplotlib, so that you can adjust the tubes and plot your measurements in this figure.

Example:

>>> from achrolab.eyeone.eyeone import EyeOne
>>> from achrolab.calibtubes import CalibTubes
>>> from achrolab.devknobs import DevKnobs
>>> eyeone = EyeOne()
>>> calibtubes = CalibTubes(eyeone)
>>> knobs = DevKnobs()
>>> man_plot = SetTubesManualPlot(calibtubes, knobs,
...         start_voltages=(1561, 2253, 2181), target_color=(0.298,
...                 0.321, 64.1))
Measurement mode set to SingleEmission.
Color space set to CIExyY.

Please put i1 Pro on calibration plate and press key to start calibration.
Calibration of i1 Pro done.

Please put i1 Pro in measurement positionand hit button to start measurement.

Initializing search mode complete.
>>> final_measurement = man_plot.run() 


Wait until first measurement is done.
Get to the red cross
xyY: ...,...,...


Manual adjustment of tubes` color

Press [o] to use knObs or press [k] to use Keyboard (default).
Press [up] for higher intensity or press [down] for lower intensity.
To set tube color and step size press the following buttons:
Stepsize:
 [1] - 1
 [2] - 5
 [3] - 10
 [4] - 50
 [5] - 100
Colortube:
 [r] - Red
 [g] - Green
 [b] - Blue
 [a] - all
To trigger measurement press [space].
Press [c] to redraw figure.
Press [escape] to quit (and save last voltages)

Don't press the [down] key due to a bug.
>>> print(final_measurement) 
([...,...,...], [...,...,...], [...])
adjustTube()

Enables up and down arrow to adjust tubes’ color step by step (lower if down and higher if up).

measureVoltage()

Measures the voltages each times.

TODO this function might be replaced by calibtubes.CalibTubes.measureVoltages()

newFigure()

Closes figure and recreates it.

This is necessary because sometimes the figure freezes and does not respond to drawing command.

onKeyPress(event)

Handles the different key presses and calls the corresponding method.

run()

Starts program to set tubes by hand.

Returns the final triple (voltages, xyY, spectrum).

runKnobs()

Check if interface is knobs and set voltages according to the interface.

Is used as a callback for a timer in matplotlib.

setVoltagesKnobs()

Set the voltages depending on the states of the knobs.

tellme(s)

Function to write s to the stdout and to the tile of the plot.

class achrolab.setmanual.SetTubesManualVision(tubes, knobs, monitor, start_voltages=None, target_color=None)

Creates an interactive screen, which shows the target color and allows to adjust the tubes with key strokes.

Example:

>>> from achrolab.tubes import Tubes
>>> from achrolab.devknobs import DevKnobs
>>> from achrolab.monitor import Monitor
>>> tubes = Tubes()
>>> knobs = DevKnobs()
>>> monitor = Monitor()
>>> man_vision = SetTubesManualVision(tubes, knobs, monitor,
...         start_voltages=(1561, 2253, 2181), target_color=(0,
...         100, 0))
>>> final_voltages = man_vision.run()


Manual adjustment of tubes` color

Press [o] to use knObs or press [k] to use Keyboard (default).
Press [up] for higher intensity or press [down] for lower intensity.
To set tube color and step size press the following buttons:
Stepsize:
 [1] - 1
 [2] - 5
 [3] - 10
 [4] - 50
 [5] - 100
Colortube:
 [r] - Red
 [g] - Green
 [b] - Blue
 [a] - all
Press [escape] to quit (and save last voltages)
>>> print(final_voltages) 
[...,...,...]
adjustTube()

Enables up and down arrow to adjust tubes’ color step by step (lower if down and higher if up).

measureVoltage()

If you want to actually measure the tubes, you have to implement this method.

newFigure()

If you want to actually have a plot, than implement this method. It should recreate the plot and dismisses all old measurements.

onKeyPress(event)

Handles the different key presses and calls the corresponding method.

run()

Starts program to set tubes by hand.

Returns the final triple of voltages.

setVoltagesKnobs()

Set the voltages depending on the states of the knobs.

tellme(text)

Function to write text to the stdout.

achrolab.setmanual.setColorTube(key)

Defines which color of the tubes should be changed.

Returns tuple (color channel, index).

achrolab.setmanual.setStepSize(key)

Defines step size of change.

Tubes

The tubes class gives an easy interface to handle the tubes and CalibTubes provides convenient methods to measure and calibrate the tubes.

class achrolab.tubes.Tubes(dummy=False)

Gives high level access to the tubes.

This class hides all the hardware specifications and has no dependencies on the eyeone module.

Example:

>>> tub = Tubes(dummy=True)
>>> tub.setVoltages((1000, 1000, 1000))
>>> tub.printNote()

        Note:
        The tubes must be switched on for at least four (!!) hours in
        order to radiate a stable amount of light.
printNote()

Prints a note, that states what is important, when you use the tubes.

setVoltages(voltages)

Sets tubes to given voltages.

If setVoltages gets an ColorEntry object, it extracts the voltages from this object and sets the tubes accordingly.

WARNING: Don’t set the tubes directly (e.g., via wasco), because the change in voltage has to be smoothly. This prevents the fluorescent tubes to accidentally give out.