PynamiX example notebook¶
[ ]:
import numpy as np
import matplotlib.pyplot as plt
from pynamix import io, data, measure, color, plotting, exposure
%matplotlib inline
Load example data¶
[ ]:
ims,logfile = data.pendulum() # load some example data
# im, logfile = io.load_seq('path_to_data') # load your own data
# save_as_tiffs('tt',ims,tmin=1000,tmax=1050,tstep=10) # save some of the SEQ file as tiffs in a folder `tt`
Apply an ROI¶
[ ]:
ims, logfile = exposure.apply_ROI(ims, logfile, left=600)
Find min and max threshold values¶
[ ]:
w = plotting.hist_GUI(ims)
display(w)
Apply threshold¶
[ ]:
masked_ims = exposure.clamp(ims,w.kwargs['vmin'],w.kwargs['vmax'])
Calculate size and orientation fields¶
[ ]:
virino = color.virino()
X,Y,orient, dzeta = measure.orientation_map(masked_ims,logfile,tmin=1,tmax=2)
x,y,size = measure.average_size_map(masked_ims,logfile,tmin=1,tmax=2)
plt.subplot(131)
plt.imshow(masked_ims[0])
plt.subplot(132)
plt.pcolormesh(X,Y,orient[0],cmap=virino)
plt.colorbar()
plt.subplot(133)
plt.pcolormesh(x,y,size[0])
plt.colorbar()
plt.show()
Load some PIVLab data¶
[ ]:
x,y,u,v = io.load_PIVLab_txtfiles('/Volumes/LTS/DynamiX/PerpetualAvalanche/PerpetualAvalanche-3mm-4mm-80-20/PIV/',start=1000,end=1020,tstep=5)
plt.quiver(x,y,u[0,:,:],v[0,:,:])
plt.show()