Skip to content

Raw indexing error #2311

@wronk

Description

@wronk

raw.time_as_index function can produce incorrect indices because it truncates instead of rounds when finding the nearest time value.

(Pdb) raw
<RawFIF  |  n_channels x n_times : 376 x 14400>
(Pdb) ts = raw.times
(Pdb) ts
array([  0.00000000e+00,   1.66496011e-03,   3.32992022e-03, ...,
         2.39704307e+01,   2.39720957e+01,   2.39737606e+01])
(Pdb) raw.time_as_index(ts)
array([    0,     1,     2, ..., 14397, 14397, 14399])

^^^
Non-unique index values in the indexed times.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions