Example #1
0
#
from __future__ import print_function
import os
import sys
import myokit
import methods
import methods.outward as outward
import numpy as np
import matplotlib
import matplotlib.pyplot as pl

#
# Fit all outward current experiments (or used cached result)
#
force = '--force' in sys.argv
table, cells = outward.fit_all(force=force)

#
# Run simulations with each cell (or use cached data)
#
aps = outward.simulate_tailored_aps(table, cells, force=force)

#
# Plot 2APs
#
#
# Order cells by APD at -65mV
#
tmin = 50 * 1e-3
vapd = -65 * 1e-3
order = np.array([aps['membrane.V', i] for i in xrange(len(outward.ORDER))])
Example #2
0
import sys
import methods
import methods.outward as outward
import methods.apd as apd
import numpy as np
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as pl

# Don't cache
force = "--force" in sys.argv

#
# Fit all outward current experiments (or used cached result)
#
table, cells = outward.fit_all()

#
# Run simulations with each cell (or use cached data)
#
sim = outward.simulate_tailored_aps(table, cells, force=force, beats=100, cl=1,
 stimulate=False)

# Normalise and calculate apd
n = len(outward.ORDER)
sim_time = sim.time() * 1e3 - 50
sim_aps = []
sim_apds = []
for i, long_id in enumerate(outward.ORDER):
    filename = os.path.join(apd.AP_FIGURES, 'sim-base-' + long_id + '.png')
    #sim_aps.append(apd.normalise(sim_time, sim['membrane.V', i],