Skip to content

NeuroScopeRawIO: use lfpSamplingRate for .lfp and .eeg files - #1967

Open
aaronkanzer wants to merge 1 commit into
NeuralEnsemble:masterfrom
aaronkanzer:fix/neuroscope-lfp-rate
Open

aaronkanzer wants to merge 1 commit into
NeuralEnsemble:masterfrom
aaronkanzer:fix/neuroscope-lfp-rate

Conversation

@aaronkanzer

Copy link
Copy Markdown
Contributor

In a Neuroscope XML, acquisitionSystem/samplingRate is the rate of the wideband .dat file. The downsampled .lfp and .eeg files are written at fieldPotentials/lfpSamplingRate. NeuroScopeRawIO always uses samplingRate, so LFP files get the wideband rate. Their times and durations come out too short by the ratio of the two rates, 16x for the common 20000 / 1250 Hz setup.

Repro with neuroscope/dataset_1 from ephy_testing_data. The XML has samplingRate 20000 and lfpSamplingRate 1250:

from neo.rawio import NeuroScopeRawIO
r = NeuroScopeRawIO(filename="YutaMouse42-151117.eeg"); r.parse_header()
print(r.header["signal_channels"]["sampling_rate"][0], r.get_signal_size(0, 0, 0), r.segment_t_stop(0, 0))

Observed on 0.14.6 and master: 20000.0 10 0.0005

Expected: 1250.0 10 0.008

Fix: when the data file ends in .lfp or .eeg and the XML has fieldPotentials/lfpSamplingRate, use that rate. .dat files are unchanged. A test covers both suffixes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant