SHAPE = (512, 512)

v = np.load("simple_brownian_ddm_fft.npy")

nframes = len(v)

data, count = adiff(v, n=2**10)

data = normalize((data, count))

i, j = 4, 8

plt.figure()

#plot fast data  at k =(i,j) and for x > 0 (all but first data point)
x = np.arange(data.shape[-1])
plt.semilogx(x[1:], data[i, j][1:], "o")

np.save("simple_brownian_adiff_linear.npy", data)

##now let us do some k-averaging
kdata = k_select(data, phi=0, sector=180, kstep=1)

plt.figure()
#
for k, c in kdata:
    plt.semilogx(x[1:], c[1:] / c[-1], label=k)
plt.legend()
plt.show()
Exemplo n.º 2
0
import numpy as np
from scipy.optimize import curve_fit

colors = ["C{}".format(i) for i in range(10)]

c = np.load("simple_brownian_ccorr_linear.npy")
xc = np.arange(c.shape[-1])

xcl, cl = np.load("simple_brownian_ccorr_log.npy", allow_pickle=True)

a = np.load("simple_brownian_acorr_linear.npy")
xa = np.arange(a.shape[-1])

##now do some k-averaging over a cone of 5 degrees, at 0 angle
##kc and ka are lists of (q,data) tuples
kc = list(k_select(c, phi=0, sector=120, kstep=1))
kcl = list(k_select(cl, phi=0, sector=120, kstep=1))
ka = list(k_select(a, phi=0, sector=120, kstep=1))

#Plot 16th and 28th q
plt.figure()
for i in (15, 27):
    k, y = kc[i]
    plt.semilogx(xc[1:], y[1:] / y[0], label="ccorr k = {:.1f}".format(k))

for i in (15, 27):
    k, y = ka[i]
    plt.semilogx(xa[1:], y[1:] / y[0], label="acorr k = {:.1f}".format(k))

for i in (15, 27):
    k, y = kcl[i]
Exemplo n.º 3
0
#merged data
x, logdata = log_merge(cfast, cslow)

#np.save("simple_brownian_ccorr_log.npy",(x,logdata))

plt.semilogx(x[1:], logdata[i, j][1:], "k-", label="merged")

x2, logdata2 = log_merge(cfast2, cslow2)

plt.semilogx(x2[1:], logdata2[i, j][1:], "k--", label="merged2")
plt.legend()

#np.save("simple_brownian_ccorr_log2.npy",(x2,logdata2))

##now let us do some k-averaging
kdata = k_select(logdata, phi=90, sector=120, kstep=1)
kdata2 = k_select(logdata2, phi=90, sector=120, kstep=1)

plt.figure()
#
for i, (k, c) in enumerate(kdata):
    print(k)
    if k > 29:

        plt.semilogx(x[1:], c[1:], label=k)

for i, (k, c) in enumerate(kdata2):
    print(k)
    if k > 29:
        plt.semilogx(x2[1:], c[1:], label=k)
Exemplo n.º 4
0
#plot fast data  at k =(i,j) and for x > 0 (all but first data point)

plt.semilogx(x[1:], cfast[i, j][1:], "o", label="fast")

#plot slow data
x = np.arange(cslow.shape[-1]) * PERIOD
for n, slow in enumerate(cslow):
    x = x * 2
    plt.semilogx(x[1:], slow[i, j][1:], "o", label="slow {}".format(n + 1))

#merged data
x, logdata = log_merge(cfast, cslow)
plt.semilogx(x[1:], logdata[i, j][1:], label="merged")

plt.legend()

#np.save("ccorr_t.npy",x)
#np.save("ccorr_data.npy",logdata)

##now let us do some k-averaging
kdata = k_select(logdata, phi=15, sector=3, kstep=1)

plt.figure()
#
for k, c in kdata:
    print(k)
    plt.semilogx(x[1:], c[1:] / c[0], label=k)
plt.legend()
plt.show()