Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove second bulk shift estimation (doesn't make sense). #40

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions phys2cvr/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ def get_regr(func_avg, petco2hrf, tr, freq, outname, lag_max=None,
_, optshift, xcorr = x_corr(func_cut, petco2hrf, nrep)
LGR.info(f'First cross correlation estimated bulk shift at {optshift/freq} seconds')

if trial_len and n_trials and n_trials > 2:
LGR.info('Running second bulk shift estimation')
if len(func_upsampled) + nrep > len(petco2hrf):
pad = len(func_upsampled) + nrep - len(petco2hrf)
petco2hrf_padded = np.pad(petco2hrf, pad, mode='mean')
else:
petco2hrf_padded = petco2hrf

_, optshift, xcorr = x_corr(func_upsampled, petco2hrf_padded, nrep, -nrep, optshift)
LGR.info(f'Second cross correlation estimated bulk shift at {optshift/freq} seconds')

# Export estimated optimal shift in seconds
with open(f'{outname}_optshift.1D', 'w') as f:
print(f'{(optshift/freq):.4f}', file=f)
Expand Down