![]() If you still get to much overlap with this code, you can increase rtol to make the definition of “close” more liberal or specify an absolute tolerance (may be easier to control) by including the argument atol instead of rtol. Overlap = np.any(np.logical_and(x_close, y_close)) Y_close = np.isclose(y_pos, y_locations, rtol = 0.01) X_close = np.isclose(x_pos, x_locations, rtol = 0.01) Maybe, this is more suitable for you: for i in range(1,n_items): I suspect this is why the experiment crashes at some point. Third, once x_comp or y_comp are True (you write TRUE so this may also be a problem) you go into an infinite while loop, because inside the loop those values can’t change and the loop will therefore never break. Second, you only compare x and y coordinates separately. So there is nothing in the code preventing, for example, item i and item i-2 from overlapping. Firstly, you only compare item i and item i-1 in terms of being close. Hi not a Python pro, but looking at your code I don’t think it does what you want it to do. ![]() T_textR = visual.TextStim(win=win, name=‘T_textR’, Would it be more optimal to switch to pixels, and if so, what would my random function become?Īlso would it be more efficient to use an element arraystim to create a screen of various targets and a singular distractor? I know why it’s happening, because I use Norm units (I find norm units the easiest to understand) So the random function is picking a number between 0-1 and then subtracting 0.5 in order to balance the display, I have tried messing around with other values but then my stimuli are no longer centered. This is my code (see below) I used to create my stimuli. As you can see from the image the items are located relatively closely together and they can overlap at times.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |