@@ -375,6 +375,18 @@ def generate_modules_input_json(self):
375
375
376
376
continuous_file = self ._get_raw_data_filepaths ()
377
377
378
+ lf_dir = self ._npx_input_dir .as_posix ()
379
+ try :
380
+ # old probe folder convention with 100.0, 100.1, 100.2, 100.3, etc.
381
+ name , num = re .search (r"(.+\.)(\d)+$" , lf_dir ).groups ()
382
+ except AttributeError :
383
+ # new probe folder convention with -AP or -LFP
384
+ assert lf_dir .endswith ("AP" )
385
+ lf_dir = re .sub ("-AP$" , "-LFP" , lf_dir )
386
+ else :
387
+ lf_dir = f"{ name } { int (num ) + 1 } "
388
+ lf_file = pathlib .Path (lf_dir ) / 'continuous.dat'
389
+
378
390
params = {}
379
391
for k , v in self ._params .items ():
380
392
value = str (v ) if isinstance (v , list ) else v
@@ -389,6 +401,7 @@ def generate_modules_input_json(self):
389
401
npx_directory = self ._npx_input_dir .as_posix (),
390
402
spikeGLX_data = False ,
391
403
continuous_file = continuous_file .as_posix (),
404
+ lf_file = lf_file .as_posix (),
392
405
extracted_data_directory = self ._ks_output_dir .as_posix (),
393
406
kilosort_output_directory = self ._ks_output_dir .as_posix (),
394
407
kilosort_output_tmp = self ._ks_output_dir .as_posix (),
@@ -444,13 +457,14 @@ def run_modules(self):
444
457
self ._update_total_duration ()
445
458
446
459
def _get_raw_data_filepaths (self ):
460
+ raw_ap_fp = self ._npx_input_dir / 'continuous.dat'
461
+
447
462
if 'median_subtraction' not in self ._modules :
448
- return self . _npx_input_dir / 'continuous.dat'
463
+ return raw_ap_fp
449
464
450
465
# median subtraction step will overwrite original continuous.dat file with the corrected version
451
466
# to preserve the original raw data - make a copy here and work on the copied version
452
467
assert 'depth_estimation' in self ._modules
453
- raw_ap_fp = self ._npx_input_dir / 'continuous.dat'
454
468
continuous_file = self ._ks_output_dir / 'continuous.dat'
455
469
if continuous_file .exists ():
456
470
if raw_ap_fp .stat ().st_mtime < continuous_file .stat ().st_mtime :
0 commit comments