Reads smrx (spike2) files as pandas dataframes
Project description
Spike2Loader
A simple loader for Spike2 files (.smrx). Note that this package uses the sonpy package provided by spike2 which requires python 3.9.
It provides one executable named smrx2python
that directly operates on files and a function named as_python_data
to load an smrx file as a pandas table and numpy arrays.
smrx2python executable
The usage is the following:
smrx2python -i MYFILE.smrx
, where MYFILE.smrx is the path to your spike2 file.
It will create a tsv file MYFILE.tsv and a folder named MYFILE_data in the same folder as MYFILE.smrx. The contents are:
- MYFILE.tsv contains metadata for each channel
- MYFILE_data contains an
.npy
file (numpy array) for each channel.- For event channels, the contents of the array are the timing of the events in seconds. Note if the channel is registered as a rise and fall event (EventBoth on spike2), then the array will have two columns, one for rise and one for fall.
- For continuous channels the arrays are simply the set of values at the given sampling frequency (given by fs (in Hertz) from MYFILE.tsv)
as_python_data function
Similar to smrx2python -i MYFILE.smrx
but returns the pandas dataframe and a dictionary of numpy array instead of files.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spike2loader-0.5.tar.gz
.
File metadata
- Download URL: spike2loader-0.5.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1139e476b94b182441475853f1217f4070ae925d7404796178973b1e44bc942d |
|
MD5 | dba32e2c4da094b853d737ed1083bc13 |
|
BLAKE2b-256 | 20e1e6e8a28f06f14c33a84c71826a4890aa3832433a2b54579f3edeb343b848 |
File details
Details for the file spike2loader-0.5-py3-none-any.whl
.
File metadata
- Download URL: spike2loader-0.5-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab364bbf56f23f8c2de0bf31affc48365b0b8612d1dec003cf5a7124c87d2a6 |
|
MD5 | c2696cc7a8b2ff862e04e38743f882b1 |
|
BLAKE2b-256 | 0c95f2d7a68eb78c0f6929758cbb4967c7aaca1b2c33029b0e31e9eb83d0cab0 |