<commit_before>from psychopy import visual, core, misc, event, filters
import numpy as np
from scipy.signal import convolve2d
from IPython import embed as shell
from math import *
import random, sys

sys.path.append( 'exp_tools' )
# sys.path.append( os.environ['EXPERIMENT_HOME'] )


class SubjectiveIsoLuminanceStim(object):
	def __init__(self, screen, trial, session, size = 1, RG_offset = 0, BY_offset = 0):
		# parameters
		self.trial = trial
		self.session = session
		self.screen = screen

		# bookkeeping variables
		self.frames = 0
			
		# psychopy stimuli
		# self.populate_stimulus()

		self.BY_offset = BY_offset
		self.RG_offset = RG_offset

		# make this stimulus array a session variable, in order to have to create it only once...
		self.gabor = visual.GratingStim(screen,tex='sin', mask='gauss')
		self.gabor.size = size
		self.gabor.sf = 0.01


	def populate_stimulus(self,which_stim):

		if which_stim == 'RG':

			self.RG_offset = 0.0
			color_value = np.max([0.1,1-self.RG_offset-self.trial.RG_diff])
			self.color = np.array([color_value,-color_value,0])


			self.orientation = 90

		elif which_stim == 'BY':

			self.BY_offset = 0.0
			color_value = np.max([0.1,1-self.BY_offset-self.trial.BY_diff])
			self.color = np.array([color_value,color_value,-color_value])
	
			self.orientation = 0

<commit_msg>small changes to sil for centering colors<commit_after>from psychopy import visual, core, misc, event, filters
import numpy as np
from scipy.signal import convolve2d
from IPython import embed as shell
from math import *
import random, sys

sys.path.append( 'exp_tools' )
# sys.path.append( os.environ['EXPERIMENT_HOME'] )


class SubjectiveIsoLuminanceStim(object):
	def __init__(self, screen, trial, session, size = 1, RG_offset = 0, BY_offset = 0):
		# parameters
		self.trial = trial
		self.session = session
		self.screen = screen

		# bookkeeping variables
		self.frames = 0
			
		# psychopy stimuli
		# self.populate_stimulus()

		self.BY_offset = BY_offset
		self.RG_offset = RG_offset

		# make this stimulus array a session variable, in order to have to create it only once...
		self.gabor = visual.GratingStim(screen,tex='sin', mask='gauss', texRes = 2048)
		self.gabor.size = size
		self.gabor.sf = 0.01


	def populate_stimulus(self,which_stim):

		if which_stim == 'RG':

			self.RG_offset = 0.5
			color_value = np.max([np.max([0.1,self.RG_offset-self.trial.RG_diff]), 1])
			self.color = np.array([color_value,-color_value,0])


			self.orientation = 90

		elif which_stim == 'BY':

			self.BY_offset = 0.5
			color_value = np.max([np.max([0.1,self.BY_offset-self.trial.BY_diff]), 1])
			self.color = np.array([color_value,color_value,-color_value])
	
			self.orientation = 0


{'fraction_non_alphanumeric': 0.11842589187201177, 'fraction_numerical': 0.017653549098933432, 'mean_word_length': 3.9454545454545453, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1335746', 'n_tokens_mistral': 1093, 'n_tokens_neox': 938, 'n_words': 230}