Skip to content

Commit 651a1f9

Browse files
committed
First commit intro files
1 parent fd0722b commit 651a1f9

File tree

11 files changed

+2038
-1
lines changed

11 files changed

+2038
-1
lines changed

.ipynb_checkpoints/Main-checkpoint.ipynb

Lines changed: 313 additions & 0 deletions
Large diffs are not rendered by default.

Main.ipynb

Lines changed: 313 additions & 0 deletions
Large diffs are not rendered by default.

OpenEphys.py

Lines changed: 467 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,48 @@
1-
# learning-python
1+
# TNEL Python Tutorial
2+
3+
Using python for ephys data
4+
5+
## Step 1 (by yourself)
6+
### Setting up Python
7+
Only for windows. Mac and Linux are good to go already.
8+
9+
Option 1) Install anaconda (has a bunch of very useful modules and programs built-in) (https://www.anaconda.com/distribution/)
10+
11+
Option 2) Install basic python (https://www.python.org/)
12+
13+
### Learn basic python
14+
This may take a bit depending on your experience programming. learnpython.org looks like a very good starting point. Lots of other options too. Youtube, w3schools (only up to file handling), etc.
15+
16+
## Step 2 (With us)
17+
### Setting up GitHub
18+
- Create a github account. (DON'T USE UMN EMAIL!)
19+
20+
- Download git (https://gitforwindows.org/).
21+
22+
- Open Git Bash
23+
24+
- Use commands "cd" (change directory) and "ls" (list) to change to where you want to save your files. i.e. "cd Documents"
25+
26+
- Create a new folder for GitHub "mkdir GitHub" (make directory), and go into it "cd GitHub".
27+
28+
- Now back to your browser and go to our github repository (https://github.com/tne-lab/learning-python). Click fork in the upper right corner. Then click on your account. This will make a private version for yourself.
29+
30+
- Now go to your private repo (https://github.com/CHANGETOYOURUSERNAME/learning-python) and copy the link from the green clone button.
31+
32+
- Back to git bash and type "git clone https://github.com/CHANGETOYOURUSERNAME/learning-python". This creates a local copy for yourself.
33+
34+
35+
### Open Main in juypter
36+
Start a juypter notdebook and open up the main.ipynb file which is located in the folder that you cloned from github.
37+
38+
Complete it.
39+
40+
## Step 3
41+
### Push your new changes to github so they will be backed up.
42+
- Return to git bash and "cd" into your learning-python folder.
43+
44+
- Use the command "git add -A" to add all files to be staged to be commited.
45+
46+
- Use the command "git commit -m "My first commit"" to commit the changes. This means that these files are the most up to date changes.
47+
48+
- Use the command "git push" to push the files up your github repository so they will be saved both locally and in the cloud. Go to your github repo (https://github.com/CHANGETOYOURUSERNAME/learning-python) and make sure your new changes are there.
13 KB
Binary file not shown.

butter.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from scipy.signal import butter, lfilter
2+
3+
'''
4+
Option 1
5+
6+
How Mark S did this.
7+
'''
8+
def butter_bandpass(lowcut, highcut, fs, order=5):
9+
nyq = 0.5 * fs
10+
low = lowcut / nyq
11+
high = highcut / nyq
12+
b, a = butter(order, [low, high], btype='band')
13+
return b, a
14+
15+
16+
def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
17+
b, a = butter_bandpass(lowcut, highcut, fs, order=order)
18+
filteredData = lfilter(b, a, data)
19+
return filteredData
20+
21+
22+
'''
23+
Option 2
24+
25+
Example from scipy.
26+
'''
27+
sos = signal.butter(10, 15, 'hp', fs=1000, output='sos')
28+
filtered = signal.sosfilt(sos, sig)

data/OP7/Continuous_Data.openephys

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<EXPERIMENT version="0.40000000000000002" number="1" separatefiles="0">
4+
<RECORDING number="0" samplerate="30000">
5+
<PROCESSOR id="100">
6+
<CHANNEL name="CH1" bitVolts="0.19499999284744263" filename="100_CH1.continuous"
7+
position="1024"/>
8+
<CHANNEL name="CH2" bitVolts="0.19499999284744263" filename="100_CH2.continuous"
9+
position="1024"/>
10+
<CHANNEL name="CH3" bitVolts="0.19499999284744263" filename="100_CH3.continuous"
11+
position="1024"/>
12+
<CHANNEL name="CH4" bitVolts="0.19499999284744263" filename="100_CH4.continuous"
13+
position="1024"/>
14+
<CHANNEL name="CH5" bitVolts="0.19499999284744263" filename="100_CH5.continuous"
15+
position="1024"/>
16+
<CHANNEL name="CH6" bitVolts="0.19499999284744263" filename="100_CH6.continuous"
17+
position="1024"/>
18+
<CHANNEL name="CH7" bitVolts="0.19499999284744263" filename="100_CH7.continuous"
19+
position="1024"/>
20+
<CHANNEL name="CH8" bitVolts="0.19499999284744263" filename="100_CH8.continuous"
21+
position="1024"/>
22+
<CHANNEL name="CH17" bitVolts="0.19499999284744263" filename="100_CH17.continuous"
23+
position="1024"/>
24+
<CHANNEL name="CH18" bitVolts="0.19499999284744263" filename="100_CH18.continuous"
25+
position="1024"/>
26+
<CHANNEL name="CH19" bitVolts="0.19499999284744263" filename="100_CH19.continuous"
27+
position="1024"/>
28+
<CHANNEL name="CH20" bitVolts="0.19499999284744263" filename="100_CH20.continuous"
29+
position="1024"/>
30+
<CHANNEL name="CH21" bitVolts="0.19499999284744263" filename="100_CH21.continuous"
31+
position="1024"/>
32+
<CHANNEL name="CH22" bitVolts="0.19499999284744263" filename="100_CH22.continuous"
33+
position="1024"/>
34+
<CHANNEL name="CH23" bitVolts="0.19499999284744263" filename="100_CH23.continuous"
35+
position="1024"/>
36+
<CHANNEL name="CH24" bitVolts="0.19499999284744263" filename="100_CH24.continuous"
37+
position="1024"/>
38+
<CHANNEL name="AUX1" bitVolts="3.7400001019705087e-005" filename="100_AUX1.continuous"
39+
position="1024"/>
40+
<CHANNEL name="AUX2" bitVolts="3.7400001019705087e-005" filename="100_AUX2.continuous"
41+
position="1024"/>
42+
<CHANNEL name="AUX3" bitVolts="3.7400001019705087e-005" filename="100_AUX3.continuous"
43+
position="1024"/>
44+
</PROCESSOR>
45+
<PROCESSOR id="104">
46+
<CHANNEL name="CH1" bitVolts="0.19499999284744263" filename="104_CH1.continuous"
47+
position="1024"/>
48+
</PROCESSOR>
49+
</RECORDING>
50+
</EXPERIMENT>

data/OP7/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Crossing target = 130
2+
(Stim target = 180)

data/OP7/all_channels.events

69.6 KB
Binary file not shown.

data/OP7/messages.events

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
41176507 Software time: 41176507@3328261Hz
2+
41176500 Processor: Rhythm FPGA Id: 100 subProcessor: 0 start time: 41176500@30000Hz

0 commit comments

Comments
 (0)