allensdk.brain_observatory.ecephys.probes module

class allensdk.brain_observatory.ecephys.probes.Probes[source]

Bases: DataObject, JsonReadableInterface, NwbReadableInterface, NwbWritableInterface

classmethod from_json(probes: List[Dict[str, Any]], skip_probes: List[str] | None = None) Probes[source]
Parameters:
probes
skip_probes: Names of probes to exclude (due to known bad data

for example)

Returns
——-
`Probes` instance
classmethod from_nwb(nwbfile: NWBFile, probe_lfp_meta_map: Dict[str, ProbeWithLFPMeta] | None = None) Probes[source]
Parameters:
nwbfile
probe_lfp_meta_map

See description in BehaviorEcephysSession.from_nwb

Returns:
NWBFile with probes added
get_units_table(filter_by_validity: bool = True, filter_out_of_brain_units: bool = True, amplitude_cutoff_maximum: float | None = None, presence_ratio_minimum: float | None = None, isi_violations_maximum: float | None = None) DataFrame[source]

Gets a dataframe representing all units detected by all probes

Parameters:
filter_by_validity

Whether to filter out units in channels with valid_data==False

filter_out_of_brain_units

Whether to filter out units with missing ecephys_structure_acronym

amplitude_cutoff_maximum

Filter units by this upper bound

presence_ratio_minimum

Filter units by this lower bound

isi_violations_maximum

Filter units by this upper bound

Returns
——-
Dataframe containing all units detected by probes
Columns:
  • properties of allensdk.ecephys._unit.Unit

except for ‘spike_times’, ‘spike_amplitudes’, ‘mean_waveforms’ which are returned separately

property mean_waveforms: Dict[int, ndarray]
Returns:
Dictionary mapping unit id to mean_waveforms for all probes
property probes
property spike_amplitudes: Dict[int, ndarray]
Returns:
Dictionary mapping unit id to spike_amplitudes for all probes
property spike_times: Dict[int, ndarray]
Returns:
Dictionary mapping unit id to spike_times for all probes
to_dataframe()[source]
to_nwb(nwbfile: NWBFile) Tuple[NWBFile, Dict[str, NWBFile | None]][source]

Adds probes to NWBFile instance

Parameters:
nwbfile
Returns:
(session NWBFile instance,

mapping from probe name to optional probe NWBFile instance. Contains LFP and CSD data if it exists)

Notes

We return a map from probe name to nwb file separately, since the LFP data is large, and we want this written separately from the session nwb file