def save_distribs(lendistribname=ld_name): errorfield = 'TrialError' tnumfield = 'trial_type' eyefield = 'eyepos' os.chdir('data') d = u.load_separate(['.'], 'bootsy-bhvit-run[0-9]*.mat') ed = d[d[errorfield] == 0] os.chdir('..') fn, ff, nn, nf = 7, 8, 9, 10 lens, looks, s_bs, s_es = es.get_fixtimes(ed, [fn, ff, nn, nf], postthr='fixation_off') observed_lendistrib = np.concatenate(lens[nf] + lens[fn], axis=0) cp.dump(observed_lendistrib, open(lendistribname, 'wb')) return observed_lendistrib
def produce_eyes_plot_nums(resorted=True, save=False, fname=None): if resorted: pattern = 'bootsy-bhvit-rs-run[0-9]*.mat' else: pattern = 'bootsy-bhvit-run[0-9]*.mat' data = load_separate(['./data/'], pattern) data = data[data[error_field] == 0] datavplt = get_only_vplt(data) lc, xs = get_bias_tc(datavplt, winsize=1, winstep=1) lens, looks, s_bs, s_es = es.get_fixtimes(datavplt, [7, 8, 9, 10]) for i, tt in enumerate(lens.keys()): cond_lens = np.concatenate(lens[tt], axis=1) if i == 0: all_lens = cond_lens else: all_lens = np.concatenate((all_lens, cond_lens), axis=0) plot_looks(lc, xs) if save and fname is not None: np.savez(open(fname, 'wb'), xs=xs, look_course=lc, fix_lens=all_lens) return lc, xs, all_lens