{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Export isoenergy at the Fermi level\n\nSimple workflow for exporting the isoenergy at the Fermi level.\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" ] }, { "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": [ "## 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": [ "## Export the Fermi surface:\nFirst of all let's show it:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoenergy(0, 0.02).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then to be exported it mush be interpolated in a uniform grid.\nThis can be done by defining kbins in the isoenergy definition, which is the\nnumber of points the momentum along the analyzer slit and the scan.\nIn this case the number will be [1000, 800] and we will call such isoenergy\nobject as isoatfermi.\nsphinx_gallery_thumbnail_number = 3\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "isoatfermi = entry.isoenergy(0, 0.02, kbins=[1000, 800])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To show what we are going to save, the method is always the same:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "isoatfermi.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To export it as NXdata class of the nexus format uncomment this line:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# isoatfermi.export_as_nxs('fermimap.nxs')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To export it as igor-pro text file (itx) uncomment this line:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# isoatfermi.export_as_itx('fermimap.itx')" ] } ], "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.7.12" } }, "nbformat": 4, "nbformat_minor": 0 }