### Understand our data
##### Read in the pickle file

```python
import numpy as np
import pandas as pd
import pickle
```

```python
data = pd.read_pickle('ret1_data.pkl')
```

```python
type(data)
```

    list

```python
type(data[0])
```

    dict

```python
len(data)
```

    16

The data in the pickle file is a list of $16$ dictionaries, as stated in the description of the data structure.

```python
example = data[15]

print(example.keys())

name = example['subject_name']

print(f'Subject names are of the form "{name}"')
```

    dict_keys(['sample_number', 'stimulations', 'subject_name', 'session_date'])
    Subject names are of the form "WT (pax6 het)"

See how many unique subject names there are.

```python
subjects = set([item['subject_name'] for item in data])

print(f'There are {len(subjects)} unique subjects.')

print(subjects)
```

    There are 5 unique subjects.
    {'KO (chx10)', 'KO bax -/- (chx10)', 'WT (chx10 het)', 'WT (pax6 het)', 'KO (pax6)'}

Therefore, we can assume that each subject may have been used in more than one sample, much like in the tutorial where a single mouse could be used for multiple experiment sessions.

## Import DataJoint and start creating pipeline

### Part (1) of the challenge

```python
import datajoint as dj

# dj.config['database.user'] =  'USERNAME_GOES_HERE'
# dj.config['database.password'] = 'PASSWORD_GOES_HERE'             # replace with real password
dj.config['database.host'] = 'tutorial-db.datajoint.io'   # DataJoint tutorial database

dj.config.save_global()

dj.conn()
```

    Connecting rnvoleti@tutorial-db.datajoint.io:3306

    DataJoint connection (connected) rnvoleti@tutorial-db.datajoint.io:3306

The first step is to create a `dj.Manual()` table for each of the mice, as we did in the tutorial. However, here the only unique identifier provided is the `subject_name` key, so we will use that as the primary attribute for this new `Mouse` table. However, we can add another attributes for knockout (KO) or wild type (WT), and call it `type`.

Start by defining a new schema.

```python
schema = dj.schema('rnvoleti_interview')
```

```python
@schema
class Subject(dj.Manual):
    definition = """
    # Experimental animals
    subject_name             : varchar(30)
    ---
    gene                     : varchar(30)
    genotype                 : enum('homozygous', 'heterozygous')
    type                     : enum('WT', 'KO')
    bax='unknown'            : enum('-/-', '+/+', '+/-', 'unknown')
    """
```

```python
Subject()
```

Experimental animals

subject_name

gene

genotype

type

bax

Total: 0

```python
subjects
```

    {'KO (chx10)',
     'KO (pax6)',
     'KO bax -/- (chx10)',
     'WT (chx10 het)',
     'WT (pax6 het)'}

```python
# Create a list of dictionaries for all subjects
# Note: I am manually entering this since there are only 5 unique mice, but it would probably be better to write some code to parse the subject_name

subject_list = [{'subject_name': 'KO (chx10)' , 'gene': 'chx10', 'genotype': 'homozygous', 'type': 'KO', 'bax': 'unknown'},
                {'subject_name': 'KO (pax6)' , 'gene': 'pax6','genotype': 'homozygous', 'type': 'KO', 'bax': 'unknown'},
                {'subject_name': 'KO bax -/- (chx10)' , 'gene': 'chx10', 'genotype': 'homozygous', 'type': 'KO', 'bax': '-/-'},
                {'subject_name': 'WT (chx10 het)' , 'gene': 'chx10', 'genotype': 'heterozygous', 'type': 'WT', 'bax': 'unknown'},
                {'subject_name': 'WT (pax6 het)' , 'gene': 'pax6', 'genotype': 'heterozygous', 'type': 'WT', 'bax': 'unknown'}
               ]

```

```python
Subject.insert(subject_list, skip_duplicates=True)
```

```python
Subject()
```

    Experimental animals

subject_name

gene

genotype

type

bax

 KO (chx10)
chx10
homozygous
KO
unknown

KO (pax6)
pax6
homozygous
KO
unknown

KO bax -/- (chx10)
chx10
homozygous
KO
-/-

WT (chx10 het)
chx10
heterozygous
WT
unknown

WT (pax6 het)
pax6
heterozygous
WT
unknown

Total: 5

#### Do a test query

```python
Subject() & 'genotype = "heterozygous"'
```

    Experimental animals

subject_name

gene

genotype

type

bax

 WT (chx10 het)
chx10
heterozygous
WT
unknown

WT (pax6 het)
pax6
heterozygous
WT
unknown

Total: 2

#### Create Session Table

This will depend on the `Subject`.

Using the data loaded from the pickle file, we can use the `dj.Manual` tier here to define a Sesssion.

```python
@schema
class Session(dj.Manual):
    definition = """
    # Experiment session
    -> Subject
    sample_number              : int                          # sample number
    session_date               : date                         # date of session in YYYY-MM-DD format
    ---
    stimulations               : longblob                     # list of dicts for stimulations
    """
```

#### Visualize schema

```python
dj.Diagram(schema)
```

    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)

```python
Session()
```

Experiment session

subject_name

sample_number

                        sample number

session_date

                        date of session in YYYY-MM-DD format

stimulations

                        list of dicts for stimulations

Total: 0

```python
Session.insert(data, skip_duplicates=True)
```

```python
Session()
```

    Experiment session

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stimulations

                            list of dicts for stimulations

 KO (chx10)
1
2008-06-06
=BLOB=

KO (chx10)
2
2008-06-06
=BLOB=

KO (chx10)
2
2008-06-24
=BLOB=

KO (chx10)
3
2008-06-06
=BLOB=

KO (chx10)
3
2008-06-24
=BLOB=

KO (chx10)
4
2008-07-02
=BLOB=

KO (pax6)
1
2008-05-16
=BLOB=

KO (pax6)
2
2008-05-16
=BLOB=

KO (pax6)
2
2008-06-28
=BLOB=

KO (pax6)
3
2008-06-28
=BLOB=

KO bax -/- (chx10)
1
2008-07-02
=BLOB=

WT (chx10 het)
1
2008-06-24
=BLOB=

...

Total: 16

#### Stimulations Table

The stimulations will each be stored as a `dj.Computed` table that is dependent on a given `Session`. We use the `dj.Computed` table tier because the imported data comes from the provided pickle file, whose contents are stored in our database.

**Note:** One Session can have zero or more stimulations

```python
@schema
class Stimulations(dj.Computed):
    definition = """
    -> Session
    stim_id:           int
    ---
    fps=0:             float         # frames per second of movie
    movie=null:        longblob      # numpy array of movie stimulus shaped as (horiz blocks, vert blocks, frames)
    n_frames:          int           # integer number of frames
    pixel_size=0:      float         # pixel size on retina in um/pixel
    stim_height=0:     int           # height of stimulus in pixels
    stim_width=0:      int           # width of the stimulus in pixels
    stimulus_onset=0:  float         # onset of stimulus in seconds from start of recording
    x_block_size=0:    int           # size of horizontal blocks in pixels
    y_block_size=0:    int           # size of vertical blocks in pixels
    spikes=null:       longblob      # list of spike times for recorded neurons, each element is np.ndarray()
    """
    def make(self, key):
        # load stimulations for a given key as a list
        stims = (Session() & key).fetch1('stimulations')

        print('Populating stimulation(s) for subject_name={subject_name}, sample_number={sample_number} on session_date={session_date}'.format(**key))

        for idx, item in enumerate(stims):
            key['stim_id'] = idx
            key['fps'] = item['fps']
            key['n_frames'] = item['n_frames']
            key['movie'] = item['movie']
            key['pixel_size'] = item['pixel_size']
            key['stim_height'] = item['stim_height']
            key['stim_width'] = item['stim_width']
            key['stimulus_onset'] = item['stimulus_onset']
            key['x_block_size'] = item['x_block_size']
            key['y_block_size'] = item['y_block_size']
            key['spikes'] = item['spikes']

            # Insert key into self
            self.insert1(key)

            print('\tPopulated stimulation {stim_id}'.format(**key))
```

```python
Stimulations.populate()
```

    Populating stimulation(s) for subject_name=KO (chx10), sample_number=1 on session_date=2008-06-06
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (chx10), sample_number=2 on session_date=2008-06-06
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (chx10), sample_number=2 on session_date=2008-06-24
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (chx10), sample_number=3 on session_date=2008-06-06
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (chx10), sample_number=3 on session_date=2008-06-24
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (chx10), sample_number=4 on session_date=2008-07-02
    	Populated stimulation 0
    	Populated stimulation 1
    Populating stimulation(s) for subject_name=KO (pax6), sample_number=1 on session_date=2008-05-16
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (pax6), sample_number=2 on session_date=2008-05-16
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=KO (pax6), sample_number=2 on session_date=2008-06-28
    Populating stimulation(s) for subject_name=KO (pax6), sample_number=3 on session_date=2008-06-28
    Populating stimulation(s) for subject_name=KO bax -/- (chx10), sample_number=1 on session_date=2008-07-02
    Populating stimulation(s) for subject_name=WT (chx10 het), sample_number=1 on session_date=2008-06-24
    	Populated stimulation 0
    Populating stimulation(s) for subject_name=WT (chx10 het), sample_number=4 on session_date=2008-06-28
    Populating stimulation(s) for subject_name=WT (chx10 het), sample_number=5 on session_date=2008-06-28
    Populating stimulation(s) for subject_name=WT (pax6 het), sample_number=6 on session_date=2008-06-28
    Populating stimulation(s) for subject_name=WT (pax6 het), sample_number=7 on session_date=2008-06-28

```python
Stimulations()
```

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stim_id

fps

                            frames per second of movie

movie

                            numpy array of movie stimulus shaped as (horiz blocks, vert blocks, frames)

n_frames

                            integer number of frames

pixel_size

                            pixel size on retina in um/pixel

stim_height

                            height of stimulus in pixels

stim_width

                            width of the stimulus in pixels

stimulus_onset

                            onset of stimulus in seconds from start of recording

x_block_size

                            size of horizontal blocks in pixels

y_block_size

                            size of vertical blocks in pixels

spikes

                            list of spike times for recorded neurons, each element is np.ndarray()

 KO (chx10)
1
2008-06-06
0
59.9815
=BLOB=
3823
8.3
480
640
1.65657
1
480
=BLOB=

KO (chx10)
2
2008-06-06
0
59.9815
=BLOB=
4377
8.3
480
640
1.77267
640
1
=BLOB=

KO (chx10)
2
2008-06-24
0
59.9815
=BLOB=
4125
8.3
300
640
1.22127
10
10
=BLOB=

KO (chx10)
3
2008-06-06
0
59.9815
=BLOB=
4241
8.3
480
640
1.00227
10
10
=BLOB=

KO (chx10)
3
2008-06-24
0
59.9816
=BLOB=
4348
8.3
480
640
1.05317
5
480
=BLOB=

KO (chx10)
4
2008-07-02
0
60.005
=BLOB=
4156
8.3
480
640
1.3066
2
480
=BLOB=

KO (chx10)
4
2008-07-02
1
29.9908
=BLOB=
3854
8.3
320
640
1.2634
8
8
=BLOB=

KO (pax6)
1
2008-05-16
0
59.9816
=BLOB=
4325
8.3
480
640
1.2488
10
10
=BLOB=

KO (pax6)
2
2008-05-16
0
59.9816
=BLOB=
4331
8.3
480
640
1.0617
1
480
=BLOB=

WT (chx10 het)
1
2008-06-24
0
59.9815
=BLOB=
3938
8.3
480
640
6.65177
640
2
=BLOB=

Total: 10

```python
dj.Diagram(schema)
```

    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)

### Spike trains table

The next entity we care about are the spike trains associated with Stimulation. We can use another `dj.Computed` table here.

Each stimulation's `spikes` attribute contains a list of numpy arrays for the spike times (in seconds) for each neuron, of which there can be one or more.

**Note:** The spike times are from the start of data recording, so we want to subtract the `stimulus_onset` attribute from all the spike times to get the spike times after the stimulus.

```python
keys = Stimulations.fetch('KEY')
```

```python
(Stimulations() & keys[2]).fetch1('spikes')[25].reshape(-1) - (Stimulations() & keys[2]).fetch1('stimulus_onset')
```

    array([ 0.14363,  0.40973,  0.41673,  0.42453,  0.43683,  0.47323,
            1.81403, 24.24853, 30.38023, 35.30763, 35.31733, 35.33163,
           41.05963, 42.10843, 42.11673, 42.13593, 45.36173, 45.37083,
           45.40223, 56.59663, 56.60973, 56.62823, 67.61533, 67.62493,
           67.63453])

The above is just an example of what some adjusted spike times look like (corrected for movie stimulus onset) for neuron 25 of a particular stimulation experiment.

```python
(Stimulations() & keys[2]).fetch1('movie').shape
```

    (64, 30, 4125)

```python
@schema
class SpikeTrain(dj.Computed):
    definition = """
    -> Stimulations
    neuron_id:           int
    ---
    spike_times=null:    longblob      # numpy array of spike times AFTER stimulus onset
    """
    def make(self, key):
        # load stimulations for a given key as a list
        spike_trains = (Stimulations() & key).fetch1('spikes')

        print('Populating spike train(s) for subject_name={subject_name}, sample_number={sample_number} on session_date={session_date} for stim_id={stim_id}'.format(**key))

        for idx, item in enumerate(spike_trains):
            key['neuron_id'] = idx

            # subtract onset time from spike times to see the spike times in relation to the stimulus
            key['spike_times'] = item.reshape(-1,) - (Stimulations() & key).fetch1('stimulus_onset')

            # Insert key into self
            self.insert1(key)

            print('\tPopulated spike times for neuron {neuron_id}'.format(**key))
```

```python
SpikeTrain.populate()
```

    Populating spike train(s) for subject_name=KO (chx10), sample_number=1 on session_date=2008-06-06 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    Populating spike train(s) for subject_name=KO (chx10), sample_number=2 on session_date=2008-06-06 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    Populating spike train(s) for subject_name=KO (chx10), sample_number=2 on session_date=2008-06-24 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    	Populated spike times for neuron 12
    	Populated spike times for neuron 13
    	Populated spike times for neuron 14
    	Populated spike times for neuron 15
    	Populated spike times for neuron 16
    	Populated spike times for neuron 17
    	Populated spike times for neuron 18
    	Populated spike times for neuron 19
    	Populated spike times for neuron 20
    	Populated spike times for neuron 21
    	Populated spike times for neuron 22
    	Populated spike times for neuron 23
    	Populated spike times for neuron 24
    	Populated spike times for neuron 25
    Populating spike train(s) for subject_name=KO (chx10), sample_number=3 on session_date=2008-06-06 for stim_id=0
    	Populated spike times for neuron 0
    Populating spike train(s) for subject_name=KO (chx10), sample_number=3 on session_date=2008-06-24 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    	Populated spike times for neuron 12
    	Populated spike times for neuron 13
    	Populated spike times for neuron 14
    	Populated spike times for neuron 15
    	Populated spike times for neuron 16
    	Populated spike times for neuron 17
    	Populated spike times for neuron 18
    	Populated spike times for neuron 19
    	Populated spike times for neuron 20
    	Populated spike times for neuron 21
    	Populated spike times for neuron 22
    	Populated spike times for neuron 23
    	Populated spike times for neuron 24
    	Populated spike times for neuron 25
    	Populated spike times for neuron 26
    	Populated spike times for neuron 27
    	Populated spike times for neuron 28
    	Populated spike times for neuron 29
    	Populated spike times for neuron 30
    	Populated spike times for neuron 31
    	Populated spike times for neuron 32
    	Populated spike times for neuron 33
    	Populated spike times for neuron 34
    	Populated spike times for neuron 35
    	Populated spike times for neuron 36
    	Populated spike times for neuron 37
    Populating spike train(s) for subject_name=KO (chx10), sample_number=4 on session_date=2008-07-02 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    Populating spike train(s) for subject_name=KO (chx10), sample_number=4 on session_date=2008-07-02 for stim_id=1
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    Populating spike train(s) for subject_name=KO (pax6), sample_number=1 on session_date=2008-05-16 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    Populating spike train(s) for subject_name=KO (pax6), sample_number=2 on session_date=2008-05-16 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    	Populated spike times for neuron 12
    	Populated spike times for neuron 13
    	Populated spike times for neuron 14
    	Populated spike times for neuron 15
    	Populated spike times for neuron 16
    	Populated spike times for neuron 17
    	Populated spike times for neuron 18
    	Populated spike times for neuron 19
    	Populated spike times for neuron 20
    	Populated spike times for neuron 21
    	Populated spike times for neuron 22
    	Populated spike times for neuron 23
    	Populated spike times for neuron 24
    	Populated spike times for neuron 25
    	Populated spike times for neuron 26
    	Populated spike times for neuron 27
    	Populated spike times for neuron 28
    	Populated spike times for neuron 29
    	Populated spike times for neuron 30
    	Populated spike times for neuron 31
    	Populated spike times for neuron 32
    	Populated spike times for neuron 33
    Populating spike train(s) for subject_name=WT (chx10 het), sample_number=1 on session_date=2008-06-24 for stim_id=0
    	Populated spike times for neuron 0
    	Populated spike times for neuron 1
    	Populated spike times for neuron 2
    	Populated spike times for neuron 3
    	Populated spike times for neuron 4
    	Populated spike times for neuron 5
    	Populated spike times for neuron 6
    	Populated spike times for neuron 7
    	Populated spike times for neuron 8
    	Populated spike times for neuron 9
    	Populated spike times for neuron 10
    	Populated spike times for neuron 11
    	Populated spike times for neuron 12
    	Populated spike times for neuron 13
    	Populated spike times for neuron 14
    	Populated spike times for neuron 15
    	Populated spike times for neuron 16
    	Populated spike times for neuron 17
    	Populated spike times for neuron 18
    	Populated spike times for neuron 19
    	Populated spike times for neuron 20
    	Populated spike times for neuron 21
    	Populated spike times for neuron 22
    	Populated spike times for neuron 23
    	Populated spike times for neuron 24
    	Populated spike times for neuron 25
    	Populated spike times for neuron 26
    	Populated spike times for neuron 27
    	Populated spike times for neuron 28
    	Populated spike times for neuron 29
    	Populated spike times for neuron 30
    	Populated spike times for neuron 31
    	Populated spike times for neuron 32
    	Populated spike times for neuron 33
    	Populated spike times for neuron 34
    	Populated spike times for neuron 35
    	Populated spike times for neuron 36

```python
SpikeTrain()
```

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stim_id

neuron_id

spike_times

                            numpy array of spike times AFTER stimulus onset

 KO (chx10)
1
2008-06-06
0
0
=BLOB=

KO (chx10)
1
2008-06-06
0
1
=BLOB=

KO (chx10)
1
2008-06-06
0
2
=BLOB=

KO (chx10)
1
2008-06-06
0
3
=BLOB=

KO (chx10)
2
2008-06-06
0
0
=BLOB=

KO (chx10)
2
2008-06-06
0
1
=BLOB=

KO (chx10)
2
2008-06-06
0
2
=BLOB=

KO (chx10)
2
2008-06-06
0
3
=BLOB=

KO (chx10)
2
2008-06-06
0
4
=BLOB=

KO (chx10)
2
2008-06-06
0
5
=BLOB=

KO (chx10)
2
2008-06-24
0
0
=BLOB=

KO (chx10)
2
2008-06-24
0
1
=BLOB=

...

Total: 177

We have $10$ **stimulations** total for our subjects, and $177$ **total neurons** that were stimulated with spike train arrays in this data set.

```python
dj.Diagram(schema)
```

    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)

This concludes **Part 1**.

### Part (2) of the challenge - Compute Spatio-Temporal Receptive Fields (STRF)

In order to compute the STRF, we need to make use of the other attributes in the `Stimulations()` table.

```python
Stimulations()
```

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stim_id

fps

                            frames per second of movie

movie

                            numpy array of movie stimulus shaped as (horiz blocks, vert blocks, frames)

n_frames

                            integer number of frames

pixel_size

                            pixel size on retina in um/pixel

stim_height

                            height of stimulus in pixels

stim_width

                            width of the stimulus in pixels

stimulus_onset

                            onset of stimulus in seconds from start of recording

x_block_size

                            size of horizontal blocks in pixels

y_block_size

                            size of vertical blocks in pixels

spikes

                            list of spike times for recorded neurons, each element is np.ndarray()

 KO (chx10)
1
2008-06-06
0
59.9815
=BLOB=
3823
8.3
480
640
1.65657
1
480
=BLOB=

KO (chx10)
2
2008-06-06
0
59.9815
=BLOB=
4377
8.3
480
640
1.77267
640
1
=BLOB=

KO (chx10)
2
2008-06-24
0
59.9815
=BLOB=
4125
8.3
300
640
1.22127
10
10
=BLOB=

KO (chx10)
3
2008-06-06
0
59.9815
=BLOB=
4241
8.3
480
640
1.00227
10
10
=BLOB=

KO (chx10)
3
2008-06-24
0
59.9816
=BLOB=
4348
8.3
480
640
1.05317
5
480
=BLOB=

KO (chx10)
4
2008-07-02
0
60.005
=BLOB=
4156
8.3
480
640
1.3066
2
480
=BLOB=

KO (chx10)
4
2008-07-02
1
29.9908
=BLOB=
3854
8.3
320
640
1.2634
8
8
=BLOB=

KO (pax6)
1
2008-05-16
0
59.9816
=BLOB=
4325
8.3
480
640
1.2488
10
10
=BLOB=

KO (pax6)
2
2008-05-16
0
59.9816
=BLOB=
4331
8.3
480
640
1.0617
1
480
=BLOB=

WT (chx10 het)
1
2008-06-24
0
59.9815
=BLOB=
3938
8.3
480
640
6.65177
640
2
=BLOB=

Total: 10

The computations will then all be done on each `spike_times` entry in `SpikeTrain()`.

```python
SpikeTrain()
```

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stim_id

neuron_id

spike_times

                            numpy array of spike times AFTER stimulus onset

 KO (chx10)
1
2008-06-06
0
0
=BLOB=

KO (chx10)
1
2008-06-06
0
1
=BLOB=

KO (chx10)
1
2008-06-06
0
2
=BLOB=

KO (chx10)
1
2008-06-06
0
3
=BLOB=

KO (chx10)
2
2008-06-06
0
0
=BLOB=

KO (chx10)
2
2008-06-06
0
1
=BLOB=

KO (chx10)
2
2008-06-06
0
2
=BLOB=

KO (chx10)
2
2008-06-06
0
3
=BLOB=

KO (chx10)
2
2008-06-06
0
4
=BLOB=

KO (chx10)
2
2008-06-06
0
5
=BLOB=

KO (chx10)
2
2008-06-24
0
0
=BLOB=

KO (chx10)
2
2008-06-24
0
1
=BLOB=

...

Total: 177

The **Spike-triggered Average (STA)** is defined (on Wikipedia) as:
> Mathematically, the STA is the average stimulus preceding a spike. To compute the STA, the stimulus in the time window preceding each spike is extracted, and the resulting (spike-triggered) stimuli are averaged.

In our case, we are told our stimulus vector for the $i$'th time bin, $\mathbf{x_i}$, is *white noise* , so the Standard STA definition on Wikipedia should do.

This is:

\begin{equation}
    \mathrm{STA} = \frac{1}{n_{sp}} \sum_{i=1}^{T}{y_i \mathbf{x_i}},
\end{equation}
where $T$ is the total number of time bins, $y_i$ is the number of spikes in bin $i$, and $n_{sp} = \sum y_i$ is the total number of spikes.

In matrix form, we can let the rows of a matrix $X$ be equal to $\mathbf{x_i}^T$ and a column vector $\mathbf{y}$ whose $i$'th element can be equal to $y_i$. Then we have

\begin{equation}
    \mathrm{STA} = \frac{1}{n_{sp}} X^T \mathbf{y}
\end{equation}

In order to do this for our experiment, we need to determine a time bin/window size for each recording, which we can do with some trial and error for now.

We have to consider the following in our experiment:
 * Time bin window size in seconds (a parameter we can set with a `Lookup` table)
 * Segment of the movie to match this time in seconds to determine the size of $\mathbf{x_i}$.
   * We may need to use the `n_frames`, `framerate`, `x_block_size`, `y_block_size`, and the `movie` array to determine these
 * Count the number of spikes in each time bin and total number of spikes to determine $y_i$ and $n_{sp}$

#### UPDATE: STRF Computation

This was not a part of my initial submission, but I have subsequently better understood what the STRF is and how it is computed.

We are able to compute the STA for a given neuron using the formulation above. For a given window of stimulus $\mathbf{x_i}$, we can define the STRF computation as follows:

\begin{equation}
    \mathrm{STRF}_{\tau_j} = \frac{1}{n_{sp}} \sum_{i=1}^{T}{y_{i + \tau_j} \mathbf{x_i}}, \quad j = 1, \ldots, K,
\end{equation}

Where $\tau_1, \ldots , \tau_K$ represent various delays in number of bins.

We can say that the STRF is the STA computed to view the neuronal response for a stimulus $\mathbf{x_i}$ at $K$ different time bins following that stimulus

### Just playing around trying to understand how to compute STA with a single example with a fixed window size

```python
def count_spikes_in_bin(times, spikes):
    start = times[0]
    stop = times[-1]
    mask = np.logical_and(spikes >= start, spikes < stop)
    return len(spikes[mask])
```

Look at a random example:

```python
keys = SpikeTrain.fetch('KEY')

window_size = 15

movie = (Stimulations() & keys[2]).fetch1('movie')
movie_dims = movie.shape

n_fr = movie_dims[2]

fr = (Stimulations() & keys[2]).fetch1('fps')

x_size = (Stimulations() & keys[2]).fetch1('x_block_size')
x_dim = (Stimulations() & keys[2]).fetch1('stim_width')

y_size = (Stimulations() & keys[2]).fetch1('y_block_size')
y_dim = (Stimulations() & keys[2]).fetch1('stim_height')

print(f'Movie has dimensions {movie_dims}')
print(f'FPS is {fr}')
print(f'Video dimensions are {x_dim} x {y_dim} with {movie_dims[2]} frames')
print(f'x_block_size is {x_size}')
print(f'y_block_size is {y_size}')

```

    Movie has dimensions (640, 1, 3823)
    FPS is 59.9815
    Video dimensions are 640 x 480 with 3823 frames
    x_block_size is 1
    y_block_size is 480

We want to:
 * Create each $\mathbf{x_i}$ as a window of a particular size (15 frames here) of the movie.
   * In this example, each $\mathbf{x_i}$ should have dimensions (640, 1, 15)
   * Windowed movie array should now have dimenions (640, 1, 255, 15), where 255 is the number of bins in this example

```python
# Padding so I can reshape the index mask to the correct size given a particular frame count.
num_to_pad = window_size - n_fr % window_size  # maximum value padding amount
mask_indices = np.pad(np.arange(n_fr), (0, num_to_pad), mode='maximum').reshape(-1, window_size)

spikes = (SpikeTrain() & keys[2]).fetch1('spike_times')

# create array of frame times
times = np.arange(0, n_fr) / fr

fr_times_windows = times[mask_indices]

spike_counts = np.apply_along_axis(lambda x: count_spikes_in_bin(x, spikes), axis=1, arr=fr_times_windows)

print(f'We have {fr_times_windows.shape[0]} bins of size {fr_times_windows.shape[1]}')
print('Sum of spike counts across all bins:', np.sum(spike_counts))
print('Length of original spike train array:', len(spikes))
```

    We have 255 bins of size 15
    Sum of spike counts across all bins: 157
    Length of original spike train array: 168

It looks like some spikes are being missed by my method, but the number gets closer as the window size increases based on trial/error experimentation.

```python
mask_indices
```

    array([[   0,    1,    2, ...,   12,   13,   14],
           [  15,   16,   17, ...,   27,   28,   29],
           [  30,   31,   32, ...,   42,   43,   44],
           ...,
           [3780, 3781, 3782, ..., 3792, 3793, 3794],
           [3795, 3796, 3797, ..., 3807, 3808, 3809],
           [3810, 3811, 3812, ..., 3822, 3822, 3822]])

```python
windowed_movie = movie[:, :, mask_indices]

windowed_movie[:, :, 0].shape
```

    (640, 1, 15)

### Intuition
Above we see the shape for the first window of 15 frames. This is essentially the first stimulus bin $\mathbf{x_0}$, and the next row would be $\mathbf{x_1}$, etc.

Compute an average stimulus

```python
average_movie = np.mean(windowed_movie, axis=3)
```

```python
average_movie.shape
```

    (640, 1, 255)

This is the average movie stimulus for each of the 255 bins, i.e. $\mathbf{x_1}$ to $\mathbf{x_{255}}$

```python
(average_movie @ spike_counts / np.sum(spike_counts)).shape
```

    (640, 1)

I believe this is the **STA for a given neuron** with a defined window size and **no delay, $\tau = 0$**.

We can **shift** the $y_i$ array of spike counts and repeat to get the STA when the neuronal output is delayed by $\tau$ bins.

Need to reshape to actual image size using block size for visualizing.

```python
tau = 3
shifted_counts = np.roll(spike_counts, -1 * tau)
shifted_counts[-1 * tau:] = 0

print(spike_counts)
print('\n')
print(shifted_counts)
```

    [4 4 1 4 1 4 0 2 2 2 3 1 0 4 1 3 1 0 2 0 1 2 1 0 2 2 1 1 1 2 1 1 1 1 2 0 1
     2 1 1 1 0 0 1 2 0 2 0 1 0 0 1 0 1 2 0 0 1 0 0 2 2 0 1 0 0 0 2 1 0 1 2 0 1
     1 0 0 1 0 0 1 0 0 0 0 1 0 2 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 1 3 0 0 1 0 1
     0 1 0 0 1 0 0 2 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 3 0 1 0 2 1 0 0
     0 2 0 1 0 2 1 0 0 0 0 0 0 0 0 0 0 0 2 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0
     0 0 1 0 0 0 2 0 1 0 1 0 0 0 4 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0
     0 0 2 0 0 2 0 0 0 0 0 0 0 1 0 1 0 2 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0]

    [4 1 4 0 2 2 2 3 1 0 4 1 3 1 0 2 0 1 2 1 0 2 2 1 1 1 2 1 1 1 1 2 0 1 2 1 1
     1 0 0 1 2 0 2 0 1 0 0 1 0 1 2 0 0 1 0 0 2 2 0 1 0 0 0 2 1 0 1 2 0 1 1 0 0
     1 0 0 1 0 0 0 0 1 0 2 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 1 3 0 0 1 0 1 0 1 0
     0 1 0 0 2 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 3 0 1 0 2 1 0 0 0 2 0
     1 0 2 1 0 0 0 0 0 0 0 0 0 0 0 2 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 0 1 0 0 0 1
     0 0 0 2 0 1 0 1 0 0 0 4 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 2
     0 0 2 0 0 0 0 0 0 0 1 0 1 0 2 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0]

### Back to defining schema

```python
# Define lookup table for STA parameters
@schema
class STRF_Param(dj.Lookup):
    definition = """
    strf_param_id:          int                # unique id for STRF parameter set
    ---
    bin_size=1:             float              # time window bin size in seconds
    tau=1:                  int                # of bins to jump for each consecutive delay
    """
```

```python
# Try lots of window sizes in seconds
STRF_Param.insert([(0, 1, 5)
                  ],
                 )
```

```python
STRF_Param.insert([(1, 0.5, 10),
                   (2, 2.0, 2)
                  ],
                 )
```

```python
STRF_Param()
```

strf_param_id

                            unique id for STRF parameter set

bin_size

                            time window bin size in seconds

tau

                            of bins to jump for each consecutive delay

 0
1.0
5

1
0.5
10

2
2.0
2

Total: 3

```python
@schema
class STRF_Compute(dj.Computed):
    definition = """
    -> SpikeTrain
    -> STRF_Param
    ---
    n_spikes = null:          longblob     # array for number of spikes in each bin
    srtf_values = null:       longblob    # STA at each time delay
    """

    def make(self, key):
        window_seconds = (STRF_Param() & key).fetch1('bin_size')  # window/bin size in seconds
        tau = (STRF_Param() & key).fetch1('tau')  # incremental number of bins to delay

        # Next, we want to slide window over movie and spike train

        # Start by extracting the relevant parameters
        x_blocks = (Stimulations() & key).fetch1('x_block_size')
        y_blocks = (Stimulations() & key).fetch1('y_block_size')
        fr = (Stimulations() & key).fetch1('fps')
        n_fr = (Stimulations() & key).fetch1('n_frames')
        x_dim = (Stimulations() & key).fetch1('stim_width')
        y_dim = (Stimulations() & key).fetch1('stim_height')
        spikes = (SpikeTrain() & key).fetch1('spike_times')
        movie = (Stimulations() & key).fetch1('movie')

        # create a frame time array (which is found by dividing frame_number / framerate)
        frames = np.arange(0, n_fr)
        fr_times = frames / fr

        # Create sliding window mask for looking at subarrays of this fr_times array
        # compute best window size:
        window_size = round(window_seconds * fr)

        # Padding so I can reshape the index mask to the correct size given a particular frame count.
        num_to_pad = window_size - n_fr % window_size  # maximum value padding amount
        mask_indices = np.pad(np.arange(n_fr), (0, num_to_pad), mode='maximum').reshape(-1, window_size)

        # mask frame times with sliding windows as rows
        fr_times_windows = fr_times[mask_indices]

        # Create spike_counts array, which is essentially the vector y in the definition above (spike counts for each bin)
        # Should replace this with a vectorized function, but I was running into some error that I can debug later to optimize, since this is slow.
        print('Populating spike counts for subject {subject_name}, sample {sample_number} on {session_date} with stim_id={stim_id} for neuron {neuron_id}'.format(**key))
        spike_counts = np.apply_along_axis(lambda x: count_spikes_in_bin(x, spikes), axis=1, arr=fr_times_windows)
        tot_spikes = np.sum(spike_counts)
        print(f'\tFound {tot_spikes} total spikes with window size of {window_seconds} seconds.')

        key['n_spikes'] = spike_counts

        # Compute STA for each of the windows with delays incrementing by tau bins
        windowed_movie = movie[:, :, mask_indices]
        average_movie = np.mean(windowed_movie, axis=3)

        shifted_spike_counts = spike_counts.copy()

        # Do initial case with no delay
        sta_0 = ((average_movie @ spike_counts) / tot_spikes)
        sta_0 = np.repeat(sta_0, repeats=x_blocks, axis=0)
        sta_0 = np.repeat(sta_0, repeats=y_blocks, axis=1)

        srtf = [(0, sta_0)]

        for t in range(tau, len(spike_counts), tau):
            shifted_spike_counts = np.roll(shifted_spike_counts, -1 * t)
            shifted_spike_counts[-t:] = 0  # set end of array by shift amount to 0

            if np.max(shifted_spike_counts) == 0:
                break

            sta_t = ((average_movie @ shifted_spike_counts) / tot_spikes)

            # probably not efficient for storage but doing this temporarily to see if it works
            sta_t = np.repeat(sta_t, repeats=x_blocks, axis=0)
            sta_t = np.repeat(sta_t, repeats=y_blocks, axis=1)

            srtf.append((t, sta_t))

        key['srtf_values'] = srtf

        self.insert1(key)
```

```python
dj.Diagram(schema)
```

    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Float64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)
    /home/rohit/miniconda3/envs/datajoint_interview/lib/python3.8/inspect.py:350: FutureWarning: pandas.UInt64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
      value = getattr(object, key)

```python
STRF_Compute.populate()
```

    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 157 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 161 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 769 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 746 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 759 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 538 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 528 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 537 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 724 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 711 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 719 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 374 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 363 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 370 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 1588 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 1541 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 1572 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 673 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 660 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 669 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 1103 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 1069 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 1093 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 25 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 25 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 2 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 25 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-06 with stim_id=0 for neuron 0
    	Found 473 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-06 with stim_id=0 for neuron 0
    	Found 459 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-06 with stim_id=0 for neuron 0
    	Found 470 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 143 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 140 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 142 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 88 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 85 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 87 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 70 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 67 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 68 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 357 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 346 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 354 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 296 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 291 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 295 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 852 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 831 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 848 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 450 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 436 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 445 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 163 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 162 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 163 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 167 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 160 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 166 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 212 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 208 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 210 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 257 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 255 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 256 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 102 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 99 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 102 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 288 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 278 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 281 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 206 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 205 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 206 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 198 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 194 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 195 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 251 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 247 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 250 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 160 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 155 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 157 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 239 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 235 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 237 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 665 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 641 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 656 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 157 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 154 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 156 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 89 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 88 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 88 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 166 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 161 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 165 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 135 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 131 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 135 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 298 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 291 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 294 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 36 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 36 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 36 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 132 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 128 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 132 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 35 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 34 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 35 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 18 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 18 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 18 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 42 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 42 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 42 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 220 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 217 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 220 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 147 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 142 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 145 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 33 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 32 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 33 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 63 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 63 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 63 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 107 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 106 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 107 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 96 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 95 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 96 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 190 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 185 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 187 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 210 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 202 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 208 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 37
    	Found 39 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 37
    	Found 39 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 3 on 2008-06-24 with stim_id=0 for neuron 37
    	Found 39 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 0
    	Found 223 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 0
    	Found 222 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 0
    	Found 223 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 1
    	Found 536 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 1
    	Found 515 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 1
    	Found 530 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 2
    	Found 425 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 2
    	Found 411 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 2
    	Found 422 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 3
    	Found 523 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 3
    	Found 504 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 3
    	Found 518 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 4
    	Found 823 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 4
    	Found 808 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 4
    	Found 815 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 5
    	Found 37 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 5
    	Found 37 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 5
    	Found 37 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 6
    	Found 57 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 6
    	Found 56 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 6
    	Found 57 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 7
    	Found 25 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 7
    	Found 25 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 7
    	Found 25 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 8
    	Found 2086 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 8
    	Found 2026 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 8
    	Found 2068 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 9
    	Found 72 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 9
    	Found 72 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 9
    	Found 72 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 10
    	Found 181 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 10
    	Found 178 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 10
    	Found 181 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 11
    	Found 436 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 11
    	Found 429 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=0 for neuron 11
    	Found 433 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 0
    	Found 1223 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 0
    	Found 1160 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 0
    	Found 1205 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 1
    	Found 1608 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 1
    	Found 1513 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 1
    	Found 1583 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 2
    	Found 1555 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 2
    	Found 1473 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 2
    	Found 1520 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 3
    	Found 1443 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 3
    	Found 1364 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 3
    	Found 1422 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 4
    	Found 2017 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 4
    	Found 1920 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 4
    	Found 1981 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 5
    	Found 449 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 5
    	Found 416 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 5
    	Found 438 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 6
    	Found 729 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 6
    	Found 696 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 6
    	Found 717 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 7
    	Found 267 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 7
    	Found 256 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 7
    	Found 265 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 8
    	Found 1580 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 8
    	Found 1493 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 8
    	Found 1554 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 9
    	Found 737 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 9
    	Found 695 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 9
    	Found 728 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 10
    	Found 1565 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 10
    	Found 1474 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 10
    	Found 1537 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 11
    	Found 3001 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 11
    	Found 2860 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (chx10), sample 4 on 2008-07-02 with stim_id=1 for neuron 11
    	Found 2956 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 2093 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 2032 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 2074 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 432 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 425 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 430 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 1522 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 1484 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 1510 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 845 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 826 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 837 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 1326 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 1293 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 1320 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 253 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 243 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 248 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 1010 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 982 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 1 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 1001 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 326 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 320 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 0
    	Found 325 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 427 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 413 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 1
    	Found 420 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 361 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 356 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 2
    	Found 360 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 810 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 794 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 3
    	Found 808 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 69 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 69 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 4
    	Found 69 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 173 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 169 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 5
    	Found 172 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 89 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 87 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 6
    	Found 89 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 7
    	Found 251 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 7
    	Found 247 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 7
    	Found 249 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 8
    	Found 146 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 8
    	Found 143 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 8
    	Found 146 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 9
    	Found 692 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 9
    	Found 681 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 9
    	Found 687 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 10
    	Found 179 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 10
    	Found 174 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 10
    	Found 179 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 11
    	Found 336 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 11
    	Found 332 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 11
    	Found 334 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 12
    	Found 261 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 12
    	Found 254 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 12
    	Found 259 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 13
    	Found 209 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 13
    	Found 203 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 13
    	Found 207 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 14
    	Found 68 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 14
    	Found 63 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 14
    	Found 68 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 15
    	Found 286 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 15
    	Found 280 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 15
    	Found 284 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 16
    	Found 267 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 16
    	Found 256 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 16
    	Found 263 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 17
    	Found 140 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 17
    	Found 136 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 17
    	Found 138 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 18
    	Found 222 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 18
    	Found 216 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 18
    	Found 220 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 19
    	Found 75 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 19
    	Found 73 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 19
    	Found 73 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 20
    	Found 2 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 20
    	Found 2 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 20
    	Found 2 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 21
    	Found 195 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 21
    	Found 193 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 21
    	Found 194 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 22
    	Found 710 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 22
    	Found 696 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 22
    	Found 705 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 23
    	Found 966 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 23
    	Found 941 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 23
    	Found 958 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 24
    	Found 585 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 24
    	Found 571 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 24
    	Found 578 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 25
    	Found 139 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 25
    	Found 135 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 25
    	Found 137 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 26
    	Found 593 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 26
    	Found 583 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 26
    	Found 585 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 27
    	Found 1659 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 27
    	Found 1620 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 27
    	Found 1646 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 28
    	Found 24 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 28
    	Found 23 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 28
    	Found 24 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 29
    	Found 993 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 29
    	Found 974 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 29
    	Found 989 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 30
    	Found 800 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 30
    	Found 778 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 30
    	Found 791 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 31
    	Found 359 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 31
    	Found 345 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 31
    	Found 359 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 32
    	Found 2058 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 32
    	Found 2009 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 32
    	Found 2042 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 33
    	Found 500 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 33
    	Found 486 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject KO (pax6), sample 2 on 2008-05-16 with stim_id=0 for neuron 33
    	Found 496 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 608 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 593 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 0
    	Found 603 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 1638 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 1601 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 1
    	Found 1626 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 261 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 254 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 2
    	Found 259 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 1244 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 1222 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 3
    	Found 1235 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 488 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 478 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 4
    	Found 485 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 776 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 752 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 5
    	Found 765 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 1259 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 1233 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 6
    	Found 1250 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 0 total spikes with window size of 2.0 seconds.

    /tmp/ipykernel_405861/4009491522.py:60: RuntimeWarning: invalid value encountered in true_divide
      sta_0 = ((average_movie @ spike_counts) / tot_spikes)

    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 0 total spikes with window size of 0.5 seconds.

    /tmp/ipykernel_405861/4009491522.py:60: RuntimeWarning: invalid value encountered in true_divide
      sta_0 = ((average_movie @ spike_counts) / tot_spikes)

    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 7
    	Found 0 total spikes with window size of 1.0 seconds.

    /tmp/ipykernel_405861/4009491522.py:60: RuntimeWarning: invalid value encountered in true_divide
      sta_0 = ((average_movie @ spike_counts) / tot_spikes)

    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 1652 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 1609 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 8
    	Found 1636 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 793 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 774 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 9
    	Found 788 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 1476 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 1442 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 10
    	Found 1466 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 51 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 51 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 11
    	Found 51 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 728 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 705 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 12
    	Found 722 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 1439 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 1406 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 13
    	Found 1431 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 85 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 85 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 14
    	Found 85 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 104 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 102 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 15
    	Found 103 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 1457 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 1425 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 16
    	Found 1446 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 602 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 586 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 17
    	Found 599 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 1306 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 1266 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 18
    	Found 1293 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 195 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 195 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 19
    	Found 195 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 703 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 686 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 20
    	Found 699 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 778 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 757 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 21
    	Found 771 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 519 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 505 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 22
    	Found 513 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 564 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 541 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 23
    	Found 550 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 1021 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 999 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 24
    	Found 1014 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 350 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 346 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 25
    	Found 349 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 678 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 667 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 26
    	Found 671 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 1931 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 1883 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 27
    	Found 1913 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 325 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 317 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 28
    	Found 319 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 953 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 925 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 29
    	Found 938 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 717 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 698 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 30
    	Found 713 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 727 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 705 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 31
    	Found 720 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 269 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 262 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 32
    	Found 267 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 1054 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 1032 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 33
    	Found 1049 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 440 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 431 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 34
    	Found 438 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 177 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 174 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 35
    	Found 175 total spikes with window size of 1.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 987 total spikes with window size of 2.0 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 970 total spikes with window size of 0.5 seconds.
    Populating spike counts for subject WT (chx10 het), sample 1 on 2008-06-24 with stim_id=0 for neuron 36
    	Found 978 total spikes with window size of 1.0 seconds.

```python
STRF_Compute()
```

subject_name

sample_number

                            sample number

session_date

                            date of session in YYYY-MM-DD format

stim_id

neuron_id

strf_param_id

                            unique id for STRF parameter set

n_spikes

                            array for number of spikes in each bin

srtf_values

                            STA at each time delay

 KO (chx10)
1
2008-06-06
0
0
0
=BLOB=
=BLOB=

KO (chx10)
1
2008-06-06
0
1
0
=BLOB=
=BLOB=

KO (chx10)
1
2008-06-06
0
2
0
=BLOB=
=BLOB=

KO (chx10)
1
2008-06-06
0
3
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
0
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
1
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
2
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
3
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
4
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-06
0
5
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-24
0
0
0
=BLOB=
=BLOB=

KO (chx10)
2
2008-06-24
0
1
0
=BLOB=
=BLOB=

...

Total: 531

#### Check an example key

```python
keys = STRF_Compute.fetch('KEY')

key = keys[50]
```

```python
key
```

    {'subject_name': 'KO (chx10)',
     'sample_number': 3,
     'session_date': datetime.date(2008, 6, 24),
     'stim_id': 0,
     'neuron_id': 13,
     'strf_param_id': 0}

```python
images = (STRF_Compute() & key).fetch1('srtf_values')

# images   # uncomment if you want to see how this looks structurally
```

```python
import matplotlib.pyplot as plt
plt.imshow(images[2][1])

plt.xlabel(f'tau = {images[2][0]} bins delay')
```

### Visualization code, part 3

```python
plt.figure(figsize=(20, 5))
plt.subplots_adjust(hspace=0.01)
plt.suptitle("STRF Plots", fontsize=18, y=0.95)

nrows = 1
ncols = len(images) // nrows + (len(images) % nrows > 0)

for n, plot in enumerate(images):
    # add a new subplot iteratively
    ax = plt.subplot(nrows, ncols, n + 1)

    # filter df and plot ticker on the new subplot axis
    plt.imshow(plot[1])

    # chart formatting
    ax.set_xlabel(f"tau = {plot[0]} bins")

```

```python

```

```python

```