From 0fa21417bfa279aecf320add98dbe5d713a69725 Mon Sep 17 00:00:00 2001 From: JaerongA Date: Wed, 29 Nov 2023 17:16:04 +0000 Subject: [PATCH 1/2] add experiment devices & schema --- aeon/dj_pipeline/acquisition.py | 4 ++++ aeon/schema/dataset.py | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/aeon/dj_pipeline/acquisition.py b/aeon/dj_pipeline/acquisition.py index a74f69b0..58b6f8f4 100644 --- a/aeon/dj_pipeline/acquisition.py +++ b/aeon/dj_pipeline/acquisition.py @@ -23,6 +23,8 @@ "social0-r1": "FrameTop", "exp0.2-r0": "CameraTop", "oct1.0-r0": "CameraTop", + "social0.1-a3": "CameraTop", + "social0.1-a4": "CameraTop" } _device_schema_mapping = { @@ -30,6 +32,8 @@ "social0-r1": aeon_schema.exp01, "exp0.2-r0": aeon_schema.exp02, "oct1.0-r0": aeon_schema.octagon01, + "social0.1-a3": aeon_schema.social01, + "social0.1-a4": aeon_schema.social01 } diff --git a/aeon/schema/dataset.py b/aeon/schema/dataset.py index b9586de4..17ccdb59 100644 --- a/aeon/schema/dataset.py +++ b/aeon/schema/dataset.py @@ -1,6 +1,7 @@ from dotmap import DotMap import aeon.schema.core as stream +from aeon.io import reader from aeon.io.device import Device from aeon.schema import foraging, octagon @@ -57,3 +58,17 @@ Device("Wall8", octagon.Wall), ] ) + +social01 = exp02 +social01.Patch1.BeamBreak = reader.BitmaskEvent( + pattern="Patch1_32", value=0x22, tag="BeamBroken" +) +social01.Patch2.BeamBreak = reader.BitmaskEvent( + pattern="Patch2_32", value=0x22, tag="BeamBroken" +) +social01.Patch1.DeliverPellet = reader.BitmaskEvent( + pattern="Patch1_35", value=0x1, tag="TriggeredPellet" +) +social01.Patch2.DeliverPellet = reader.BitmaskEvent( + pattern="Patch2_35", value=0x1, tag="TriggeredPellet" +) From 79dcb979ea9af7ff2d95e589cbac0d167e13687b Mon Sep 17 00:00:00 2001 From: JaerongA Date: Wed, 29 Nov 2023 17:17:34 +0000 Subject: [PATCH 2/2] fix device_type_mapper.json path --- aeon/dj_pipeline/utils/load_metadata.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/aeon/dj_pipeline/utils/load_metadata.py b/aeon/dj_pipeline/utils/load_metadata.py index 8c88c90e..22ec4478 100644 --- a/aeon/dj_pipeline/utils/load_metadata.py +++ b/aeon/dj_pipeline/utils/load_metadata.py @@ -405,8 +405,6 @@ def get_device_mapper(schema: DotMap, metadata_yml_filepath: Path): device_sn (dict): {"device_name", "serial_number"} e.g. {'CameraTop': '21053810'} """ - import os - from aeon.io import api metadata_yml_filepath = Path(metadata_yml_filepath) @@ -420,8 +418,7 @@ def get_device_mapper(schema: DotMap, metadata_yml_filepath: Path): ) # Store the mapper dictionary here - repository_root = os.popen("git rev-parse --show-toplevel").read().strip() # repo root path - filename = Path(repository_root + "/aeon/dj_pipeline/create_experiments/device_type_mapper.json") + filename = Path(__file__).parent.parent / "create_experiments/device_type_mapper.json" device_type_mapper = {} # {device_name: device_type} device_sn = {} # {device_name: device_sn}