A class to handle the CRS Ltd ColorCAL device
Open serial port connection with Colorcal II device
cc = ColorCAL(port, maxAttempts)
Perform a calibration to zero light.
For early versions of the ColorCAL this had to be called after connecting to the device. For later versions the dark calibration was performed at the factory and stored in non-volatile memory.
You can check if you need to run a calibration with:
Get the calibration matrix from the device, needed for transforming measurements into real-world values.
This is normally retrieved during __init__ and stored as ColorCal.calibMatrix so most users don’t need to call this function.
Queries the device for information
firmwareVersion, firmwareBuild) = colorCal.getInfo()
ok will be True/False Other values will be a string or None.
Conducts a measurement and returns the measured luminance
The luminance is always also stored as .lastLum
Check whether the device needs a dark calibration
In initial versions of CRS ColorCAL mkII the device stored its zero calibration in volatile memory and needed to be calibrated in darkness each time you connected it to the USB
This function will check whether your device requires that (based on firmware build number and whether you’ve already done it since python connected to the device).
True or False
longName= 'CRS ColorCAL'¶
Conduct a measurement and return the X,Y,Z values
ok, X, Y, Z = colorCal.measure()
ok is True/False X, Y, Z are the CIE coordinates (Y is luminance in cd/m**2)
Following a call to measure, the values ColorCAL.lastLum will also be populated with, for compatibility with other devices used by PsychoPy (notably the PR650/PR655)
This should be used in place of the standard serial.Serial.readline() because that doesn’t allow us to set the eol character
Send a command to the photometer and wait an alloted timeout for a response.