{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Postprocessing on isoscan\n\nExample of isoscan postprocessing procedures.\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(-0.1, 0.1, 3),\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=[-2, 2], 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": [ "## Post processing on the isoscan:\nFirst of all let's show it:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoscan(0).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The second derivative can be obtained using sigma in the definition, which\ndefine the extension in points of the Gaussian filter used to then get the\nsecond derivative. In this case the sigma is different from zero only on the\nsecond element, meaning that the derivative will be performed only along the\nenergy axis:\nsphinx_gallery_thumbnail_number = 3\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoscan(0, sigma=[3, 5]).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Only the Gaussian filtered image can be obtained using again sigma but also\nspecifying the order=0, which by default is equal to 2 giving the second\nderivative as before.:\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "entry.isoscan(0, sigma=[10, 10], order=0).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": [ "# entry.isoscan(0, 0, sigma=[3, 5], order=0).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": [ "# entry.isoscan(0, 0, sigma=[3, 5], order=0).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.10.13" } }, "nbformat": 4, "nbformat_minor": 0 }