Browse Source

This tries to make names and descriptions more uniform across Neo objects.

Michael Denker 1 year ago
parent
commit
ce063cf802
1 changed files with 14 additions and 13 deletions
  1. 14 13
      code/reachgraspio/reachgraspio.py

+ 14 - 13
code/reachgraspio/reachgraspio.py

@@ -556,7 +556,7 @@ class ReachGraspIO(BlackrockIO):
             times=pq.Quantity(event_time, 'ms').flatten(),
             labels=np.array(event_name),
             name='AnalogTrialEvents',
-            description='Events extracted from analog signals')
+            description='Events extracted from behavioural time series')
 
         performance_str = []
         for pit in performance_code:
@@ -788,7 +788,7 @@ class ReachGraspIO(BlackrockIO):
                 if chid not in unit_dict:
                     unit_dict[chid] = {}
                 if unit_id not in unit_dict[chid]:
-                    group = neo.Group(name='Unit {} on channel {}'.format(unit_id, chid),
+                    group = neo.Group(name='UnitGroup-ch{}#{}'.format(chid, unit_id),
                                       description='Group for neuronal data related to unit {} on '
                                                   'channel {}'.format(unit_id, chid),
                                       group_type='unit',
@@ -802,6 +802,10 @@ class ReachGraspIO(BlackrockIO):
 
                 unit_dict[chid][unit_id].add(st)
 
+                # create a consistent name and description for the spike train
+                st.name = 'SpikeTrain-ch{}#{}'.format(chid, unit_id)
+                st.description = 'SpikeTrain of unit {} on channel {}'.format(unit_id, chid)
+
         # if views are already created, link them to unit groups
         if view_dict:
             for chid, channel_dict in unit_dict.items():
@@ -889,10 +893,9 @@ class ReachGraspIO(BlackrockIO):
 
             if not any(neural_chids):
                 asig.annotate(neural_signal=False)
-                asig.name = "Behavioural Time Series"
-                asig.descriptions = "This Analogsignal object contains the continuous behavioural time series recorded in " \
-                                    "the experiment, including object displacements and measurements of the " \
-                                    "gripforce sensors."
+                asig.name = "BehaviourTimeSeries"
+                asig.descriptions = "Continuous behavioural time series recorded in the experiment, including " \
+                                    "object displacements and measurements of the gripforce sensors"
             elif all(neural_chids):
                 asig.annotate(neural_signal=True)
 
@@ -934,14 +937,12 @@ class ReachGraspIO(BlackrockIO):
                 ))
 
                 if asig.sampling_rate == pq.Quantity(30000 * pq.Hz):
-                    asig.name = "Raw Neural Time Series"
-                    asig.description = "This Analogsignal object contains the continuous raw neuronal recordings " \
-                                       "sampled at high resolution."
+                    asig.name = "NeuralTimeSeriesRaw"
+                    asig.description = "Continuous raw neuronal recordings sampled at high resolution"
                 if asig.sampling_rate == pq.Quantity(1000 * pq.Hz):
-                    asig.name = "Downsampled Neural Time Series"
-                    asig.description = "This Analogsignal object contains the downsampled continuous neuronal " \
-                                       "recordings, where the downsampling was performed on-line by the recording " \
-                                       "system."
+                    asig.name = "NeuralTimeSeriesDownsampled"
+                    asig.description = "Downsampled continuous neuronal recordings, where the downsampling was " \
+                                       "performed on-line by the recording system"
 
                 self.__annotate_electrode_rejections(asig)