-
Notifications
You must be signed in to change notification settings - Fork 267
Closed
Description
The order of values stored in an AnalogSignal is not preserved when writing to the Nix format and reading the data again.
Here is a minimal code example
from neo import AnalogSignal,NixIO, Segment, Block
import quantities as pq
import numpy as np
import os
arr = np.array([[-0.36, -0.28, -0.36, -0.28, -0.2 , -0.12, -0.04, 0.04, 0.12, 0.2 , 0.28, 0.36, -0.2 , -0.36, -0.28, -0.2 , -0.12, -0.04, 0.36]])
anasig = AnalogSignal(arr*pq.dimensionless,t_start=0*pq.s, sampling_rate=1*pq.Hz)
bl1 = Block()
bl1.segments.append(Segment('testseg'))
bl1.segments[0].analogsignals.append(anasig)
filename='testfile.nix'
if os.path.exists(filename):
os.remove(filename)
with NixIO(filename) as io:
io.write(bl1)
with NixIO(filename) as io:
bl2 = io.read_block()
print(bl.segments[0].analogsignals[0].magnitude == bl2.segments[0].analogsignals[0].magnitude)Metadata
Metadata
Assignees
Labels
No labels