.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/proj_fermisurf.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_proj_fermisurf.py: ======================= Projected Fermi surface ======================= .. GENERATED FROM PYTHON SOURCE LINES 7-51 .. image-sg:: /gallery/images/sphx_glr_proj_fermisurf_001.png :alt: proj fermisurf :srcset: /gallery/images/sphx_glr_proj_fermisurf_001.png :class: sphx-glr-single-img .. code-block:: Python from fplore import FPLORun from fplore.plot import plot_bz_proj from fplore.util import cartesian_product import matplotlib.pyplot as plt import numpy as np #run = FPLORun("../example_data/fermisurf") #yrs TODO fix fermisurf run run = FPLORun("../example_data/yrs") #yrs ## limit to bands close to fermi level to reduce memory usage #bands = run.band.bands_at_energy(e=0., tol=5*0.04) #selected_energy_data = run.band.data['e'][..., bands] ip = run.band.interpolator axes = [np.linspace(-1, 1, 100)]*3 k_sample = cartesian_product(*axes) data = ip(run.backfold_k(k_sample)) data = data.reshape(tuple(map(len, axes)) + (-1,)) # axis to project along, 0: x, 1: y, 2: z axis_to_project = 2 visible_axes = [0, 1, 2] visible_axes.remove(axis_to_project) axis_labels = [r'$k_x / \mathrm{\AA}^{-1}$', r'$k_y / \mathrm{\AA}^{-1}$', r'$k_z / \mathrm{\AA}^{-1}$'] im = run.band.smooth_overlap(data, e=0, scale=0.04, axis=axis_to_project) im = im.T # so the first axis (x) is displayed horizontally not vertically plt.imshow(im, extent=(axes[visible_axes[0]][0], axes[visible_axes[0]][-1], axes[visible_axes[1]][0], axes[visible_axes[1]][-1]), interpolation="bicubic", origin='lower') plot_bz_proj(run, plt.gca(), axis=axis_to_project, color='grey') plt.xlabel(axis_labels[visible_axes[0]]) plt.ylabel(axis_labels[visible_axes[1]]) plt.legend() plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.719 seconds) .. _sphx_glr_download_gallery_proj_fermisurf.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: proj_fermisurf.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: proj_fermisurf.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_