ciso class API¶
Compute iso-surface slices on 3D fields.
- ciso.ciso.zslice(q, p, p0)[source]¶
Return a 2D slice of the variable q from a 3D field defined by p.
The slice is defined along an iso-surface at p0 via linear interpolation. The result q_iso is a projection of variable at property == iso-value in the first non-singleton dimension.
Examples
>>> import numpy as np >>> import matplotlib.pyplot as plt >>> from ciso import zslice >>> z = np.linspace(-100, 0, 30)[:, None, None] * np.ones((50, 70)) >>> x, y = np.mgrid[0:20:50j, 0:20:70j] >>> s = np.sin(x) + z >>> s50 = zslice(s, z, -50) >>> plt.pcolormesh(s50)