sources#

Explicit registry of datakit data sources.

class mesofield.datakit.sources.MesoMetadataSource[source]#

Bases: MetadataJSON

Load mesoscope camera metadata JSON files as a table.

class mesofield.datakit.sources.PupilMetadataSource[source]#

Bases: MetadataJSON

Load pupil camera metadata JSON files as a table.

class mesofield.datakit.sources.Suite2pV2[source]#

Bases: TimeseriesSource

Load Suite2p outputs using nidaq pulse alignment.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue',)#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_timeseries(path, *, context=None)[source]#

Load Suite2p outputs and return timeline, payload, and metadata.

Parameters:
Return type:

tuple[ndarray, StreamPayload, dict]

class mesofield.datakit.sources.TreadmillSource[source]#

Bases: TimeseriesSource

Load treadmill samples aligned to the experiment window.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue',)#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_timeseries(path, *, context=None)[source]#

Return (timeline, value, meta).

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.DataqueueSource[source]#

Bases: TimeseriesSource

Load the dataqueue CSV as a time-indexed table.

build_timeseries(path, *, context=None)[source]#

Read *_dataqueue.csv and return a time-indexed table.

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.WheelEncoder[source]#

Bases: TimeseriesSource

Load wheel encoder streams recorded alongside nidaq pulses.

The raw CSV emitted by the behavioral rig contains incremental click counts, elapsed time in seconds, and instantaneous speed estimates. The loader converts this information into a strictly increasing timeline anchored to acquisition start, computes cumulative distance, and exposes rich metadata for downstream alignment against the nidaq-driven master clock.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue',)#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_timeseries(path, *, context=None)[source]#

Return (timeline, value, meta).

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.Psychopy[source]#

Bases: IntervalSeriesSource

Load Psychopy trial windows as an interval table.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue',)#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_intervals(path, *, context=None)[source]#

Return an intervals table with start/stop columns and meta.

Parameters:
Return type:

tuple[DataFrame, dict]

class mesofield.datakit.sources.MesoMeanSource[source]#

Bases: TimeseriesSource

Load mean fluorescence CSV.

The CSV is expected to contain at least Slice and Mean columns.

build_timeseries(path, *, context=None)[source]#

Read a mesoscope CSV and return a normalized table.

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.MesoDFFSource[source]#

Bases: TimeseriesSource

Load DFF fluorescence CSV.

The CSV is expected to contain at least Slice and Mean columns.

build_timeseries(path, *, context=None)[source]#

Read a mesoscope CSV and return a normalized table.

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.MesoMapSource[source]#

Bases: TimeseriesSource

Load mesomap traces and attach optional mask/region metadata.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue',)#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_timeseries(path, *, context=None)[source]#

Return (timeline, value, meta).

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.PupilDLCSource[source]#

Bases: TimeseriesSource

Load DeepLabCut HDF5 output and compute pupil diameters.

requires: ClassVar[Tuple[str, ...]] = ('dataqueue', 'pupil_metadata')#

Tag names of upstream sources whose loaded streams should be made available via LoadContext.dependencies. Soft contract: a missing or failed dependency yields None in dependencies[tag]; sources are responsible for either degrading gracefully or raising.

build_timeseries(path, *, context=None)[source]#

Load DeepLabCut output and return a time-indexed table.

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.SessionConfigSource[source]#

Bases: TableSource

Load configuration CSVs and surface subject/session attributes.

build_table(path, *, context=None)[source]#

Return (timeline, value, meta).

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.SessionNotesSource[source]#

Bases: TimeseriesSource

Load timestamped notes recorded by the experimenter.

build_timeseries(path, *, context=None)[source]#

Parse *_notes.txt into a timeline-aware dataframe.

Parameters:
Return type:

tuple[ndarray, DataFrame, dict]

class mesofield.datakit.sources.SessionTimestampsSource[source]#

Bases: IntervalSeriesSource

Load per-device start/stop timestamps as intervals.

build_intervals(path, *, context=None)[source]#

Return an intervals table with start/stop columns and meta.

Parameters:
Return type:

tuple[DataFrame, dict]

mesofield.datakit.sources.get_source_class(tag)[source]#

Return the source class for a tag.

Parameters:

tag (str)

Return type:

type[DataSource]

mesofield.datakit.sources.available_tags()[source]#

Return registered source tags in sorted order.

Return type:

tuple[str, …]

Subpackages#

Submodules#