Exemplo n.º 1
0
FIGDIR = os.path.join(PAPERDIR, "figures", "")
DATADIR = os.path.join(HOME, "Dropbox", "nanopores", "fields")
f.set_dir_mega()

number = False

geop = nanopores.Params(pughpore.params)
hpore = geop.hpore
fieldsname = 'eventsnew_both_1_'
params = dict(avgbind1=23e6,
              avgbind2=3e4,
              P_bind1=0.035,
              P_bind2=3e-1,
              z0=hpore / 2. + 0.)

drop, th = f.get("events_pugh_experiment", "drop", "t")
th = [1e0 * time for time in th]

#cmap=matplotlib.cm.get_cmap('viridis')
data = f.get_fields(fieldsname, **params)
figname = fieldsname + '_%.1e_%.1e_%.1e_%.1e' % (
    params["avgbind1"], params["avgbind2"], params["P_bind1"],
    params["P_bind2"]) + str(params["z0"])
t = data["t"]
a = data["a"]
ood = data["ood"]
lendata = len(t)
fac = 1.
if max(t) < 1e-2:
    fac = 1e3
    t = [x * 1e3 for x in t]
Exemplo n.º 2
0
    #         label="Simple Gamma fit")
    plt.plot(tt, gamma.pdf_direct(tt), label="Compound Gamma fit")
    #plt.plot(tt, gamma.pdf_bessel(tt), ".k", label="Compound Gamma fit")
    #plt.plot(kk*dt, poisson.pmf(kk, k0), label="Poisson fit")
    #plt.plot(tt)
    if xlog:
        plt.xscale("log")
    #plt.ylim(ymin=1e-10)
    #plt.yscale("log")
    plt.xlabel("Attempt time [ns]")
    plt.ylabel("Rel. frequency")
    plt.legend()

if todo.fit_experiments:
    # get data
    drop, tsample = fields.get("events_pugh_experiment", "drop", "t")
    tsample = tsample.load()
    log = True
    std = False
    cutoff = 0.1  # [ms], detection limit cutoff

    # plot data with indication of two clusters
    sep = 2.
    large = tsample >= sep
    toosmall = tsample < cutoff
    plt.figure("data_scatter", figsize=(4, 3))
    plt.scatter(tsample[toosmall], drop[toosmall], color="r")
    plt.scatter(tsample[~toosmall], drop[~toosmall])
    #plt.scatter(tsample[~large & ~toosmall], drop[~large & ~toosmall])
    #plt.scatter(tsample[large], drop[large], color="g")
    plt.axvline(x=cutoff, color="r")
Exemplo n.º 3
0
l2 = up.l2
l3 = up.l3
l4 = up.l4
hpore = up.hpore
hmem = up.hmem
h2 = up.h2
h1 = up.h1
h4 = up.h4

figsize1 = (2.2, 1.7)
figsize2 = (10, 2.21)
lw = .5

# eventspara_nobind_traj_0.00109600_0424_1.7e+07_3.0e+04_1.9e-01_3.0e-0123.0
# eventspara_nobind_traj_0.00236500_0316_1.7e+07_3.0e+04_1.9e-01_3.0e-0123.0
x, y, z, j, t, b1, b2 = fields.get("eventspara_nobind", "X", "Y", "Z", "J",
                                   "T", "b1", "b2")

ind = [424, 316]  # indices
loc = [8, 9]
colors = ["red", "green"]

for m in 0, 1:
    i = ind[m]
    X = x[i].load()
    Y = y[i].load()
    Z = z[i].load()
    T = t[i].load()
    J = j[i].load()

    I0 = 7.523849e-10
    bind1 = np.where(T > 1e6)[0]
Exemplo n.º 4
0
# (c) 2017 Gregor Mitscha-Baude
import matplotlib.pyplot as plt
from matplotlib import rcParams, rc
rcParams.update({
    "font.size" : 7,
    "axes.titlesize" : 7,
    "font.family" : "sans-serif",
    "font.sans-serif" : ["CMU Sans Serif"],
    "lines.linewidth" : 1,
    "lines.markersize" : 5,
})
from nanopores.tools import fields, savefigs

fields.set_dir_mega()
t_exp, A_exp = fields.get("events_pugh_experiment", "t", "drop")
t_sim, A_sim = fields.get("eventsnew_both_1_", "t", "a")

plt.figure("pugh", figsize=(1.7, 1.6))
plt.scatter(t_sim, A_sim, s=3, alpha=0.5, linewidth=0, color="#00cc00", zorder=100, label="Simulation")
plt.scatter(t_exp, A_exp, s=3, alpha=0.5, linewidth=0, color="r", label="Experiment")
plt.xscale("log")
plt.ylim(ymax=51)
plt.xlim(.5e-5, 3e2)

ax = plt.gca()
ax.invert_yaxis()
ax.set_yticklabels([])
ax.set_xticklabels([])
ax.set_yticks([])
ax.set_xticks([])