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
tuple
oftuple
ofint
, 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
tuple
oftuple
ofint
orfloat
, length of 2 |None
(defaultNone
) Lower and higher frequencies (in Hz) 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
tuple
oftuple
ofint
, 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
tuple
ofint
Shape of the results i.e. [nodes, frequency bands, times].
- n_nodes
str
Number of connections in the results.
- times
ndarray
, shape of [times] Timepoints in the results (in ms).
- freq_bands
tuple
oftuple
ofint
orfloat
, length of 2 |None
Lower and higher frequencies (in Hz) of each frequency band used to compute the results.
tau
ndarray
, shape of [nodes,frequency
bands
]Return the estimated time delay for each connection (in ms).
- 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
str
(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
|tuple
ofint
|None
(defaultNone
) Indices of connections to plot. If
None
, all connections are plotted.- freq_bands
int
|tuple
ofint
|None
(defaultNone
) Indices of frequency bands to plot. If
None
, all frequency bands are plotted.- times
tuple
ofint
orfloat
|None
(defaultNone
) Start and end times of the results to plot. 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_rows
andn_cols
of1
will plot the results for each connection on a new figure.