Skip to content

Commit a02fdb0

Browse files
feat: add SNR column and round SNR to one decimal place in descriptors
Co-authored-by: aider (gpt-4o) <aider@aider.chat>
1 parent e2cf909 commit a02fdb0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

utils/blech_nex_convert.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ class unit_descriptor(tables.IsDescription):
9898
single_unit = tables.Int32Col()
9999
regular_spiking = tables.Int32Col()
100100
fast_spiking = tables.Int32Col()
101+
snr = tables.Float32Col() # Add SNR column
101102

102103

103104
# Go through the dig_in_channel_nums and make an array of spike trains of dimensions (# trials x # units x trial duration (ms)) - use end of digital input pulse as the time of taste delivery

utils/ephys_data/ephys_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,9 @@ def get_unit_descriptors(self):
523523
"""
524524
with tables.open_file(self.hdf5_path, 'r+') as hf5_file:
525525
self.unit_descriptors = hf5_file.root.unit_descriptor[:]
526+
# Round SNR to 1 decimal place
527+
for descriptor in self.unit_descriptors:
528+
descriptor['snr'] = round(descriptor['snr'], 1)
526529

527530
def check_laser(self):
528531
"""

0 commit comments

Comments
 (0)