From 7759012019bc3bc887962e47492da65dd9d7dfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Lespinasse?= Date: Wed, 8 Apr 2020 16:22:59 -0400 Subject: [PATCH] fixed typos and updated 2nd part of plan --- phys2bids/phys2bids.py | 2 +- phys2bids/split2phys.py | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/phys2bids/phys2bids.py b/phys2bids/phys2bids.py index a127bc424..c5c8ee610 100644 --- a/phys2bids/phys2bids.py +++ b/phys2bids/phys2bids.py @@ -44,7 +44,7 @@ def print_summary(filename, ntp_expected, ntp_found, samp_freq, time_offset, outfile): """ - Prints a summary onscreen and in file with informations on the files. + Print a summary onscreen and in file with informations on the files. Parameters ---------- diff --git a/phys2bids/split2phys.py b/phys2bids/split2phys.py index d9398fee3..4f69dea09 100644 --- a/phys2bids/split2phys.py +++ b/phys2bids/split2phys.py @@ -97,23 +97,28 @@ def split2phys(filename, indir='.', outdir='.', ntp_list=[0], tr_list=[1], thr=N # for run_idx, run_tps in list_ntp: + # ascertain run length BlueprintInput.check_trigger_amount(ntp=run_tps, tr=list_tr[run_idx]) - start_index = 0 - # why are we playing with the object in time - wouldn't it be better to play in samples? - end_index = {index of spike 0} + {run_tps*list_tr[run_idx]} - run_Blueprint[run_idx] = BlueprintInput.timeseries[:end_index+padding, :] - padding = + # define idx of first trigger and padding length + start_index = BlueprintInput.timeseries[0] + padding = arb_val + + # I'M A BIT CONFUSED here. not sure if i get this right + end_index = start_index + (run_tps * list_tr[run_idx]) + run_Blueprint[run_idx] = BlueprintInput.timeseries[start_index - padding: + end_index + padding, :] # if last value in the list "number of timepoints in run" if run_idx == list_ntp.size[0]: - end_index + padding <= number of indexes + end_index + padding # <= number of indexes hmmm... don't remember our plan - # not sure how to define padding + # not sure how and where to define padding else: padding = number of indexes - end_index BlueprintInput = BlueprintInput.timeseries[end_index + padding; , :] # make dict exportable + # delete at index def _main(argv=None):