Ejemplo n.º 1
0
 def specgram(self,
              t0=None,
              t1=None,
              f0=None,
              f1=2000,
              p0=None,
              p1=None,
              chanis=-1,
              width=2**16,
              tres=2**16 - 2**15,
              cm=None,
              colorbar=False,
              figsize=(20, 6.5)):
     LFP.specgram(self, t0, t1, f0, f1, p0, p1, chanis, width, tres, cm,
                  colorbar, figsize)
Ejemplo n.º 2
0
 def filterord(self, chanis=-1, f0=300, f1=None, order=4, btype='highpass', ftype='butter',
            plot=False):
     b, a = LFP.filterord(self, chanis, f0, f1, order, btype, ftype)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)
     return b, a
Ejemplo n.º 3
0
 def filter(self, chanis=-1, f0=500, f1=0, fr=100, gpass=0.01, gstop=50, ftype='ellip',
            plot=False):
     b, a = LFP.filter(self, chanis, f0, f1, fr, gpass, gstop, ftype)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)
     return b, a
Ejemplo n.º 4
0
 def filterord(self,
               chanis=-1,
               f0=300,
               f1=None,
               order=4,
               btype='highpass',
               ftype='butter',
               plot=False):
     b, a = LFP.filterord(self, chanis, f0, f1, order, btype, ftype)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)
     return b, a
Ejemplo n.º 5
0
 def filter(self,
            chanis=-1,
            f0=500,
            f1=0,
            fr=100,
            gpass=0.01,
            gstop=50,
            ftype='ellip',
            plot=False):
     b, a = LFP.filter(self, chanis, f0, f1, fr, gpass, gstop, ftype)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)
     return b, a
Ejemplo n.º 6
0
 def filterwavelet(self, chanis=-1, wname="db4", maxlevel=6, plot=False):
     LFP.filterwavelet(self, chanis, wname, maxlevel)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)
Ejemplo n.º 7
0
 def specgram(self, t0=None, t1=None, f0=None, f1=2000, p0=None, p1=None, chanis=-1,
              width=2**16, tres=2**16-2**15, cm=None, colorbar=False, figsize=(20, 6.5)):
     LFP.specgram(self, t0, t1, f0, f1, p0, p1, chanis, width, tres, cm, colorbar,
                  figsize)
Ejemplo n.º 8
0
 def __init__(self, fname='/home/mspacek/work/Buzsaki_raw_data/trace_8Chan_High-Sleep.dat'):
     LFP.__init__(self, Recording(''), fname) # give it a fake recording
Ejemplo n.º 9
0
    if title:
        a.set_title(titlestr)
    f.tight_layout(pad=0.3) # crop figure to contents


# LFP plot options:
lfpfname = '/home/mspacek/dev/blab/natmov/results/PVCre_0113/s01/PVCre_0113_s01_e11_LFP.mat'
lfpchanis = [31] #range(32) # 0-based
f1 = 59 # Hz
relative2t0 = True
lfpfigsize = 5, 2 # inches
title = False
width, tres = 2, 0.5 # s

# plot LFP spectrograms:
lfp = LFP(None, None)
lfpmat = loadmat(lfpfname)
ename = os.path.splitext(os.path.basename(lfpfname))[0].rstrip('_LFP') + '_specgram'
lfp.data = lfpmat['lfp'] * 1000 # convert from mV to uV
tlfp = intround(lfpmat['tlfp'][0] * 1e6) # convert from s to nearest us
lfp.t0, lfp.t1 = tlfp[0], tlfp[-1]
lfp.tres = intround((np.diff(tlfp)).mean()) # us
lfp.sampfreq = intround(1e6 / lfp.tres) # Hz
for chani in lfpchanis:
    lfp.specgram(f1=f1, chanis=chani, width=width, tres=tres, relative2t0=relative2t0,
                 title=title, reclabel=False, figsize=lfpfigsize)
    titlestr = ename + '_c%d' % (chani+1) # 1-based chan ID
    gcfm().window.setWindowTitle(titlestr)


# plot runspeed as a color map:
Ejemplo n.º 10
0
 def __init__(
     self,
     fname='/home/mspacek/work/Buzsaki_raw_data/trace_8Chan_High-Sleep.dat'
 ):
     LFP.__init__(self, Recording(''), fname)  # give it a fake recording
Ejemplo n.º 11
0
 def filterwavelet(self, chanis=-1, wname="db4", maxlevel=6, plot=False):
     LFP.filterwavelet(self, chanis, wname, maxlevel)
     if plot:
         self.plot(0.31, 0.325, chanis=chanis)
         self.specgram(0, 500, f1=2000, p0=None, p1=None)