.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/more_demos/080-channels.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_more_demos_080-channels.py: Channels demo =============== .. image:: ../../_static/cigvis/more_demos/080.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 13-86 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/more_demos/080.png' import numpy as np import cigvis from cigvis import colormap from pathlib import Path root = Path(__file__).resolve().parent.parent.parent root = root / 'data/channel' n1, n2, n3 = 256, 256, 256 shape = (n1, n2, n3) seis = np.memmap(root / 'Seismic_6.dat', np.float32, mode='c', shape=shape) labl = np.memmap(root / 'Label_6.dat', np.uint8, mode='c', shape=shape) iped = np.memmap(root / 'Ip_6.dat', np.float32, mode='c', shape=shape) pos = [6, 6, 250] vis1 = cigvis.create_slices(seis, pos=pos) vis1 += cigvis.create_axis( seis.shape, 'axis', 'auto', axis_labels=['Inline [km]', 'Xline [km]', 'Time [s]'], line_width=1, intervals=[0.025, 0.025, 0.002], rotation=(30, -30, -90), tick_nums=4, ) vis2 = cigvis.create_slices(iped, cmap='jet', pos=pos) vis2 += cigvis.create_axis( seis.shape, 'axis', 'auto', axis_labels=['Inline [km]', 'Xline [km]', 'Time [s]'], line_width=1, intervals=[0.025, 0.025, 0.002], rotation=(30, -30, -90), tick_nums=4, ) fg_cmap = colormap.set_alpha_except_min('jet', 1) vis3 = cigvis.create_slices(seis, pos=pos, cmap='gray') vis3 = cigvis.add_mask(vis3, labl, cmaps=fg_cmap, interpolation='nearest') vis3 += cigvis.create_axis( seis.shape, 'axis', 'auto', axis_labels=['Inline [km]', 'Xline [km]', 'Time [s]'], line_width=1, intervals=[0.025, 0.025, 0.002], rotation=(30, -30, -90), tick_nums=4, ) vis4 = cigvis.create_slices(seis, pos=pos, cmap='Petrel') vis4 = cigvis.add_mask(vis4, labl, cmaps=fg_cmap, interpolation='nearest') vis4 += cigvis.create_bodys(labl, 0.5, 0) vis4 += cigvis.create_axis( seis.shape, 'axis', 'auto', axis_labels=['Inline [km]', 'Xline [km]', 'Time [s]'], line_width=1, intervals=[0.025, 0.025, 0.002], rotation=(30, -30, -90), tick_nums=4, ) cigvis.plot3D([vis1, vis2, vis3, vis4], (2, 2), True, False, size=(1200, 1100)) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_gallery_more_demos_080-channels.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 080-channels.py <080-channels.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 080-channels.ipynb <080-channels.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_