-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from ttngu207/datajoint_pipeline
Update ingestion - using new Stream/Device io
- Loading branch information
Showing
13 changed files
with
595 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,65 @@ | ||
import aeon.io.device as _device | ||
from aeon.schema.streams import Stream, StreamGroup | ||
import aeon.io.reader as _reader | ||
|
||
|
||
def heartbeat(pattern): | ||
class Heartbeat(Stream): | ||
"""Heartbeat event for Harp devices.""" | ||
return {"Heartbeat": _reader.Heartbeat(f"{pattern}_8_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Heartbeat(f"{pattern}_8_*")) | ||
|
||
def video(pattern): | ||
|
||
class Video(Stream): | ||
"""Video frame metadata.""" | ||
return {"Video": _reader.Video(f"{pattern}_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Video(f"{pattern}_*")) | ||
|
||
|
||
def position(pattern): | ||
class Position(Stream): | ||
"""Position tracking data for the specified camera.""" | ||
return {"Position": _reader.Position(f"{pattern}_200_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Position(f"{pattern}_200_*")) | ||
|
||
|
||
def encoder(pattern): | ||
class Encoder(Stream): | ||
"""Wheel magnetic encoder data.""" | ||
return {"Encoder": _reader.Encoder(f"{pattern}_90_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Encoder(f"{pattern}_90_*")) | ||
|
||
def environment(pattern): | ||
|
||
class Environment(StreamGroup): | ||
"""Metadata for environment mode and subjects.""" | ||
return _device.register(pattern, environment_state, subject_state) | ||
|
||
def __init__(self, pattern): | ||
super().__init__(pattern, EnvironmentState, SubjectState) | ||
|
||
|
||
def environment_state(pattern): | ||
class EnvironmentState(Stream): | ||
"""Environment state log.""" | ||
return {"EnvironmentState": _reader.Csv(f"{pattern}_EnvironmentState_*", ["state"])} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Csv(f"{pattern}_EnvironmentState_*", ["state"])) | ||
|
||
def subject_state(pattern): | ||
|
||
class SubjectState(Stream): | ||
"""Subject state log.""" | ||
return {"SubjectState": _reader.Subject(f"{pattern}_SubjectState_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Subject(f"{pattern}_SubjectState_*")) | ||
|
||
|
||
def message_log(pattern): | ||
class MessageLog(Stream): | ||
"""Message log data.""" | ||
return {"MessageLog": _reader.Log(f"{pattern}_MessageLog_*")} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Log(f"{pattern}_MessageLog_*")) | ||
|
||
def metadata(pattern): | ||
|
||
class Metadata(Stream): | ||
"""Metadata for acquisition epochs.""" | ||
return {pattern: _reader.Metadata(pattern)} | ||
|
||
def __init__(self, pattern): | ||
super().__init__(_reader.Metadata(pattern)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from dotmap import DotMap | ||
|
||
import aeon.schema.core as stream | ||
from aeon.schema.streams import Device | ||
from aeon.schema import foraging, octagon | ||
|
||
exp02 = DotMap( | ||
[ | ||
Device("Metadata", stream.Metadata), | ||
Device("ExperimentalMetadata", stream.Environment, stream.MessageLog), | ||
Device("CameraTop", stream.Video, stream.Position, foraging.Region), | ||
Device("CameraEast", stream.Video), | ||
Device("CameraNest", stream.Video), | ||
Device("CameraNorth", stream.Video), | ||
Device("CameraPatch1", stream.Video), | ||
Device("CameraPatch2", stream.Video), | ||
Device("CameraSouth", stream.Video), | ||
Device("CameraWest", stream.Video), | ||
Device("Nest", foraging.Weight), | ||
Device("Patch1", foraging.Patch), | ||
Device("Patch2", foraging.Patch), | ||
] | ||
) | ||
|
||
exp01 = DotMap( | ||
[ | ||
Device("SessionData", foraging.SessionData), | ||
Device("FrameTop", stream.Video, stream.Position), | ||
Device("FrameEast", stream.Video), | ||
Device("FrameGate", stream.Video), | ||
Device("FrameNorth", stream.Video), | ||
Device("FramePatch1", stream.Video), | ||
Device("FramePatch2", stream.Video), | ||
Device("FrameSouth", stream.Video), | ||
Device("FrameWest", stream.Video), | ||
Device("Patch1", foraging.DepletionFunction, stream.Encoder, foraging.Feeder), | ||
Device("Patch2", foraging.DepletionFunction, stream.Encoder, foraging.Feeder), | ||
] | ||
) | ||
|
||
octagon01 = DotMap( | ||
[ | ||
Device("Metadata", stream.Metadata), | ||
Device("CameraTop", stream.Video, stream.Position), | ||
Device("CameraColorTop", stream.Video), | ||
Device("ExperimentalMetadata", stream.SubjectState), | ||
Device("Photodiode", octagon.Photodiode), | ||
Device("OSC", octagon.OSC), | ||
Device("TaskLogic", octagon.TaskLogic), | ||
Device("Wall1", octagon.Wall), | ||
Device("Wall2", octagon.Wall), | ||
Device("Wall3", octagon.Wall), | ||
Device("Wall4", octagon.Wall), | ||
Device("Wall5", octagon.Wall), | ||
Device("Wall6", octagon.Wall), | ||
Device("Wall7", octagon.Wall), | ||
Device("Wall8", octagon.Wall), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.