Skip to content

Commit

Permalink
change zero
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Kiggins committed Apr 24, 2018
1 parent 6ef98eb commit 66576c1
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions neuroglia/datasets/crcns.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,32 @@ def read_location_from_tar(f):
return loc




def load_hc2(tar_path):

with tarfile.open(mode="r:gz", name=tar_path) as f:
spikes = read_spikes_from_tar(f)
location = read_location_from_tar(f)

# truncate neuronal data to time when mouse is exploring
min_time = location['time'].min()
max_time = location['time'].max()

spikes = spikes[
(spikes['time'] >= min_time)
& (spikes['time'] <= max_time)
]

# set approx center of arena to zero in x & y
x0 = np.mean([location['x2'].max(),location['x2'].min()])
y0 = np.mean([location['y2'].max(),location['y2'].min()])

location['x'] -= x0
location['x2'] -= x0
location['y'] -= y0
location['y2'] -= y0

return spikes, location


Expand All @@ -182,6 +195,8 @@ def fetch_rat_hippocampus_foraging(data_home=None,username=None,password=None,do
To download this data, you must have a CRCNS account. Request an account
at https://crcns.org/request-account/
Warning! The first time you run this function, it will download a 3.3GB file.
Parameters
----------
data_home : optional, default: None
Expand Down Expand Up @@ -209,15 +224,17 @@ def fetch_rat_hippocampus_foraging(data_home=None,username=None,password=None,do
Notes
------
This dataset consists of 42 simultaneously recorded neurons from the rat
hippocampus along with coordinates of it's position while it forages in
an open field.
This dataset consists of 58 simultaneously recorded neurons from the rat
hippocampus along with coordinates of its position while it forages in an
open arena (180cm x 180cm) for 92 minutes.
References
----------
Mizuseki K, Sirota A, Pastalkova E, Buzsáki G. (2009): Multi-unit recordings
from the rat hippocampus made during open field foraging.
Mizuseki K, Sirota A, Pastalkova E, Buzsaki G. (2009): Multi-unit recordings
from the rat hippocampus made during open field foraging
http://dx.doi.org/10.6080/K0Z60KZ9
"""


Expand Down

0 comments on commit 66576c1

Please sign in to comment.