Example #1
0
def main():
    
    # For each current value, create a cell
    for c in xrange(0,len(amps)):
        
        cells.append(mkgranule(gcid))

        g=h.Graph(0)
        g.size(0,tstop,-80,50)
        g.view(0,-80,tstop,130, (c % 2)*425,(c / 2)*260,400,200) # Position the graphs on screen
        addVars(g, c)
        graphs.append(g)
        
        stim = h.IClamp(0.5, sec = cells[c].soma)
        stim.delay = delay
        stim.amp = amps[c]
        stim.dur = duration
        stims.append(stim)
    
        data.append([])

    # For one of the current values, create a closeup of the AP
    focusampindex = 1
    closedupStartTime = 120 # ms
    closedupEndTime = 150   # ms
    closeup.size(closedupStartTime,closedupEndTime,-80,50)
    closeup.view(closedupStartTime,-80,closedupEndTime-closedupStartTime,130, 850,0,400,200)
    addVars(closeup, focusampindex)

    initialize()
    integrate() # Plot the graphs
Example #2
0
def exportNetworkGCs(netFile):

    with open(netFile, "r") as file:
        nml = file.read()

    import re
    rx = re.compile(r"Granule_0_(\d*?).cell")
    gcids = [int(match) for match in rx.findall(nml)]

    cells = {}
    for gcid in gcids:
        cells.update({ gcid: { 'cell': mkgranule(gcid), 'index': len(cells)} })

    exportToNML(cells)
Example #3
0
def __main__():

    numMitralsToUse = 1
    numGranulesPerMitralToExport = 1
    numGranulesTotal = numMitralsToUse * numGranulesPerMitralToExport

    mitral2granule = {}
    import cPickle as pickle
    with open('mitral2granule.p', 'rb') as fp1:
        mitral2granule.update(pickle.load(fp1))

    cells = {}
    for mcid in xrange(0, numMitralsToUse):
        for gcid in set(mitral2granule[mcid][0:numGranulesPerMitralToExport]):
            cells.update({ gcid: { 'cell': mkgranule(gcid), 'index': len(cells)} })

    exportToNML(cells)