Skip to content

Commit

Permalink
WIP - this partially works, but fails for datasets larger thatn 2G
Browse files Browse the repository at this point in the history
This is an issue with a subcall to CTF tools.  Working on a workaround.
  • Loading branch information
jstout211 committed Feb 12, 2024
1 parent 52daf5c commit 913950e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nih2mne/make_meg_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def get_subj_logger(subjid, log_dir=None, loglevel=logging.INFO):
parser.add_argument('-autocrop_zeros',
help='''If files are terminated early, leaving zeros
at the end of the file - this will detect and remove
the trailing zeros''',
the trailing zeros. !!!Files larger than 2G will Fail!!!''',
action='store_true'
)
group3 = parser.add_argument_group('Optional Overrides')
Expand Down
8 changes: 4 additions & 4 deletions nih2mne/utilities/data_crop_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ def return_cropped_ds(fname):
raw = mne.io.read_raw_ctf(fname, system_clock='ignore', preload=True)

crop_time = get_term_time(raw)
if endtime == False:
if crop_time == False:
raise RuntimeError('Could not find a terminated timepoint')
base = op.dirname(fname)
base = op.abspath(op.dirname(fname))
f_ = op.basename(fname)
outdir = op.join(base, 'tmp_cropped')
outdir = op.join(base, 'bids_prep_temp','tmp_cropped')
if not op.exists(outdir): os.mkdir(outdir)
fname_out = op.join(outdir, fname)
fname_out = op.join(outdir, f_)
cmd = f'newDs -f -time 0 {str(crop_time)} {fname} {fname_out}'
subprocess.run(cmd)
return fname_out
Expand Down

0 comments on commit 913950e

Please sign in to comment.