Package psychopy :: Package monitors :: Module calibTools :: Class Monitor
[frames] | no frames]

Class Monitor

source code

Creates a monitor object for storing calibration details. This will be loaded automatically from disk if the monitor name is already defined (see methods).

Many settings from the stored monitor can easilly be overridden either by adding them as arguments during the initial call.

arguments:

eg:

myMon = Monitor('sony500', distance=114) Fetches the info on the sony500 and overrides its usual distance to be 114cm for this experiment.

myMon = Monitor('sony500')
followed by...
myMon['distance']=114
...does the same!

For both methods, if you then save any modifications will be saved as well.

Instance Methods
 
__init__(self, name, width=None, distance=None, gamma=None, notes=None, useBits=None, verbose=True, currentCalib={}) source code
 
gammaIsDefault(self) source code
 
setSizePix(self, pixels) source code
 
setWidth(self, width)
Of the viewable screen (cm)
source code
 
setDistance(self, distance)
To the screen (cm)
source code
 
setCalibDate(self, date=None)
Sets the calibration to a given date/time or to the current date/time if none given.
source code
 
setGamma(self, gamma)
Sets the gamma value(s) for the monitor.
source code
 
setGammaGrid(self, gammaGrid)
Sets the min,max,gamma values for the each gun
source code
 
setLineariseMethod(self, method)
Sets the method for linearising 0 uses y=a+(bx)^gamma 1 uses y=(a+bx)^gamma 2 uses linear interpolation over the curve
source code
 
setMeanLum(self, meanLum)
Records the mean luminance (for reference only)
source code
 
setLumsPre(self, lums)
Sets the last set of luminance values measured during calibration
source code
 
setLumsPost(self, lums)
Sets the last set of luminance values measured AFTER calibration
source code
 
setLevelsPre(self, levels)
Sets the last set of luminance values measured during calibration
source code
 
setLevelsPost(self, levels)
Sets the last set of luminance values measured AFTER calibration
source code
 
setDKL_RGB(self, dkl_rgb)
sets the DKL->RGB conversion matrix for a chromatically calibrated monitor (matrix is a 3x3 num array).
source code
 
setSpectra(self, nm, rgb)
sets the phosphor spectra measured by the spectrometer
source code
 
setLMS_RGB(self, lms_rgb)
sets the LMS->RGB conversion matrix for a chromatically calibrated monitor (matrix is a 3x3 num array).
source code
 
setPsychopyVersion(self, version) source code
 
setNotes(self, notes)
For you to store notes about the calibration
source code
 
setUseBits(self, usebits) source code
 
getSizePix(self)
Returns the size of the current calibration in pixels, or None if not defined
source code
 
getWidth(self)
Of the viewable screen in cm, or None if not known
source code
 
getDistance(self)
Returns distance from viewer to the screen in cm, or None if not known
source code
 
getCalibDate(self)
As a python date object (convert to string using calibTools.strFromDate
source code
 
getGamma(self) source code
 
getGammaGrid(self)
Gets the min,max,gamma values for the each gun
source code
 
getLineariseMethod(self)
Gets the min,max,gamma values for the each gun
source code
 
getMeanLum(self) source code
 
getLumsPre(self)
Gets the measured luminance values from last calibration
source code
 
getLumsPost(self)
Gets the measured luminance values from last calibration TEST
source code
 
getLevelsPre(self)
Gets the measured luminance values from last calibration
source code
 
getLevelsPost(self)
Gets the measured luminance values from last calibration TEST
source code
 
getSpectra(self)
Gets the wavelength values from the last spectrometer measurement (if available)
source code
 
getDKL_RGB(self, RECOMPUTE=False)
Returns the DKL->RGB conversion matrix.
source code
 
getLMS_RGB(self, RECOMPUTE=False)
Returns the LMS->RGB conversion matrix.
source code
 
getPsychopyVersion(self) source code
 
getNotes(self)
Notes about the calibration
source code
 
getUseBits(self)
Was this calibration carried out witha a bits++ box
source code
 
newCalib(self, calibName=None, width=None, distance=None, gamma=None, notes=None, useBits=False, verbose=True)
create a new (empty) calibration for this monitor and makes this the current calibration
source code
 
setCurrent(self, calibration=-1)
Sets the current calibration for this monitor.
source code
 
delCalib(self, calibName)
Remove a specific calibration from the current monitor.
source code
 
saveMon(self)
saves the current dict of calibs to disk
source code
 
copyCalib(self, calibName=None)
Stores the settings for the current calibration settings as new monitor.
source code
 
lineariseLums(self, desiredLums, newInterpolators=False, overrideGamma=None)
lums should be uncalibrated luminance values (e.g.
source code
Method Details

setCalibDate(self, date=None)

source code 
Sets the calibration to a given date/time or to the current date/time if none given. (Also returns the date as set)

setGamma(self, gamma)

source code 
Sets the gamma value(s) for the monitor. This only uses a single gamma value for the three guns, which is fairly approximate. Better to use setGammaGrid (which uses one gamma value for each gun)

getSpectra(self)

source code 

Gets the wavelength values from the last spectrometer measurement (if available)

usage:
  • nm, power = monitor.getSpectra()

getDKL_RGB(self, RECOMPUTE=False)

source code 
Returns the DKL->RGB conversion matrix. If one has been saved this will be returned. Otherwise, if power spectra are available for the monitor a matrix will be calculated.

getLMS_RGB(self, RECOMPUTE=False)

source code 
Returns the LMS->RGB conversion matrix. If one has been saved this will be returned. Otherwise (if power spectra are available for the monitor) a matrix will be calculated.

setCurrent(self, calibration=-1)

source code 

Sets the current calibration for this monitor. Note that a single file can hold multiple calibrations each stored under a different key (the date it was taken)

The argument is either a string (naming the calib) or an integer eg:

myMon.setCurrent'mainCalib') fetches the calibration named mainCalib calibName = myMon.setCurrent(0) fetches the first calibration (alphabetically) for this monitor calibName = myMon.setCurrent(-1) fetches the last alphabetical calib for this monitor (this is default) If default names are used for calibs (ie date/time stamp) then this will import the most recent.

delCalib(self, calibName)

source code 
Remove a specific calibration from the current monitor. Won't be finalised unless monitor is saved

lineariseLums(self, desiredLums, newInterpolators=False, overrideGamma=None)

source code 
lums should be uncalibrated luminance values (e.g. a linear ramp) ranging 0:1