In [1]:
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams.update({'figure.max_open_warning': 0})
plt.rcParams.update({ 'image.origin': 'lower' })
plt.rcParams.update({ 'image.interpolation': 'none' })
from skbeam.core import roi
In [2]:
#%matplotlib inline
%matplotlib notebook
In [3]:
ed = 0.1 #edge fraction, in this case [40, 360]
bx = 2000 #box size, namely each frame size
by= 2000
le = bx*ed #edge size in pixel
size= 10 # each particle size, radius
center=[ bx//2,by//2]
num = 32 #particle number = num *num
print(center)
#from pixel to q, q= pixel/54.6
In [4]:
px = np.random.uniform( ed, 1-ed, (num , num ) ) * bx
py = np.random.uniform( ed, 1-ed, (num , num ) ) * by
In [5]:
%run -i Generate_2D_Pattern.py
In [6]:
px,py = get_random_motion_2D_points( px, py, amp = 10, rmin= 40, try_max=10000, )
In [7]:
img = place_shape_on_pxy( px,py, size= size, bx= bx, by=by, shape='c' )
In [8]:
plt.imshow(img)
Out[8]:
In [ ]: