read_tdt / TdtRawIO: stitched TDT blocks with time gaps lose their gaps and timing, float32 streams are mislabeled as µV with gain 1, and SEV-flagged stores without .sev files block opening
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Start with read_tdt and Neo’s TdtRawIO in neo/rawio/tdtrawio.py, especially the header parsing and timestamp handling described in the report. Reproduce the four failures with the supplied environment and compare stitched-block timing and float32 values against the tdt package. Done means blocks without .Tdx open or produce a clear error, gaps retain correct timing, float32 units are reported correctly, and a missing .sev store does not prevent reading the requested stream.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Environment: spikeinterface 0.106.0, neo 0.14.6 (also checked neo 0.13.4), numpy 2.4.6, Python 3.11, macOS. The reference reader is the tdt package 0.7.6.
Context: I record a single session as several TDT blocks and concatenate them into one stitched block, so the stitched block's .tsq/.tev hold the chunks of every source block with their original timestamps, including long real-time gaps between blocks. I tested whether si.read_tdt can read the stitched block directly in place of my own binary writer. The data are 32-channel float32 streams at 12,207.03125 Hz, and the stores report Scale: Unity in TDT's StoresListing.
1. A block without a .Tdx file fails with an IndexError
UserWarning: Could not find any data set belonging to .../rec0
File ".../neo/rawio/tdtrawio.py", line 193, in _parse_header
self._global_t_start = self._seg_t_starts[0]
IndexError: list index out of range
A block made outside Synapse may have .tsq/.tev but no .Tdx. Adding an empty .Tdx (through a symlink view) makes it open. Expected behavior: open from .tsq/.tev alone, or raise a clear error that names the missing file.
2. Time gaps inside a block are dropped and the time axis is wrong after each gap
When the .tsq chunk timestamps jump (here by 134.854 s and 4,290.876 s), TdtRawIO reports one segment and simply concatenates the chunks: 141,986,816 samples (11,631.56 s), when the timestamps span 15,922.39 s. Every sample after a jump has the wrong time, early by exactly the gap length. The samples themselves are bit-identical to the tdt package's (max abs diff 0.0). Expected behavior: split into segments at timestamp discontinuities larger than one chunk (each with the correct t_start), or at least warn. Opening the parent tank folder of the unstitched source blocks gives correct segments and t_start values.
3. Float32 streams are labeled µV with gain 1, but the values are volts
TdtRawIO hard-codes units "uV", gain 1.0 and offset 0.0. For these stores (Scale: Unity, float32), the values are volts, so the reported µV are wrong by exactly 1e6, which silently affects amplitude-based metrics and thresholds. Expected behavior: report units V (gain 1e6 to µV), or read the store's scale/format.
4. neo 0.14.6 refuses to open a block where an unused store is flagged as SEV-mode but has no .sev files
A block whose eye-tracker store eyeL is flagged SEV in the .tsq with no .sev files present fails to open in neo 0.14.6, even when only the RAW stream is requested. neo 0.13.4 opens the same block, and its samples match the reference reader. Expected behavior: skip or warn on that store, not refuse the whole block.
I can share small .tsq/StoresListing excerpts or a reproducer script if that helps. Issues 1, 3 and 4 may belong in python-neo (TdtRawIO); I'm filing here first because I hit them through read_tdt. Happy to move or cross-post them.
- Linguagem predominante
- Python
- Estrelas
- 883
- Forks
- 291
- Merge médio
- 3d 17h
- PRs com merge (30d)
- 40
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de SpikeInterface/spikeinterface
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
SpikeInterface/spikeinterface#5008 ·
Mantenedores costumam responder em até 2 dias
-
`plot_potential_merges` draws the correlograms of other units when a merge group is not sortedAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
SpikeInterface/spikeinterface#5007 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
SpikeInterface/spikeinterface#5006 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
SpikeInterface/spikeinterface#5005 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
SpikeInterface/spikeinterface#5004 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de SpikeInterface/spikeinterface
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
daniel-ospina/tortoise#15308 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia
-
difficulty:easy prio:low type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NatronGitHub/Natron#2405 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Jstar269/nakagawa-recomp#3746 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia