如何以二进制格式存储来自 NEST 模拟器的记录数据?

How can I store recorded data from the NEST simulator in a binary format?

我正在尝试将尖峰检测器数据写入二进制格式的 .gdf 文件,但我做不到。

我正在将尖峰检测器的 binary 参数设置为 True(我使用 nest.GetStatus 检查了它)但是文件是用 ASCII 编写的:

neurons = nest.Create('iaf_psc_alpha', 5)
sr = nest.Create('spike_recorder')
nest.Connect(neurons, sr)
sr.SetStatus({'binary': True})

我正在使用 NEST 2.18

NEST 2.18 和 2.20 的文档在这方面具有误导性。 binary 选项没有效果(它在打开文件时设置 ios::binary 标志,但这没有产生重大影响)。

如果要以二进制格式写入尖峰,需要切换到 NEST 3.0 并通过设置记录器的 record_to 属性:

使用 sionlib recording backend
neurons = nest.Create('iaf_psc_alpha', 5)
sr = nest.Create('spike_recorder')
nest.Connect(neurons, sr)
sr.SetStatus({'record_to': 'sionlib'})

文档中提供了 recording from simulations 的指南。