Exemplo n.º 1
0
def make_false_landing_and_flyby_datasets(dataset_nopost):

    #shift_list = shift_datasets(dataset_nopost, nshifts=nshifts)
    #shift = fa.add_datasets(shift_list)

    shift = dataset_nopost

    fa.calc_func(shift, classify_false_post)
    fa.calc_func(shift, calc_frame_of_landing)

    dataset_nopost_landing = make_behavior_dataset(
        shift, filename='dataset_nopost_landing_3cm', behavior='landing')

    dataset_nopost_flyby = make_behavior_dataset(
        shift, filename='dataset_nopost_flyby_3cm', behavior='flyby')

    fa.prep_dataset(dataset_nopost_landing)
    fa.calc_func(dataset_nopost_landing, saccade_analysis.calc_last_saccade)

    fa.prep_dataset(dataset_nopost_flyby)
    fa.calc_func(dataset_nopost_flyby, saccade_analysis.calc_last_saccade)

    #fa.save(dataset_nopost_landing, 'dataset_nopost_landing')
    fa.save(dataset_nopost_flyby, 'dataset_nopost_flyby_3cm')

    return dataset_nopost_landing, dataset_nopost_flyby
Exemplo n.º 2
0
def make_crash_dataset(movie_dataset, example_dataset):
    dataset_crash = ffa.Dataset(like=example_dataset)
    keys = movie_dataset.get_movie_keys(behavior='landing', crash=True)
    
    for key in keys:
        movie = movie_dataset.movies[key]
        trajec = movie.trajec
        trajec.behavior = movie.behavior
        trajec.key = key
        fa.calc_frame_of_landing(trajec)
        fa.normalize_dist_to_stim_r(trajec)    
        d = np.max(np.max(trajec.dist_to_stim_r_normed, 0.08))
        trajec.frames = np.arange(fa.get_frame_at_distance(trajec, d), trajec.frame_of_landing).tolist()    
        fa.prep_trajectory(trajec)
    
        dataset_crash.trajecs.setdefault(key, trajec)
        
    fa.prep_dataset(dataset_crash)
    
    return dataset_crash
def make_false_landing_and_flyby_datasets(dataset_nopost):
    
    #shift_list = shift_datasets(dataset_nopost, nshifts=nshifts)
    #shift = fa.add_datasets(shift_list)
    
    shift = dataset_nopost
    
    fa.calc_func(shift, classify_false_post)
    fa.calc_func(shift, calc_frame_of_landing)
    
    dataset_nopost_landing = make_behavior_dataset(shift, filename='dataset_nopost_landing_3cm', behavior='landing')
    
    dataset_nopost_flyby = make_behavior_dataset(shift, filename='dataset_nopost_flyby_3cm', behavior='flyby')
    
    fa.prep_dataset(dataset_nopost_landing)
    fa.calc_func(dataset_nopost_landing, saccade_analysis.calc_last_saccade)
    
    fa.prep_dataset(dataset_nopost_flyby)
    fa.calc_func(dataset_nopost_flyby, saccade_analysis.calc_last_saccade)
    
    #fa.save(dataset_nopost_landing, 'dataset_nopost_landing')
    fa.save(dataset_nopost_flyby, 'dataset_nopost_flyby_3cm')
    
    return dataset_nopost_landing, dataset_nopost_flyby