/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
real filtered
Jeremy Magland <jmagland@flatironinstitute.org> committed commit 045c4651992f parent ff77f2c Browse files
2 changed files+26−13
zia_benchmark/setup.pymodified+1−0View file
@@ -7,6 +7,7 @@ setup(
77 package_dir={"": "src"},
88 install_requires=[
99 "numpy",
10+ "scipy",
1011 "zstandard",
1112 "simple_ans",
1213 "requests",
zia_benchmark/src/zia_benchmark/datasets/real/__init__.pymodified+25−13View file
@@ -22,7 +22,7 @@ def _load_real_000876(
2222 h5f = lindi.LindiH5pyFile.from_hdf5_file(nwb_url)
2323 ds = h5f["/acquisition/ElectricalSeriesAP/data"]
2424 assert isinstance(ds, lindi.LindiH5pyDataset)
25- ret = ds[:num_samples, start_channel:start_channel + num_channels]
25+ ret = ds[:num_samples, start_channel : start_channel + num_channels]
2626 return cast(np.ndarray, ret)
2727
2828
@@ -43,7 +43,7 @@ def _load_real_000409(
4343 h5f = lindi.LindiH5pyFile.from_hdf5_file(nwb_url)
4444 ds = h5f["/acquisition/ElectricalSeriesAp/data"]
4545 assert isinstance(ds, lindi.LindiH5pyDataset)
46- ret = ds[:num_samples, start_channel:start_channel + num_channels]
46+ ret = ds[:num_samples, start_channel : start_channel + num_channels]
4747 return cast(np.ndarray, ret)
4848
4949
@@ -64,7 +64,7 @@ def _load_real_001290(
6464 h5f = lindi.LindiH5pyFile.from_hdf5_file(nwb_url)
6565 ds = h5f["/acquisition/ElectricalSeriesAPImec/data"]
6666 assert isinstance(ds, lindi.LindiH5pyDataset)
67- ret = ds[:num_samples, start_channel:start_channel + num_channels]
67+ ret = ds[:num_samples, start_channel : start_channel + num_channels]
6868 return cast(np.ndarray, ret)
6969
7070
@@ -83,7 +83,12 @@ def _create_filtered_version(X: np.ndarray) -> np.ndarray:
8383 sampling_frequency = 30000
8484
8585 # Bandpass filter
86- X_filt = bandpass_filter(X - np.median(X), sampling_frequency=sampling_frequency, lowcut=lowcut, highcut=highcut)
86+ X_filt = bandpass_filter(
87+ X - np.median(X),
88+ sampling_frequency=sampling_frequency,
89+ lowcut=lowcut,
90+ highcut=highcut,
91+ )
8792
8893 # Normalize by noise level
8994 noise_level = estimate_noise_level(X_filt, sampling_frequency=sampling_frequency)
@@ -95,6 +100,7 @@ def _create_filtered_version(X: np.ndarray) -> np.ndarray:
95100
96101 return X2
97102
103+
98104 datasets = [
99105 {
100106 "name": "real-000876-ch45",
@@ -127,27 +133,33 @@ datasets = [
127133 "name": "real-000876-ch45-filtered",
128134 "version": "1",
129135 "description": "Filtered version of real-000876-ch45 with bandpass filtering (300-6000 Hz) and quantization",
130- "create": lambda: _create_filtered_version(_load_real_000876(
131- num_samples=500_000, num_channels=1, start_channel=45
132- ).flatten()),
136+ "create": lambda: _create_filtered_version(
137+ _load_real_000876(
138+ num_samples=500_000, num_channels=1, start_channel=45
139+ ).flatten()
140+ ),
133141 "tags": ["continuous", "neurophysiology", "filtered"],
134142 },
135143 {
136144 "name": "real-000409-ch101-filtered",
137145 "version": "1",
138146 "description": "Filtered version of real-000409-ch101 with bandpass filtering (300-6000 Hz) and quantization",
139- "create": lambda: _create_filtered_version(_load_real_000409(
140- num_samples=500_000, num_channels=1, start_channel=101
141- ).flatten()),
147+ "create": lambda: _create_filtered_version(
148+ _load_real_000409(
149+ num_samples=500_000, num_channels=1, start_channel=101
150+ ).flatten()
151+ ),
142152 "tags": ["continuous", "neurophysiology", "filtered"],
143153 },
144154 {
145155 "name": "real-001290-ch0-filtered",
146156 "version": "1",
147157 "description": "Filtered version of real-001290-ch0 with bandpass filtering (300-6000 Hz) and quantization",
148- "create": lambda: _create_filtered_version(_load_real_001290(
149- num_samples=500_000, num_channels=1, start_channel=0
150- ).flatten()),
158+ "create": lambda: _create_filtered_version(
159+ _load_real_001290(
160+ num_samples=500_000, num_channels=1, start_channel=0
161+ ).flatten()
162+ ),
151163 "tags": ["continuous", "neurophysiology", "filtered"],
152164 },
153165 ]
moveopenescclose