Example #1
0
def myplot(frame, fig):

    ax = fig.add_subplot(111)

    plot.cells(frame, ax)
    plot.solidarea(frame, ax)
    plot.shape(frame, ax)
    plot.velocity(frame, ax)
    plot.pressure_force(frame, ax)
    plot.walls(frame, ax)

    ax.axes.set_aspect('equal', adjustable='box')
    ax.set_xlim([0, frame.parameters['Size'][0]-1])
    ax.set_ylim([0, frame.parameters['Size'][1]-1])
    ax.axis('off')
Example #2
0
def myplot(frame, fig):

    ax1 = fig.add_subplot(121)
    ax2 = fig.add_subplot(122)

    plot.cells(frame, ax1)
    plot.shape(frame, ax1)

    plot.velocity_field(frame, avg=5, cbar=False, engine=ax2)

    for ax in [ax1, ax2]:
        ax.axes.set_aspect('equal', adjustable='box')
        ax.set_xlim([0, frame.parameters['Size'][0] - 1])
        ax.set_ylim([0, frame.parameters['Size'][1] - 1])
        ax.axis('off')
Example #3
0
def myplot(frame, fig):

    ax1 = fig.add_subplot(121)
    ax2 = fig.add_subplot(122)

    plot.cells(frame, ax1)
    plot.solidarea(frame, ax1)
    plot.shape(frame, ax1)
    plot.velocity(frame, ax1)
    plot.pressure_force(frame, ax1)

    plot.interfaces(frame, ax2)

    for ax in [ax1, ax2]:
        ax.axes.set_aspect('equal', adjustable='box')
        ax.set_xlim([0, frame.parameters['Size'][0] - 1])
        ax.set_ylim([0, frame.parameters['Size'][1] - 1])
        ax.axis('off')
Example #4
0
for c_dir in dirs:
    if not os.path.exists(c_dir):
        os.makedirs(c_dir)

# Go for quick generation of the biophysical data (if false take ~5 min)
FAST = False

# Generate the biophysical if not existing
try:
    hdf = h5py.File("%s/data.hdf5" % DATA_FOLDER, "r")
except IOError:
    print("Need to generate a set of data")
    model, stim = lib_phy.generate_data(short=FAST)
    print("Draw model stimulated points")
    FIG_NAME = "%sFig%dD%s" % (FIG_FOLDER, 1, FIG_SUF)
    plot.shape(model, save=FIG_NAME)

# Load data into namespace
biophy = ["soma_v", "dend_v",
          "vtrace_c", "exp_c", "meas_c",
          "vtrace_s", "exp_s", "meas_s"]
hyp = ["soma_v_h", "dend_v_h", "vtrace_c_h", "exp_c_h",
       "meas_c_h", "vtrace_s_h", "exp_s_h", "meas_s_h"]
t = ["time_v", "time_em"]
data_load = biophy + hyp + t
with h5py.File("%s/data.hdf5" % DATA_FOLDER, "r") as hdf:
    for name in data_load:
        globals()[name] = np.array(hdf[name])

# Data visually extracted from Jia et al 2011 article
data = [[1, 0.1, 0, 0.8, 0.12, 0, 0, 0.25],