prey_cap_metrics#
- prey_capture_python.analysis.prey_cap_metrics.preycap_metrics(cricket_xy, cricket_p, range, mouse_spd, az, fr=200, oldmodel=False)#
function to calculate basic metrics of prey capture behavior decent first pass look at if there are differences between conditions
- Parameters
cricket_xy (
numpy.ndarray
) – thresholded cricket xy coordinatescricket_p (
numpy.ndarray
) – cricket likelihoodsrange (
numpy.ndarray
) – distance between mouse and cricketmouse_spd (
numpy.ndarray
) – mouse speed (not velocity)az (
numpy.ndarray
) – angle between mouse’s head and cricketfr (int) – framerate of videos, default=200
oldmodel (boolean) – flag to mark cricket likelihood is bad, default=False
- Returns
time to capture the cricket –indication of start and end need to be changed latency (int): time to the first approach freqapproach (int): frequency of initiating approaches p_intercept (int): probability of intercepting given an approach p_capture (int): probability of capturing given intercepting
- Return type
captureT (int)
- prey_capture_python.analysis.prey_cap_metrics.relentless_positivity(df: pandas.core.frame.DataFrame, column: str, window: int = 20, threshold: float = 0.95, tolist: bool = True) Union[List[List[int]], numpy.ndarray] #
Find ranges where column is above threshold for #window number of rows
- Returns
List of Lists indicating the start and end of positive ranges