phys2cvr.regressors.create_fine_shift_regressors

phys2cvr.regressors.create_fine_shift_regressors(petco2hrf, optshift, lag_max, lag_min, freq, func_size, func_upsamp_size, outprefix, ext='.1D', legacy=False)[source]

Compute fine shifts to further optimize shifts.

Parameters:
petco2hrfnp.ndarray

Regressor of interest

optshiftint

The index shift computed by the Xcorr/bulk shift

lag_maxint, float, or None, optional

Upper limit of the temporal area to explore, expressed in seconds. Caution: this is not a pythonic range, but a real range, i.e. the upper limit is included. Default: None

lag_minint, float, or None, optional

Lower limit of the temporal area to explore, expressed in seconds. If set to None, and lag_max is not None and is positive, lag_min defaults to -lag_max (symmetric range). Default: None

freqstr, int, or float

Sample frequency of petco2hrf

func_sizeint

Total timepoints of functional timeseries

func_upsamp_sizeint

Total timepoints of functional timeseries, resampled at freq frequency

outprefixlist or path

Path to output directory for regressors.

extstr, optional

Extension to be used for the exported regressors.

legacybool, optional

If True, exclude the upper lag limit from the regression estimation. If True, the maximum number of regressors will be (freq*lag_max*2)

Returns:
petco2hrf_laggednp.ndarray

The shifted versions of the regressor of interest.