Skip to content

Commit

Permalink
feat(block_analysis): exclude ManualDelivery from pellet detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ttngu207 committed Sep 18, 2024
1 parent 599b74a commit a6e2787
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aeon/dj_pipeline/analysis/block_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,13 +818,22 @@ def get_threshold_associated_pellets(patch_key, start, end):
- rate
"""
chunk_restriction = acquisition.create_chunk_restriction(patch_key["experiment_name"], start, end)

# pellet delivery and beam break data
delivered_pellet_df = fetch_stream(
streams.UndergroundFeederDeliverPellet & patch_key & chunk_restriction
)[start:end]
beam_break_df = fetch_stream(streams.UndergroundFeederBeamBreak & patch_key & chunk_restriction)[
start:end
]
manual_delivery_df = fetch_stream(
streams.UndergroundFeederManualDelivery & patch_key & chunk_restriction
)[start:end]

# exclude ManualDelivery from the pellet delivery (take the not intersecting part)
delivered_pellet_df = delivered_pellet_df.loc[
delivered_pellet_df.index.difference(manual_delivery_df.index)
]

if delivered_pellet_df.empty or beam_break_df.empty:
return acquisition.io_api._empty(
Expand Down

0 comments on commit a6e2787

Please sign in to comment.