{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Interpolation on Graphene deflector scan\n\nSimple workflow for the interpolation of data along a generic path in the\nk-space from its isoenergy cuts.\nThe data are a deflector scan on graphene as simulated from a third nearest\nneighbor tight binding model. The same workflow can be applied to any\ntilt-, polar-, deflector- or hv-scan.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the \"fundamental\" python libraries for a generic data analysis:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import numpy as np\nimport matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Instead of loading the file as for example:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# from navarp.utils import navfile\n# file_name = r\"nxarpes_simulated_cone.nxs\"\n# entry = navfile.load(file_name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we build the simulated graphene signal with a dedicated function defined\njust for this purpose:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from navarp.extras.simulation import get_tbgraphene_deflector\n\nentry = get_tbgraphene_deflector(\n scans=np.linspace(-5., 20., 91),\n angles=np.linspace(-25, 6, 400),\n ebins=np.linspace(-13, 0.4, 700),\n tht_an=-18,\n phi_an=0,\n hv=120,\n gamma=0.05\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Fermi level autoset\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.autoset_efermi(scan_range=[-5, 5], energy_range=[115.2, 115.8])\nprint(\"Energy of the Fermi level = {:.0f} eV\".format(entry.efermi))\nprint(\"Energy resolution = {:.0f} meV\".format(entry.efermi_fwhm*1000))\n\nentry.plt_efermi_fit()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Check for the Fermi level alignment\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoscan(scan=0, dscan=0).show(yname='eef')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plotting iso-energetic cut at ekin = efermi\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoenergy(0, 0.02).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Set the k-space for the transformation\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.set_kspace(\n tht_p=0.1,\n k_along_slit_p=1.7,\n scan_p=0,\n ks_p=0,\n e_kin_p=114.3,\n)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and check the isoenergy at the Fermi level:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoenergy(0, 0.02).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define the interpolation path points\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "kbins = 900\nk_GK = 1.702\nk_pts_xy = np.array([\n [0, 0],\n [k_GK, 0],\n [k_GK*np.cos(np.pi/3), k_GK*np.sin(np.pi/3)+0.05],\n [0, 0]\n])\nkx_pts = k_pts_xy[:, 0]\nky_pts = k_pts_xy[:, 1]\n\nklabels = [\n r'$\\Gamma$',\n r'$\\mathrm{K}$',\n r'$\\mathrm{K}^{\\prime}$',\n r'$\\Gamma$'\n]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and show them on the isoenergy at the Dirac point energy:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoenergy(-1.1, 0.02).show()\nplt.plot(kx_pts, ky_pts, '-+')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Run the interpolation defining an isok:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "isok = entry.isok(kx_pts, ky_pts, klabels)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show the final results with the executed path on the isoenergy:\nsphinx_gallery_thumbnail_number = 6\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "fig, axs = plt.subplots(1, 2)\n\nentry.isoenergy(0, 0.02).show(ax=axs[0])\n\nisok.path_show(axs[0], 'k', 'k', xytext=(8, 8))\n\nqmesh = isok.show(ax=axs[1])\n\nfig.tight_layout()\nfig.colorbar(qmesh)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.13" } }, "nbformat": 4, "nbformat_minor": 0 }