Most users won’t need to use the code here. In general the Monitor Centre interface is sufficient and monitors setup that way can be passed as strings to Window s. If there is some aspect of the normal calibration that you wish to override. eg:
from psychopy import visual, monitors
mon = monitors.Monitor('SonyG55')#fetch the most recent calib for this monitor
mon.setDistance(114)#further away than normal?
win = visual.Window(size=[1024,768], monitor=mon)
You might also want to fetch the Photometer class for conducting your own calibrations
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:
width, distance, gamma are details about the calibration
notes is a text field to store any useful info
useBits True, False, None
verbose True, False, None
- currentCalib is a dict object containing various fields for a calibration. Use with caution
since the dict may not contain all the necessary fields that a monitor object expects to find.
eg:
myMon = Monitor('sony500', distance=114) Fetches the info on the sony500 and overrides its usual distance to be 114cm for this experiment.
For both methods, if you then save any modifications will be saved as well.
Stores the settings for the current calibration settings as new monitor.
Remove a specific calibration from the current monitor. Won’t be finalised unless monitor is saved
Determine whether we’re using the default gamma values
As a python date object (convert to string using calibTools.strFromDate
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.
Returns distance from viewer to the screen in cm, or None if not known
Gets the min,max,gamma values for the each gun
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.
Gets the measured luminance values from last calibration TEST
Gets the measured luminance values from last calibration
Gets the min,max,gamma values for the each gun
Gets the measured luminance values from last calibration TEST
Gets the measured luminance values from last calibration
Notes about the calibration
Returns the size of the current calibration in pixels, or None if not defined
Gets the wavelength values from the last spectrometer measurement (if available)
Was this calibration carried out witha a bits++ box
Of the viewable screen in cm, or None if not known
lums should be uncalibrated luminance values (e.g. a linear ramp) ranging 0:1
create a new (empty) calibration for this monitor and makes this the current calibration
saves the current dict of calibs to disk
Sets the calibration to a given date/time or to the current date/time if none given. (Also returns the date as set)
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.
sets the DKL->RGB conversion matrix for a chromatically calibrated monitor (matrix is a 3x3 num array).
To the screen (cm)
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)
Sets the min,max,gamma values for the each gun
sets the LMS->RGB conversion matrix for a chromatically calibrated monitor (matrix is a 3x3 num array).
Sets the last set of luminance values measured AFTER calibration
Sets the last set of luminance values measured during calibration
Sets the method for linearising 0 uses y=a+(bx)^gamma 1 uses y=(a+bx)^gamma 2 uses linear interpolation over the curve
Sets the last set of luminance values measured AFTER calibration
Sets the last set of luminance values measured during calibration
Records the mean luminance (for reference only)
For you to store notes about the calibration
sets the phosphor spectra measured by the spectrometer
Of the viewable screen (cm)
Class for managing gamma tables
Parameters:
in range 0.0:1.0, or range 0:255. Should include the min and max of the monitor
Then give EITHER “lums” or “gamma”:
- lums = measured luminance at given input levels
- gamma = your own gamma value (single float)
- bitsIN = number of values in your lookup table
- bitsOUT = number of bits in the DACs
myTable.gammaModel myTable.gamma
Provides an error function for fitting gamma function
(used by fitGammaFun)
Fits a gamma function to the monitor calibration data.
Find the names of all monitors for which calibration files exist
DEPRECATED (as of v.1.60.01). Use psychopy.hardware.findPhotometer() instead, which finds a wider range of devices
DEPRECATED (since v1.60.01): Use psychopy.monitors.getLumSeries() instead
Params: |
a photometer might be found (not recommended) |
---|
Returns gamma-transformed luminance values. y = gammaFun(x, minLum, maxLum, gamma)
a and b are calculated directly from minLum, maxLum, gamma
Parameters:
- xx are the input values (range 0-255 or 0.0-1.0)
- minLum = the minimum luminance of your monitor
- maxLum = the maximum luminance of your monitor (for this gun)
- gamma = the value of gamma (for this gun)
Returns inverse gamma function for desired luminance values. x = gammaInvFun(y, minLum, maxLum, gamma)
a and b are calculated directly from minLum, maxLum, gamma Parameters:
xx are the input values (range 0-255 or 0.0-1.0)
minLum = the minimum luminance of your monitor
maxLum = the maximum luminance of your monitor (for this gun)
gamma = the value of gamma (for this gun)
- eq determines the gamma equation used;
eq==1[default]: yy = a + (b*xx)**gamma eq==2: yy = (a + b*xx)**gamma