experanto.interpolators.PhaseShiftedSequenceInterpolator
- class PhaseShiftedSequenceInterpolator(root_folder, cache_data=False, keep_nans=False, interpolation_mode='nearest_neighbor', normalize=False, normalize_subtract_mean=False, normalize_std_threshold=None, **kwargs)[source]
Bases:
SequenceInterpolatorSequence interpolator with per-signal phase shifts.
Extends
SequenceInterpolatorto handle signals recorded with different phase offsets (e.g., neurons with different response latencies). Each signal is interpolated at its own phase-shifted time.- Parameters:
root_folder (str) – Path to the modality directory. Must contain
meta/phase_shifts.npy.**kwargs – All parameters from
SequenceInterpolator.
- _phase_shifts
Per-signal phase shift values in seconds.
- Type:
Methods
__init__(root_folder[, cache_data, ...])close()create(root_folder[, cache_data])Factory method to create the appropriate interpolator for a modality.
interpolate(times[, return_valid])Map an array of time points to interpolated data values.
normalize_data(data)valid_times(times)- __init__(root_folder, cache_data=False, keep_nans=False, interpolation_mode='nearest_neighbor', normalize=False, normalize_subtract_mean=False, normalize_std_threshold=None, **kwargs)[source]
- interpolate(times, return_valid=False)[source]
Map an array of time points to interpolated data values.
- close()
- static create(root_folder, cache_data=False, **kwargs)
Factory method to create the appropriate interpolator for a modality.
Reads the
meta.ymlfile in the folder to determine the modality type and instantiates the corresponding interpolator subclass.- Parameters:
- Returns:
An instance of the appropriate interpolator subclass.
- Return type:
- Raises:
ValueError – If the modality type is not supported.
- load_meta()
- normalize_data(data)
- normalize_init()
- valid_times(times)