pybispectra.utils.ResultsTDE#
- class pybispectra.utils.ResultsTDE(data: ndarray, indices: tuple[tuple[int]], times: ndarray, freq_bands: tuple[tuple[int | float]] | None = None, name: str = 'TDE')[source]#
Class for storing time delay estimation (TDE) results.
- Parameters:
- data
ndarray, shape of [nodes, frequency_bands, times] Results to store.
- indices
tupleoftupleofint, length of 2 Indices of the channels for each connection of the results. Should contain two tuples of equal length for the seed and target indices, respectively.
- times
ndarray, shape of [times] Timepoints in the results (in ms).
- freq_bands
tupleoftupleofintorfloat, length of 2 |None(defaultNone) Lower and higher frequencies (in Hz), respectively, of each frequency band used to compute the results.
- name
str(default"TDE") Name of the results being stored.
- data
- Attributes:
- name
str Name of the results.
- indices
tupleoftupleofint, length of 2 Indices of the channels for each connection in the results. Contains two tuples of equal length for the seed and target indices, respectively.
- shape
tupleofint Shape of the results i.e.,
[nodes, frequency bands, times].- n_nodes
int Number of connections in the results.
- times
ndarray, shape of [times] Timepoints in the results (in ms).
- freq_bands
tupleoftupleofintorfloat, length of 2 Lower and higher frequencies (in Hz), respectively, of each frequency band used to compute the results.
- tau
ndarray, shape of [nodes, frequency_bands] Estimated time delay (in ms) for each connection and frequency band.
- name
Methods
get_results([form, copy])Return the results.
plot([nodes, freq_bands, times, n_rows, ...])Plot the results.
- get_results(form: str = 'raveled', copy: bool = True) ndarray | tuple[ndarray, tuple[tuple[int]]][source]#
Return the results.
- Parameters:
- form
"raveled"|"compact"(default"raveled") How the results should be returned:
"raveled"- results have shape[nodes, ...];"compact"- results have shape[seeds, targets, ...], where...represents the data dimensions (e.g., frequencies, times).- copy
bool(defaultTrue) Whether or not to return a copy of the results.
Added in version 1.2.
- form
- Returns:
- plot(nodes: int | tuple[int] | None = None, freq_bands: int | tuple[int] | None = None, times: tuple[int | float] | None = None, n_rows: int = 1, n_cols: int = 1, major_tick_intervals: int | float = 500.0, minor_tick_intervals: int | float = 100.0, show: bool = True) tuple[list[Figure], list[ndarray]][source]#
Plot the results.
- Parameters:
- nodes
int|tupleofint|None(defaultNone) Indices of connections to plot. If
None, all connections are plotted.- freq_bands
int|tupleofint|None(defaultNone) Indices of frequency bands to plot. If
None, all frequency bands are plotted.- times
tupleofintorfloat, length of 2 |None(defaultNone) Start and end times (in ms) of the results to plot, respectively. If
None, plot all times.- n_rows
int(default1) Number of rows of subplots per figure.
- n_cols
int(default1) Number of columns of subplots per figure.
- major_tick_intervals
int|float(default500.0) Intervals (in ms) at which the major ticks of the x- and y-axes should occur.
- minor_tick_intervals
int|float(default100.0) Intervals (in ms) at which the minor ticks of the x- and y-axes should occur.
- show
bool(defaultTrue) Whether or not to show the plotted results.
- nodes
- Returns:
Notes
n_rowsandn_colsof1will plot the results for each connection on a new figure.