Skip to main content

feature_calculators.NumpyArrayFeatureCalculator

feature_calculators.NumpyArrayFeatureCalculator(
    lf,
    fs_lf,
    geometry,
    name,
    channel_metadata=None,
    t0=0.0,
    neuropixel_version=1,
)

Feature calculator for an LF array already held in memory.

Args: lf (np.ndarray): LF voltage shaped (n_channels, n_samples) in volts. fs_lf (float): LF sampling frequency in Hz. geometry (dict): Channel geometry with at least "x" and "y" arrays; missing derived keys (sample_shift, shank, col, row) are filled with defaults. name (str): Recording identifier used as the OOP pid in outputs. channel_metadata (pd.DataFrame, optional): Channel metadata (e.g. axial_um/lateral_um/x/y/z/atlas_id/ acronym/labels/shank). None falls back to a minimal frame built from geometry alone. t0 (float): Session-clock time (seconds) of lf’s first sample, for a caller whose array doesn’t start at session time 0. neuropixel_version (int): Neuropixels version passed to compute_features_from_raw (unused for LF-only feature families, kept for interface parity).

Methods

Name Description
available_duration Return (None, duration_lf) – this source has no AP stream.
load_channel_metadata Return the supplied channel metadata, or a minimal geometry-only frame.
load_geometry Return the supplied geometry, filling derived-default keys.
load_raw_snippet Slice one LF snippet directly out of the in-memory array.

available_duration

feature_calculators.NumpyArrayFeatureCalculator.available_duration()

Return (None, duration_lf) – this source has no AP stream.

load_channel_metadata

feature_calculators.NumpyArrayFeatureCalculator.load_channel_metadata()

Return the supplied channel metadata, or a minimal geometry-only frame.

Returns: pd.DataFrame: channel_metadata as supplied, or (when omitted) a frame with channel/axial_um/lateral_um/shank built from load_geometry().

load_geometry

feature_calculators.NumpyArrayFeatureCalculator.load_geometry()

Return the supplied geometry, filling derived-default keys.

Returns: dict[str, np.ndarray]: x/y as supplied, plus sample_shift/shank/col/row defaults when absent.

load_raw_snippet

feature_calculators.NumpyArrayFeatureCalculator.load_raw_snippet(window)

Slice one LF snippet directly out of the in-memory array.

Args: window (SnippetWindow): Snippet time window to read (duration_ap is ignored – this source is LF-only).

Returns: RawSnippet: raw_ap=None; raw_lf shaped (channels, samples) in volts.