pyavs.compute_population_codes

pyavs.compute_population_codes(source_data: ndarray, events_metadata: DataFrame, conditions: List[str], time_window: Tuple[float, float], times: ndarray, baseline: Tuple[float, float] | None = None, normalize: bool = False, verbose: bool = True) Dict[str, ndarray][source]

Compute population codes for different experimental conditions.

Parameters:
  • source_data (np.ndarray) – Source space data with shape (n_epochs, n_sources, n_times)

  • events_metadata (pd.DataFrame) – Metadata for each epoch

  • conditions (list of str) – Column names in metadata defining conditions

  • time_window (tuple of float) – Time window for population code computation

  • times (np.ndarray) – Time points in seconds

  • baseline (tuple of float, optional) – Baseline time window (default: None)

  • normalize (bool, optional) – Whether to normalize population codes (default: True)

  • verbose (bool, optional) – Whether to print progress information (default: True)

Returns:

Dictionary mapping conditions to population codes

Return type:

dict