Skip to content

Commit 31e2320

Browse files
author
Thinh Nguyen
committed
Waveform table now a master table, with Waveform.Unit as part-table (no need for modified key_source)
1 parent 033240f commit 31e2320

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

element_array_ephys/ephys.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -543,24 +543,26 @@ def make(self, key):
543543
@schema
544544
class Waveform(dj.Imported):
545545
definition = """
546-
-> CuratedClustering.Unit
547-
---
548-
peak_chn_waveform_mean: longblob # mean over all spikes at the peak channel for this unit
546+
-> CuratedClustering
549547
"""
550548

551-
class Electrode(dj.Part):
549+
class Unit(dj.Part):
552550
definition = """
553551
-> master
552+
-> CuratedClustering.Unit
553+
---
554+
peak_chn_waveform_mean: longblob # mean over all spikes at the peak channel for this unit
555+
"""
556+
557+
class UnitElectrode(dj.Part):
558+
definition = """
559+
-> master.UnitWaveform
554560
-> probe.ElectrodeConfig.Electrode
555561
---
556562
waveform_mean: longblob # (uV) mean over all spikes
557563
waveforms=null: longblob # (uV) (spike x sample) waveform of each spike at each electrode
558564
"""
559565

560-
@property
561-
def key_source(self):
562-
return Curation()
563-
564566
def make(self, key):
565567
root_dir = pathlib.Path(get_clustering_root_data_dir())
566568
ks_dir = root_dir / (Curation & key).fetch1('curation_output_dir')
@@ -631,9 +633,10 @@ def yield_unit_waveforms():
631633
yield unit_peak_waveform, unit_electrode_waveforms
632634

633635
# insert waveform on a per-unit basis to mitigate potential memory issue
636+
self.insert1(key)
634637
for unit_peak_waveform, unit_electrode_waveforms in yield_unit_waveforms():
635-
self.insert1(unit_peak_waveform, ignore_extra_fields=True)
636-
self.Electrode.insert(unit_electrode_waveforms, ignore_extra_fields=True)
638+
self.Unit.insert1(unit_peak_waveform, ignore_extra_fields=True)
639+
self.UnitElectrode.insert(unit_electrode_waveforms, ignore_extra_fields=True)
637640

638641

639642
# ----------- Quality Control ----------

0 commit comments

Comments
 (0)