From bf5db9f3e69d9bb885185564ec1423531431c070 Mon Sep 17 00:00:00 2001 From: Lina Teichmann <80063563+LinaTeichmann1@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:33:56 -0500 Subject: [PATCH] fixing madspeedfilder max_dilation speed was initialized as np.empty but should be an array of np.nans --- nih2mne/eyetracking_preprocessing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nih2mne/eyetracking_preprocessing.py b/nih2mne/eyetracking_preprocessing.py index ae067d3..f40b096 100755 --- a/nih2mne/eyetracking_preprocessing.py +++ b/nih2mne/eyetracking_preprocessing.py @@ -137,7 +137,7 @@ def madspeedfilter(tv,dia,is_valid): fwd_dilation = np.pad(cur_dia_speed,(0,1),constant_values=np.nan) back_fwd_dilation = np.vstack([back_dilation,fwd_dilation]) - max_dilation_speed = np.empty_like(dia) + max_dilation_speed = np.full_like(dia,np.nan) max_dilation_speed[is_valid] = np.nanmax(np.abs(back_fwd_dilation),axis=0) max_dilation_speed @@ -346,4 +346,4 @@ def process_run(raw_fname): args = parser.parse_args() raw_fname = args.fname - process_run(raw_fname) \ No newline at end of file + process_run(raw_fname)