Scripts for controlling devices/running experiments/analyzing data
Project description
SciScripts
Scripts for controlling devices/running experiments/analyzing data
Dependencies
Mandatory
- System:
- Linux
- Python:
- numpy
- scipy
Optional (partial loss of funcionality if not installed)
- System:
- Portaudio
- sounddevice
- xdpyinfo
- Open-ephys analysis-tools [at github.com/open-ephys/analysis-tools]
- Python:
- pandas
- matplotlib
- pyserial
- rpy2
- h5py
- asdf
Also, some environment variables are expected to be set. You can add it to ~/.bashrc
, or ~/.profile
, or wherever your desktop environment searches for exported variables:
export DATAPATH=~/Data
export ANALYSISPATH=~/Analysis
changing the path to where you find appropriate.
Examples
In [1]: from sciscripts.IO import IO
In [2]: from sciscripts.Analysis import Analysis
In [3]: from sciscripts.Analysis.Plot import Plot
In [4]: Data, Rate = IO.DataLoader('DataSet/2018-08-13_13-25-45_1416/')
Loading recording1 ...
Loading recording2 ...
Loading recording3 ...
Loading recording4 ...
Loading recording5 ...
Loading recording6 ...
Loading recording7 ...
Loading recording8 ...
Converting to uV...
In [5]: Data.keys() # Get open-ephys recording processors
Out[5]: dict_keys(['100'])
In [6]: Rec0 = Data['100']['0'][:,:16] # Work with the 1st rec and 1st 16ch
In [7]: Rec0Theta = Analysis.FilterSignal(Rec0, Rate['100'], Frequency=[4,12], FilterOrder=2)
Filtering channel 1 ...
Filtering channel 2 ...
Filtering channel 3 ...
Filtering channel 4 ...
Filtering channel 5 ...
Filtering channel 6 ...
Filtering channel 7 ...
Filtering channel 8 ...
Filtering channel 9 ...
Filtering channel 10 ...
Filtering channel 11 ...
Filtering channel 12 ...
Filtering channel 13 ...
Filtering channel 14 ...
Filtering channel 15 ...
Filtering channel 16 ...
In [8]: Rec0Gamma = Analysis.FilterSignal(Rec0, Rate['100'], Frequency=[30,100], FilterOrder=2)
Filtering channel 1 ...
Filtering channel 2 ...
Filtering channel 3 ...
Filtering channel 4 ...
Filtering channel 5 ...
Filtering channel 6 ...
Filtering channel 7 ...
Filtering channel 8 ...
Filtering channel 9 ...
Filtering channel 10 ...
Filtering channel 11 ...
Filtering channel 12 ...
Filtering channel 13 ...
Filtering channel 14 ...
Filtering channel 15 ...
Filtering channel 16 ...
In [9]: Plot.AllCh(Rec0[:int(Rate['100']*0.5),:]) # Plot the 1st 0.5s from all ch
In [10]: Window = int(Rate['100']*0.5) # Plot the 1st 0.5s from all ch from raw, theta and gamma
...: plt = Plot.Return('plt')
...: Fig, Axes = plt.subplots(1,3)
...: Axes[0] = Plot.AllCh(Rec0[:Window,:], Ax=Axes[0])
...: Axes[1] = Plot.AllCh(Rec0Theta[:Window,:], Ax=Axes[1])
...: Axes[2] = Plot.AllCh(Rec0Gamma[:Window,:], Ax=Axes[2])
...: Plot.Set(Fig=Fig)
...: plt.show()
Scripts using this package for real experiments and analysis can be found here and here, respectively.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sciscripts-3.0.1.tar.gz
(96.6 kB
view hashes)
Built Distribution
sciscripts-3.0.1-py3-none-any.whl
(68.7 kB
view hashes)
Close
Hashes for sciscripts-3.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b9668acebf5b4d8b5a9d2758766d64ac1979735b757a13c0807f5ff5b4efbd8 |
|
MD5 | f1261d8f80c233ed8e3c9416770c9266 |
|
BLAKE2b-256 | 0137641369f502866b4683d538ac8577f890e3be8a90f0649fc3c05bf90d757e |