{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n\n# Plotting fermi3d isovalue_gif\n\nSymmetry does not currently work! Make sure for fermi surface calculations turn off symmetry\n\nPlotting fermi3d isovalue_gif example.\n\nFirst download the example files with the code below. Then replace data_dir below.\n\n.. code-block::\n   :caption: Downloading example\n\n    data_dir = pyprocar.download_example(save_dir='', \n                                material='Fe',\n                                code='qe', \n                                spin_calc_type='non-spin-polarized',\n                                calc_type='fermi')\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# sphinx_gallery_thumbnail_number = 1"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import pyvista\n\n# You do not need this. This is to ensure an image is rendered off screen when generating exmaple gallery.\npyvista.OFF_SCREEN = True"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "importing pyprocar and specifying local data_dir\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import os\n\nimport pyprocar\n\ndata_dir = os.path.join(\n    pyprocar.utils.DATA_DIR, \"examples\", \"Fe\", \"qe\", \"non-spin-polarized\", \"fermi\"\n)\n\n# First create the FermiHandler object, this loads the data into memory. Then you can call class methods to plot\n# Symmetry only works for specfic space groups currently.\n# For the actual calculations turn off symmetry and set 'apply_symmetry'=False\nfermiHandler = pyprocar.FermiHandler(code=\"qe\", dirname=data_dir, apply_symmetry=True)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Plain mode\n\n\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "# iso_range will be the energy range around the fermi level. 2 would search 1 ev above and below.\niso_range = 2\n\n# iso_surface will generate 5 surfaces equally space throughout the range.\niso_surfaces = 5\n\n# Instead of iso_range and iso_surfaces, you can specify exact energy values to generate isosurfaces\niso_values = [-1, -0.5, 0.25, 1, 5]\n\nfermiHandler.create_isovalue_gif(\n    iso_range=iso_range,\n    iso_surfaces=iso_surfaces,\n    save_gif=\"isovalue_gif.gif\",\n    mode=\"plain\",\n)"
      ]
    }
  ],
  "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.9.20"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}