satn_to_movie#
- satn_to_movie(im, satn, cmap='viridis', c_under='grey', c_over='white', v_under=0.001, v_over=1.0, fps=10, repeat=True)[source]#
Converts a saturation map into an animation that can be saved
- Parameters:
im (ndarray) – The boolean image of the porous media with
True
values indicating the void spacesatn (ndaray) – The saturation map such as that produced by an invasion or drainage algorithm.
cmap (str) – The name of the matplotlib color map to use. These are listed on matplotlib’s website here
c_under (str) – The color to insert for values that are less than v_under (greater than v_over). The string value of colors are given on matplotlib’s website here
c_over (str) – The color to insert for values that are less than v_under (greater than v_over). The string value of colors are given on matplotlib’s website here
v_under (scalar) – The values in
satn
that should be considered the lower and upper threshold, beyond which the colors given in c_under and c_over are used.v_over (scalar) – The values in
satn
that should be considered the lower and upper threshold, beyond which the colors given in c_under and c_over are used.fps (int) – The frames per second to use when generating the movie. A higher number gives a shorter and faster-paced movie.
repeat (bool) – If
True
the produced animation will rerun repeatedly until stopped or closed.
Notes
To save animation as a file use:
ani.save('image_based_ip.gif', writer='imagemagick', fps=3)
Examples
Click here to view online example.