How to use the psychopy.experiment.components.Param function in psychopy

To help you get started, we’ve selected a few psychopy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github psychopy / psychopy / psychopy / experiment / components / grating / __init__.py View on Github external
hint=msg,
            label=_localized['phase'], categ="Advanced")

        msg = _translate(
            "Resolution of the texture for standard ones such as sin, sqr "
            "etc. For most cases a value of 256 pixels will suffice")
        self.params['texture resolution'] = Param(
            texRes,
            valType='code', allowedVals=['32', '64', '128', '256', '512'],
            updates='constant', allowedUpdates=[],
            hint=msg,
            label=_localized['texture resolution'], categ="Advanced")

        msg = _translate("How should the image be interpolated if/when "
                         "rescaled")
        self.params['interpolate'] = Param(
            interpolate, valType='str', allowedVals=['linear', 'nearest'],
            updates='constant', allowedUpdates=[],
            hint=msg,
            label=_localized['interpolate'], categ="Advanced")

        msg = _translate("OpenGL Blendmode: avg gives traditional transparency,"
                         " add is important to combine gratings)]")
        self.params['blendmode'] = Param(
            blendmode, valType='str', allowedVals=['avg', 'add'],
            updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['blendmode'], categ="Basic")
github psychopy / psychopy / psychopy / experiment / components / variable / __init__.py View on Github external
self.order += ['startExpValue', 'saveStartExp', 'startRoutineValue', 'saveStartRoutine', 'startFrameValue',
                       'saveFrameValue', 'saveEndRoutine', 'saveEndExp']

        # set parameters
        hnt = _translate("The start value. A variable can be set to any value.")
        self.params['startExpValue'] = Param(
            startExpValue, valType='code', allowedTypes=[], updates='constant',
            hint=hnt,
            label=_localized['startExpValue'])
        hnt = _translate("Set the value for the beginning of each routine.")
        self.params['startRoutineValue'] = Param(
            startRoutineValue, valType='code', allowedTypes=[], updates='constant',
            hint=hnt,
            label=_localized['startRoutineValue'])
        hnt = _translate("Set the value for the beginning of every screen refresh.")
        self.params['startFrameValue'] = Param(
            startFrameValue, valType='code', allowedTypes=[],
            hint=hnt,
            label=_localized['startFrameValue'])
        # Save options
        hnt = _translate('Save the experiment start value in data file.')
        self.params['saveStartExp'] = Param(
            False, valType='bool',
            updates='constant',
            hint=hnt,
            label=_localized['saveStartExp'],
            categ='Save')
        hnt = _translate('Save the experiment end value in data file.')
        self.params['saveEndExp'] = Param(
            False, valType='bool',
            updates='constant',
            hint=hnt,
github psychopy / psychopy / psychopy / experiment / components / slider / __init__.py View on Github external
"rating scale)"),
                label=_translate('Granularity'))
        self.params['forceEndRoutine'] = Param(
                forceEndRoutine, valType='bool', allowedTypes=[],
                updates='constant', allowedUpdates=[],
                hint=_translate("Should setting a rating (releasing the mouse) "
                                "cause the end of the routine (e.g. trial)?"),
                label=_localized['forceEndRoutine'])
        self.params['pos'] = Param(
                pos, valType='code', allowedTypes=[],
                updates='constant',
                allowedUpdates=['constant', 'set every repeat',
                                'set every frame'],
                hint=_translate("x,y position on the screen"),
                label=_localized['pos'])
        self.params['size'] = Param(
                size, valType='code', allowedTypes=[],
                updates='constant',
                allowedUpdates=['constant', 'set every repeat',
                                'set every frame'],
                hint=_translate(
                        "Size on screen. e.g. (500,10) pix for horizontal,"
                        "(10,500) pix for vertical"),
                label=_localized['size'])

        # advanced params:
        self.params['flip'] = Param(
                flip, valType='bool',
                updates='constant', allowedUpdates=[],
                hint=_translate(
                        "By default the labels will be on the bottom or "
                        "left of the scale, but this can be flipped to the "
github psychopy / psychopy / psychopy / experiment / components / noise / __init__.py View on Github external
updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['noiseFractalPower'], categ="Filtered (Butterworth)")

        msg = _translate("Order of filter - higher = steeper fall off, zero = no filter")
        self.params['noiseFilterOrder'] = Param(
            noiseFilterOrder, valType='code', allowedTypes=[],
            updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['noiseFilterOrder'], categ="Filtered (Butterworth)")

        msg = _translate("Upper cutoff frequency in cycles per unit length. "
                         "Set very high to avoid an upper cutoff and make a high pass filter.")
        self.params['noiseFilterUpper'] = Param(
            noiseFilterUpper, valType='code', allowedTypes=[],
            updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['noiseFilterUpper'], categ="Filtered (Butterworth)")

        msg = _translate("Lower cutoff frequency in cycles per unit length. "
                         "Set to zero to avoid a lower cuttoff and make a low pass filter.")
        self.params['noiseFilterLower'] = Param(
            noiseFilterLower, valType='code', allowedTypes=[], 
            updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['noiseFilterLower'], categ="Filtered (Butterworth)")

        msg = _translate("Truncate high and low values beyond stated standard deviations from mean and rescale greyscale range. "
github psychopy / psychopy / psychopy / experiment / components / slider / __init__.py View on Github external
# = the usual as inherited from BaseVisual plus:
        self.params['ticks'] = Param(
                ticks, valType='list', allowedTypes=[],
                updates='constant',
                allowedUpdates=['constant', 'set every repeat'],
                hint=_translate("Tick positions (numerical) on the scale, "
                                "separated by commas"),
                label=_localized['ticks'])
        self.params['labels'] = Param(
                labels, valType='list', allowedTypes=[],
                updates='constant',
                allowedUpdates=['constant', 'set every repeat'],
                hint=_translate("Labels for the tick marks on the scale, "
                                "separated by commas"),
                label=_localized['labels'])
        self.params['granularity'] = Param(
                granularity, valType='code', allowedTypes=[],
                updates='constant',
                allowedUpdates=['constant', 'set every repeat'],
                hint=_translate("Specifies the minimum step size "
                                "(0 for a continuous scale, 1 for integer "
                                "rating scale)"),
                label=_translate('Granularity'))
        self.params['forceEndRoutine'] = Param(
                forceEndRoutine, valType='bool', allowedTypes=[],
                updates='constant', allowedUpdates=[],
                hint=_translate("Should setting a rating (releasing the mouse) "
                                "cause the end of the routine (e.g. trial)?"),
                label=_localized['forceEndRoutine'])
        self.params['pos'] = Param(
                pos, valType='code', allowedTypes=[],
                updates='constant',
github psychopy / psychopy / psychopy / experiment / components / settings / __init__.py View on Github external
self.params['Save log file'] = Param(
            saveLogFile, valType='bool', allowedTypes=[],
            hint=_translate("Save a detailed log (more detailed than the "
                            "excel/csv files) of the entire experiment"),
            label=_localized["Save log file"], categ='Data')
        self.params['Save wide csv file'] = Param(
            saveWideCSVFile, valType='bool', allowedTypes=[],
            hint=_translate("Save data from loops in comma-separated-value "
                            "(.csv) format for maximum portability"),
            label=_localized["Save wide csv file"], categ='Data')
        self.params['Save csv file'] = Param(
            saveCSVFile, valType='bool', allowedTypes=[],
            hint=_translate("Save data from loops in comma-separated-value "
                            "(.csv) format for maximum portability"),
            label=_localized["Save csv file"], categ='Data')
        self.params['Save excel file'] = Param(
            saveXLSXFile, valType='bool', allowedTypes=[],
            hint=_translate("Save data from loops in Excel (.xlsx) format"),
            label=_localized["Save excel file"], categ='Data')
        self.params['Save psydat file'] = Param(
            savePsydatFile, valType='bool', allowedVals=[True],
            hint=_translate("Save data from loops in psydat format. This is "
                            "useful for python programmers to generate "
                            "analysis scripts."),
            label=_localized["Save psydat file"], categ='Data')
        self.params['logging level'] = Param(
            logging, valType='code',
            allowedVals=['error', 'warning', 'data', 'exp', 'info', 'debug'],
            hint=_translate("How much output do you want in the log files? "
                            "('error' is fewest messages, 'debug' is most)"),
            label=_localized["logging level"], categ='Data')
github psychopy / psychopy / psychopy / experiment / components / settings / __init__.py View on Github external
"color-picker.)"),
            label=_localized["color"], categ='Screen')
        self.params['colorSpace'] = Param(
            colorSpace, valType='str',
            hint=_translate("Needed if color is defined numerically (see "
                            "PsychoPy documentation on color spaces)"),
            allowedVals=['rgb', 'dkl', 'lms', 'hsv', 'hex'],
            label=_localized["colorSpace"], categ="Screen")
        self.params['Units'] = Param(
            units, valType='str', allowedTypes=[],
            allowedVals=['use prefs', 'deg', 'pix', 'cm', 'norm', 'height',
                         'degFlatPos', 'degFlat'],
            hint=_translate("Units to use for window/stimulus coordinates "
                            "(e.g. cm, pix, deg)"),
            label=_localized["Units"], categ='Screen')
        self.params['blendMode'] = Param(
            blendMode, valType='str',
            allowedTypes=[], allowedVals=['add', 'avg'],
            hint=_translate("Should new stimuli be added or averaged with "
                            "the stimuli that have been drawn already"),
            label=_localized["blendMode"], categ='Screen')
        self.params['Show mouse'] = Param(
            showMouse, valType='bool', allowedTypes=[],
            hint=_translate("Should the mouse be visible on screen?"),
            label=_localized["Show mouse"], categ='Screen')

        # data params
        self.params['Data filename'] = Param(
            filename, valType='code', allowedTypes=[],
            hint=_translate("Code to create your custom file name base. Don"
                            "'t give a file extension - this will be added."),
            label=_localized["Data filename"], categ='Data')
github psychopy / psychopy / psychopy / experiment / components / ratingScale / __init__.py View on Github external
disappear, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("Hide the scale when a rating has been accepted;"
                            " False to remain on-screen"),
            label=_localized['disappear'])
        self.params['showAccept'] = Param(
            showAccept, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("Should the accept button by visible?"),
            label=_localized['showAccept'])
        self.params['storeRating'] = Param(
            storeRating, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("store the rating"),
            label=_localized['storeRating'])
        self.params['storeRatingTime'] = Param(
            storeRatingTime, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("store the time taken to make the choice (in "
                            "seconds)"),
            label=_localized['storeRatingTime'])
        self.params['storeHistory'] = Param(
            storeHistory, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("store the history of (selection, time)"),
            label=_localized['storeHistory'])
        self.params['forceEndRoutine'] = Param(
            forceEndRoutine, valType='bool', allowedTypes=[],
            updates='constant', allowedUpdates=[], categ="Advanced",
            hint=_translate("Should accepting a rating cause the end of the "
                            "routine (e.g. trial)?"),
            label=_localized['forceEndRoutine'])
github psychopy / psychopy / psychopy / experiment / components / noise / __init__.py View on Github external
label=_localized['interpolate'], categ="Advanced")

        msg = _translate("Type of noise (Binary, Normal, Gabor, Isotropic, White, Coloured, Filtered, Image)")
        self.params['noiseType'] = Param(
            noiseType, valType='str', allowedTypes=[], allowedVals=['Binary', 'Normal','Uniform','Gabor','Isotropic','White','Filtered','Image'],
            updates='constant',
            allowedUpdates=[],
            hint=msg,
            label=_localized['noiseType'], categ=" Noise")

        msg = _translate("Apply filter to noise sample? "
                         "[Butterworth, Gabor, Isoptopic]. A filter with parameters taken from "
                         "the either the Filtered (Butterworth) or Gabor/Isotropic tab will be applied to OTHER "
                         "noise types. [NOTE: if noise of the same type as the filter is requested the filter "
                         "is applied, once only, to a white noise sample.]")
        self.params['filter'] = Param(
            filter, valType='str', allowedTypes=[], allowedVals=['None','Butterworth','Gabor','Isotropic'],
            updates='constant',
            allowedUpdates=[],
            hint=msg,
            label=_localized['filter'], categ=" Noise")
            
        msg = _translate("Which image component should be randomised? "
                         "[Amplitude,Phase]. Randomizing amplitude will keep the phase spectrum of "
                         "the image but set the amplitude spectrum to random values [0...1]. This keeps spatial structure in tact. "
                         "Randoming the phase spectrum will keep the amplitude spectrum of the image  but set "
                         "the phase spectrum to random values [-pi...pi] in radians. This makes a noise sample with no obvious structure. ")
        self.params['imageComponent'] = Param(
            imageComponent, valType='str', allowedTypes=[], allowedVals=['Phase','Amplitude'],
            updates='constant',
            allowedUpdates=[],
            hint=msg,
github psychopy / psychopy / psychopy / experiment / components / grating / __init__.py View on Github external
valType='code', allowedVals=['32', '64', '128', '256', '512'],
            updates='constant', allowedUpdates=[],
            hint=msg,
            label=_localized['texture resolution'], categ="Advanced")

        msg = _translate("How should the image be interpolated if/when "
                         "rescaled")
        self.params['interpolate'] = Param(
            interpolate, valType='str', allowedVals=['linear', 'nearest'],
            updates='constant', allowedUpdates=[],
            hint=msg,
            label=_localized['interpolate'], categ="Advanced")

        msg = _translate("OpenGL Blendmode: avg gives traditional transparency,"
                         " add is important to combine gratings)]")
        self.params['blendmode'] = Param(
            blendmode, valType='str', allowedVals=['avg', 'add'],
            updates='constant',
            allowedUpdates=['constant', 'set every repeat', 'set every frame'],
            hint=msg,
            label=_localized['blendmode'], categ="Basic")