This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def da_firing_rate(df, dt, duration, gaussian_std=None, center_time=True): | |
'''computes Dayan and Abbot average firing rate or <r> | |
df: pandas dataframe with a "start" column in seconds and a | |
"trial" column. Starts are relative to the start of a trial | |
dt: timestep for computing histogram | |
duration: length of a trial in seconds | |
gaussian_std: if None, no smoothing is applied. Units: seconds. | |
center_time: if True, the returned time vector is the same length as | |
the firing rate. Otherwise, the time vector is the bin edges, | |
which are useful for histogram style plots. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
from scipy.signal import fftconvolve | |
def warp_path(fid, test, sampling_rate, insertgaps=True, | |
function=True, remove_fid_offset=True, invert=False): | |
""" | |
fid : fiducial (true) labels. A pandas dataset with fields 'start', 'stop', and 'label'. | |
test : like fid, labels to be warped | |
sampling_rate : sampling rate of returned warp path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Looking for a decent spectrogram? Check out resin. | |
# | |
# https://github.com/kylerbrown/resin | |
# | |
# Resin creates multi-taper spectrograms and spectral derivative spectrograms | |
# | |
# old code below... | |
import matplotlib.pyplot as plt | |
import matplotlib.cm as cm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## stim.sh ## | |
# a script to use jstim for overnight stimulation experiments | |
# move to source directory | |
cd "$(dirname "$0")" || exit | |
d=$(date +%Y%m%d_%H%M%S) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Rational ## | |
# A lot of data can be generated quickly with the Intan system. To keep the experimental computer | |
# from running out of space, the data should be regularly copied to a server and removed locally. | |
# This script does that safely by: | |
# 1) recursively copying all *.rhd files and deleting them after safe copy. | |
# 2) recursively copying everything else, but not deleting (saving notes and settings on the experimenal computer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import seaborn as sns # improves plot aesthetics | |
def _invert(x, limits): | |
"""inverts a value x on a scale from | |
limits[0] to limits[1]""" | |
return limits[1] - (x - limits[0]) | |
def _scale_data(data, ranges): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File originally created by Dan Meliza, modified by Kyler Brown | |
apt-get -y install make scons g++ gcc git libjack-dev jackd1 \ | |
libboost-dev libboost-program-options-dev libboost-date-time-dev libboost-system-dev libboost-filesystem-dev \ | |
libsndfile1-dev libsamplerate0-dev libhdf5-dev hdf5-tools \ | |
libx11-dev x11proto-core-dev libxft-dev libzmq-dev uuid-dev | |
# set some configuration for better RT performance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""an alpha version of the plotter""" | |
import signal | |
import sys | |
import pyqtgraph as pg | |
import pyqtgraph.dockarea as pgd | |
import h5py | |
import numpy as np | |
from PyQt4 import QtGui, QtCore | |
from PyQt4.phonon import Phonon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def raster(event_times_list, **kwargs): | |
""" | |
Creates a raster plot | |
Parameters | |
---------- |