Skip to content
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
9 changes: 7 additions & 2 deletions blech_clust.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,13 @@ def generate_processing_scripts(dir_name, blech_clust_dir, electrode_layout_fram
print("\tOne file per SIGNAL Detected")

# Use info file for port list calculation
info_file = np.fromfile(dir_name + '/info.rhd', dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
info_file_path = os.path.join(dir_name, 'info.rhd')
if os.path.exists(info_file_path):
info_file = np.fromfile(info_file_path, dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
else:
print("info.rhd file not found. Please enter the sampling rate manually:")
sampling_rate = int(input("Sampling rate (Hz): "))

# Read the time.dat file for use in separating out
# the one file per signal type data
Expand Down
10 changes: 7 additions & 3 deletions utils/blech_channel_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ def plot_channels(dir_path, qa_out_path, file_type):
amp_files = glob.glob(os.path.join(dir_path, "amp*dat"))
digin_files = glob.glob(os.path.join(dir_path, "dig*dat"))
# Use info file for port list calculation
info_file = np.fromfile(os.path.join(
dir_path, 'info.rhd'), dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
info_file_path = os.path.join(dir_path, 'info.rhd')
if os.path.exists(info_file_path):
info_file = np.fromfile(info_file_path, dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
else:
print("info.rhd file not found. Please enter the sampling rate manually:")
sampling_rate = int(input("Sampling rate (Hz): "))
# Read the time.dat file for use in separating out the one file per signal type data
num_recorded_samples = len(np.fromfile(
os.path.join(dir_path, 'time.dat'), dtype=np.dtype('float32')))
Expand Down
9 changes: 7 additions & 2 deletions utils/blech_reload_amp_digs.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@
dig_in_list = sorted(dig_in_list)

# Use info file for port list calculation
info_file = np.fromfile(dir_name + '/info.rhd', dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
info_file_path = os.path.join(dir_name, 'info.rhd')
if os.path.exists(info_file_path):
info_file = np.fromfile(info_file_path, dtype=np.dtype('float32'))
sampling_rate = int(info_file[2])
else:
print("info.rhd file not found. Please enter the sampling rate manually:")
sampling_rate = int(input("Sampling rate (Hz): "))

# Read the time.dat file for use in separating out
# the one file per signal type data
Expand Down
Loading