Skip to content

Commit

Permalink
Change order of operations for downsampling
Browse files Browse the repository at this point in the history
  • Loading branch information
kabilar committed Aug 24, 2023
1 parent 83b9d0f commit fcd56db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion element_array_ephys/ephys_organoids.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def make(self, key):
] # channels with raw ephys traces

# Concatenate the signal
lfp = data["amplifier_data"][:, ::downsample_factor] # downsample
lfp = data["amplifier_data"][:, :]
lfp_concat = lfp if lfp_concat.size == 0 else np.hstack((lfp_concat, lfp))
del data, lfp

Expand Down Expand Up @@ -296,6 +296,9 @@ def make(self, key):
)
lfp = signal.filtfilt(b_butter, a_butter, lfp)

# Downsample the signal
lfp = lfp[:, ::downsample_factor]

econf_hash, probe_type, electrode = (
electrode_query & f"channel='{ch}'"
).fetch1("electrode_config_hash", "probe_type", "electrode")
Expand Down

0 comments on commit fcd56db

Please sign in to comment.