diff --git a/doc/source/authors.rst b/doc/source/authors.rst index 357faaf52..0d23f4941 100644 --- a/doc/source/authors.rst +++ b/doc/source/authors.rst @@ -108,6 +108,7 @@ and may not be the current affiliation of a contributor. * Axel Coiffard-Donaty * Anthony Mercer * Aaron Kanzer [53] +* Tianlong (DanceoftheAurora@github) 1. Centre de Recherche en Neuroscience de Lyon, CNRS UMR5292 - INSERM U1028 - Université Claude Bernard Lyon 1 2. Unité de Neuroscience, Information et Complexité, CNRS UPR 3293, Gif-sur-Yvette, France diff --git a/neo/rawio/spikegadgetsrawio.py b/neo/rawio/spikegadgetsrawio.py index 73fdcc76e..971f794d3 100644 --- a/neo/rawio/spikegadgetsrawio.py +++ b/neo/rawio/spikegadgetsrawio.py @@ -436,6 +436,31 @@ def _parse_header(self): for ann in (bl_ann, seg_ann): ann.update(gconf.attrib) + def _get_spikegadgets_timestamps(self, i_start=None, i_stop=None): + """Return native acquisition ticks for the selected stored packets. + + Each packet contains one uint32 sample tick shared by all signal streams. + The reader currently exposes one block and one segment. These ticks are + neither seconds nor the nominal times used by AnalogSignal: their initial + value, gaps, counter rollovers and resets are preserved without unwrapping. + + Parameters + ---------- + i_start : int | None, default: None + First stored packet index. None means the beginning of the recording. + i_stop : int | None, default: None + Exclusive stop packet index. None means the end of the recording. + + Returns + ------- + timestamps : np.ndarray + Read-only, one-dimensional view of the file's little-endian uint32 + ticks, one per stored packet in the requested slice. + """ + timestamp_bytes = self._raw_memmap[:, self._timestamp_byte : self._timestamp_byte + 4] + timestamps = timestamp_bytes.view("' '' "" + if with_aux + else "" + ) + header = ( + "\n\n" + '' + f"{device}\n" + '' + '' + "\n\n" + ) + fields = [("marker", "u1")] + if with_aux: + fields.append(("aux", "