-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added working 'get_foraging_bouts' function #410
base: datajoint_pipeline
Are you sure you want to change the base?
Conversation
Allow forwarding of load function kwargs to reader
Additional pre-commit and ruff fixes
* Persist venv across job steps * Update codecov-action version * Remove `env_config`
Clear all CI checks on all platforms
) | ||
foraging_mask = max_windowed_wheel_vals > (patch_spun_df["cum_wheel_dist"] + min_wheel_movement) | ||
# Discretize into foraging bouts | ||
bout_start_indxs = np.where(np.diff(foraging_mask.astype(int), prepend=0) == 1)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be shifted up by win_len
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bout_start_indxs = np.where(np.diff(foraging_mask.astype(int), prepend=0) == 1)[0] + win_len
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe win_len - 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the foraging bout should be started when the wheel actually starts moving.
Let me look at this particular case in more detail later.
The bouts that the previous rolling max approach detects will differ from just shifting the cum_wheel_dist, and I think this may be one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iirc, using rolling max and direct shift produce the same results in terms of the number of pellets. But feel free to verify this.
foraging_mask = max_windowed_wheel_vals > (patch_spun_df["cum_wheel_dist"] + min_wheel_movement) | ||
# Discretize into foraging bouts | ||
bout_start_indxs = np.where(np.diff(foraging_mask.astype(int), prepend=0) == 1)[0] | ||
bout_end_indxs = np.where(np.diff(foraging_mask.astype(int), prepend=0) == -1)[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to account for final pellet delivery in bout: time for bonsai to deliver pellet / beambreak to occur after threshold crossing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bout_start_indxs
shift is done in a96231c and left a TODO note for changing the constant for bout_end_indxs
…eshold update for the block
7f5b51a
to
baa5336
Compare
No description provided.