add_port_where_animal_comes_from#
- add_port_where_animal_comes_from(df_in: DataFrame, events: EventColumns | None = None) DataFrame[source]#
The previous side port can come from two sources. One, from the previous trial, where the animal was drinking water (note, this should not necessarily be true as the animal can go to the other port afterwards without going through the middle, but if a trial has started before that happens, this function will take care of it) Second, from side port pokes previous to the initiation of the stimulus. This second condition can happen from two sources. Initial pokes before poking on the center, or poking in the center just brief enough to not trigger the stimulus state. In some cases this is not punished.
Adds last_choice_before_stimulus, previous_port_before_stimulus and roa_choice (“repeat” / “alternate”: first choice compared with that port).