Skip to content

Add attributes and rename module #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions element_array_ephys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import element_array_ephys.ephys_acute as ephys
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ class EphysRecording(dj.Imported):
---
-> probe.ElectrodeConfig
-> AcquisitionSoftware
sampling_rate: float # (Hz)
sampling_rate: float # (Hz)
recording_datetime: datetime # datetime of the recording from this probe
recording_duration: float # (seconds) duration of the recording from this probe
"""

class EphysFile(dj.Part):
Expand Down Expand Up @@ -189,7 +191,10 @@ def make(self, key):
self.insert1({**key,
**generate_electrode_config(probe_type, electrode_group_members),
'acq_software': acq_software,
'sampling_rate': spikeglx_meta.meta['imSampRate']})
'sampling_rate': spikeglx_meta.meta['imSampRate'],
'recording_datetime': spikeglx_meta.recording_time,
'recording_duration': (spikeglx_meta.recording_duration
or spikeglx.retrieve_recording_duration(meta_filepath))})

root_dir = find_root_directory(get_ephys_root_data_dir(),
meta_filepath)
Expand Down Expand Up @@ -223,7 +228,9 @@ def make(self, key):
self.insert1({**key,
**generate_electrode_config(probe_type, electrode_group_members),
'acq_software': acq_software,
'sampling_rate': probe_data.ap_meta['sample_rate']})
'sampling_rate': probe_data.ap_meta['sample_rate'],
'recording_datetime': probe_data.recording_info['recording_datetimes'][0],
'recording_duration': np.sum(probe_data.recording_info['recording_durations'])})

root_dir = find_root_directory(get_ephys_root_data_dir(),
probe_data.recording_info['recording_files'][0])
Expand Down
16 changes: 12 additions & 4 deletions element_array_ephys/ephys_chronic.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ class EphysRecording(dj.Imported):
---
-> probe.ElectrodeConfig
-> AcquisitionSoftware
sampling_rate: float # (Hz)
sampling_rate: float # (Hz)
recording_datetime: datetime # datetime of the recording from this probe
recording_duration: float # (seconds) duration of the recording from this probe
"""

class EphysFile(dj.Part):
Expand Down Expand Up @@ -168,7 +170,8 @@ def make(self, key):
break
else:
raise FileNotFoundError(
'No SpikeGLX data found for probe insertion: {}'.format(key))
f'No SpikeGLX data found for probe insertion: {key}' +
' The probe serial number does not match.')

if re.search('(1.0|2.0)', spikeglx_meta.probe_model):
probe_type = spikeglx_meta.probe_model
Expand All @@ -190,7 +193,10 @@ def make(self, key):
self.insert1({**key,
**generate_electrode_config(probe_type, electrode_group_members),
'acq_software': acq_software,
'sampling_rate': spikeglx_meta.meta['imSampRate']})
'sampling_rate': spikeglx_meta.meta['imSampRate'],
'recording_datetime': spikeglx_meta.recording_time,
'recording_duration': (spikeglx_meta.recording_duration
or spikeglx.retrieve_recording_duration(meta_filepath))})

root_dir = find_root_directory(get_ephys_root_data_dir(),
meta_filepath)
Expand Down Expand Up @@ -224,7 +230,9 @@ def make(self, key):
self.insert1({**key,
**generate_electrode_config(probe_type, electrode_group_members),
'acq_software': acq_software,
'sampling_rate': probe_data.ap_meta['sample_rate']})
'sampling_rate': probe_data.ap_meta['sample_rate'],
'recording_datetime': probe_data.recording_info['recording_datetimes'][0],
'recording_duration': np.sum(probe_data.recording_info['recording_durations'])})

root_dir = find_root_directory(get_ephys_root_data_dir(),
probe_data.recording_info['recording_files'][0])
Expand Down
2 changes: 1 addition & 1 deletion element_array_ephys/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ElectrodeConfig(dj.Lookup):
electrode_config_hash: uuid
---
-> ProbeType
electrode_config_name: varchar(64) # user friendly name
electrode_config_name: varchar(4000) # user friendly name
"""

class Electrode(dj.Part):
Expand Down