for c, t in zip(this_cond_mat, ttls): assert np.array_equal(decimals_to_binary(c, n_digits), t) # this maps the sequence of 4 (single-digit) ints into a single int. # the sequence of experiment variables corresponding to each order of # magnitude is taken from params['cond_readme']; in this case it is # 1000s: attn, 100s: spatial, 10s: idents, 1s: gap event[:, 1] = [ttl_to_id(c) for c in this_cond_mat] for e in event[:, 1]: assert e in rev_dict events.append(event) print('\n Epoching...') epochs = Epochs(raws, events, event_dict, t_min, t_max) if downsample: print(' Downsampling...') epochs.resample(fs_out, n_jobs=n_jobs) # compute gaze angles (in degrees) angles = get_gaze_angle(epochs, screenprops) # zscore pupil sizes zscore = epochs.pupil_zscores() # init some containers kernel_fits = list() kernel_zscores = list() print(' Deconvolving...') deconv_kwargs = dict(kernel=kernel, n_jobs=n_jobs, acc=1e-3) if deconv_time_pts is not None: deconv_kwargs.update(dict(spacing=deconv_time_pts)) fit, time_pts = epochs.deconvolve(**deconv_kwargs) if deconv_time_pts is None: deconv_time_pts = time_pts