{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "# TARPES analysis\n", "\n", "## note\n", "As the real tarpes data is really larlge (making it impractical to include this package), so here we create a mock Xarray resembling the data and use it for explanation.\n", "\n", "The mock data is a list that contains xarray:\n", "\n", "* 1000 xarray objects. Each xarray represents the single set at a certain position of the delay line.\n", "* 20 x 20 matrix data\n", "* Angle (-10deg to 10deg) and energy (5 eV to 6eV)\n", "* \"position\" attributes, for the delay line positilon (100.0mm to 103.00 mm), which is converted to delay time." ] }, { "cell_type": "code", "execution_count": null, "id": "1", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import xarray as xr\n", "from scipy.special import erf\n", "import matplotlib.pyplot as plt\n", "from numpy.typing import NDArray\n", "from matplotlib import animation\n", "from matplotlib.collections import QuadMesh\n", "\n", "import arpes\n", "from arpes.io import example_data\n", "from arpes.plotting.movie import plot_movie, plot_movie_and_evolution" ] }, { "cell_type": "code", "execution_count": null, "id": "2", "metadata": {}, "outputs": [], "source": [ "mock_tarpes = example_data.t_arpes" ] }, { "cell_type": "markdown", "id": "3", "metadata": {}, "source": [ "## tarpes analysis " ] }, { "cell_type": "markdown", "id": "4", "metadata": {}, "source": [ "### find_t_for_max_intensity" ] }, { "cell_type": "code", "execution_count": null, "id": "5", "metadata": {}, "outputs": [], "source": [ "tarpes_ = arpes.analysis.build_crosscorrelation(\n", " mock_tarpes, delayline_dim=\"position\", delayline_origin=100.31\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "6", "metadata": {}, "outputs": [], "source": [ "arpes.analysis.find_t_for_max_intensity(tarpes_)" ] }, { "cell_type": "code", "execution_count": null, "id": "7", "metadata": {}, "outputs": [], "source": [ "sum_dims = set(tarpes_.dims)\n", "sum_dims.remove(\"delay\")\n", "sum_dims.remove(\"eV\")\n", "summed = tarpes_.sum(list(sum_dims)).sel(eV=slice(None, None)).mean(\"eV\")\n", "summed.plot()" ] }, { "cell_type": "markdown", "id": "8", "metadata": {}, "source": [ "At a certain angle (here phi $\\sim$ 0), the temporal evolution shows as follows:" ] }, { "cell_type": "code", "execution_count": null, "id": "9", "metadata": {}, "outputs": [], "source": [ "tarpes_.transpose(\"eV\", ...).sel({\"phi\": 0}, method=\"nearest\").S.plot()" ] }, { "cell_type": "markdown", "id": "10", "metadata": {}, "source": [ "### relative_change" ] }, { "cell_type": "code", "execution_count": null, "id": "11", "metadata": {}, "outputs": [], "source": [ "relative_ = arpes.analysis.relative_change(tarpes_)\n", "relative_.transpose(\"eV\", ...).sel({\"phi\": 0}, method=\"nearest\").S.plot()" ] }, { "cell_type": "markdown", "id": "12", "metadata": {}, "source": [ "## Animation\n", "Two styles are provieded. (plot_movie, and plot_movie_and_evolution)\n", "\n", "Most of options are same. See the documents." ] }, { "cell_type": "code", "execution_count": null, "id": "13", "metadata": {}, "outputs": [], "source": [ "plot_movie(tarpes_.transpose(\"eV\", ...), figsize=(6, 3.5))" ] }, { "cell_type": "code", "execution_count": null, "id": "14", "metadata": {}, "outputs": [], "source": [ "plot_movie_and_evolution(\n", " tarpes_.transpose(\"eV\", ...), evolution_at=(\"phi\", (0, 1)), figsize=(6, 3.5)\n", ")" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.12.12" } }, "nbformat": 4, "nbformat_minor": 5 }