Skip to content

Commit 32bff24

Browse files
author
Thinh Nguyen
committed
median subtraction on a copied data file
1 parent 71d87ae commit 32bff24

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

element_array_ephys/readers/kilosort_triggering.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import subprocess
2+
import shutil
23
import sys
34
import pathlib
45
import json
@@ -371,7 +372,15 @@ def generate_modules_input_json(self):
371372

372373
self._module_input_json = self._json_directory / f'{self._npx_input_dir.name}-input.json'
373374

374-
continuous_file = self._npx_input_dir / 'continuous.dat'
375+
if 'median_subtraction' in self._modules:
376+
# median subtraction step will overwrite original continuous.dat file with the corrected version
377+
# to preserve the original raw data - make a copy here and work on the copied version
378+
assert 'depth_estimation' in self._modules
379+
raw_ap_fp = self._npx_input_dir / 'continuous.dat'
380+
continuous_file = self._npx_input_dir / 'preproc_continuous.dat'
381+
shutil.copy2(raw_ap_fp, continuous_file)
382+
else:
383+
continuous_file = self._npx_input_dir / 'continuous.dat'
375384

376385
params = {}
377386
for k, v in self._params.items():

0 commit comments

Comments
 (0)