Skip to content

Commit

Permalink
LFPBand and LFP bug fixes (LorenFrankLab#504)
Browse files Browse the repository at this point in the history
* LFP fetch1 query bug fix 

Address issue LorenFrankLab#485

* use filter_name instead of hard coding LFP() filter
  • Loading branch information
acomrie authored May 18, 2023
1 parent 2a78caf commit 011dcaa
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/spyglass/lfp/v1/lfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def make(self, key):
# get the LFP filter that matches the raw data
filter = (
FirFilter()
& {"filter_name": "LFP 0-400 Hz"}
& {"filter_name": key["filter_name"]}
& {"filter_sampling_rate": sampling_rate}
).fetch(as_dict=True)

Expand Down Expand Up @@ -769,8 +769,10 @@ def make(self, key):
lfp_band_elect_id = lfp_band_elect_id[lfp_sort_order]
lfp_band_ref_id = lfp_band_ref_id[lfp_sort_order]

lfp_sampling_rate = (LFP() & {"nwb_file_name": key["nwb_file_name"]}).fetch1(
"lfp_sampling_rate"
lfp_sampling_rate = (
LFPOutput()
.get_lfp_object({"lfp_id": key["lfp_id"]})
.fetch1("lfp_sampling_rate")
)
interval_list_name, lfp_band_sampling_rate = (LFPBandSelection() & key).fetch1(
"target_interval_list_name", "lfp_band_sampling_rate"
Expand All @@ -784,8 +786,10 @@ def make(self, key):
).fetch1("valid_times")
# the valid_times for this interval may be slightly beyond the valid times for the lfp itself,
# so we have to intersect the two
lfp_interval_list = (LFP() & {"nwb_file_name": key["nwb_file_name"]}).fetch1(
"interval_list_name"
lfp_interval_list = (
LFPOutput()
.get_lfp_object({"lfp_id": key["lfp_id"]})
.fetch1("interval_list_name")
)
lfp_valid_times = (
IntervalList()
Expand Down

0 comments on commit 011dcaa

Please sign in to comment.