.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/viser/02.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_viser_02.py: Display a 3D volume and two surfaces in web browser ============================================================== .. image:: ../../_static/cigvis/viser/02.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 14-43 .. code-block:: Python # sphinx_gallery_thumbnail_path = '_static/cigvis/viser/02.png' import numpy as np from cigvis import viserplot sxp = 'data/co2/sx.dat' sfp1 = 'data/co2/mh21.dat' sfp2 = 'data/co2/mh22.dat' ni, nx, nt = 192, 192, 240 sx = np.fromfile(sxp, np.float32).reshape(ni, nx, nt) sf1 = np.fromfile(sfp1, np.float32).reshape(ni, nx) sf2 = np.fromfile(sfp2, np.float32).reshape(ni, nx) nodes = viserplot.create_slices(sx, pos=[20, 40, 200], cmap='gray') # show amplitude nodes += viserplot.create_surfaces( [sf1, sf2], volume=sx, value_type='amp', cmap='seismic', clim=[-3, 3], ) viserplot.plot3D(nodes) .. _sphx_glr_download_gallery_viser_02.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 02.ipynb <02.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 02.py <02.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 02.zip <02.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_