From ed5aa562385639aa6437aca3db426918fadb3f4f Mon Sep 17 00:00:00 2001 From: mschart Date: Fri, 1 Oct 2021 12:24:55 +0100 Subject: [PATCH] keep lick times separate per cam --- prototyping/post_dlc/licking.py | 51 ++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/prototyping/post_dlc/licking.py b/prototyping/post_dlc/licking.py index 1a18a17..c9886fd 100644 --- a/prototyping/post_dlc/licking.py +++ b/prototyping/post_dlc/licking.py @@ -42,26 +42,45 @@ def get_licks(XYs): return sorted(list(set.union(*licks))) +def get_lick_times(eid, combine=False, video_type='left'): + + if combine: + # combine licking events from left and right cam + lick_times = [] + for video_type in ['right','left']: + times, XYs = get_dlc_XYs(eid, video_type) + r = get_licks(XYs) + # cover case that there are less times than DLC points + idx = np.where(np.array(r)