Note
Click here to download the full example code
Randomly Generated Data¶
From the README.
import numpy as np
from taco_vis import FLOW
import sys
sys.path.append('../') #So taco_vis.py is visible to import
# Import and generate some random data
data = np.random.rand(10,10)
f = FLOW(data)
# Create instance of FLOW class and use it to plot an animation.
f.plot_cylinders_3D(animate=True)

Out:
/home/docs/.pyenv/versions/3.7.9/lib/python3.7/site-packages/numpy/core/_asarray.py:136: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
return array(a, dtype, copy=False, order=order, subok=True)
Animating...
This produces a 2D plot of a slice through the equitorial plane with concentric circles representing the concentric cylinders (with as many cylinders as there are radial grid points in the data). A series of black dots are plotted on each cylinder and are advected to visualise the sense of rotation. The cylinders are coloured by the value of velocity at that time interval.
f.plot_cylinders(animate=False, save=False, time_idx=0)

The same as ‘cylinders’ but instead the plot is a 3D representation of the cylinders within a spherical core.
f.plot_cylinders(animate=False, save=False, time_idx=0)

A filled contour plot of the data is produces, which does not strictly need to be axisymmetric and hence the data array may be 3D (radius, theta, time).
f.plot_contours(animate=False, save=False, time_idx=0)

Default settings for the appearance of the plots are attributes of the FLOW class. Current settings can be seen by the call method of the class:
print(f())
Out:
CURRENT SETTINGS ---------------
speed : 1
colorbar_title : velocity
title : time: %3.1f years
movie_filename : output.mp4
image_filename : output.png
dpi : 200
fps : 24
c_scale : 0.9962837387417603
--------------------------------
None
Total running time of the script: ( 0 minutes 0.568 seconds)