{ "cells": [ { "cell_type": "markdown", "id": "5793aa0e", "metadata": {}, "source": [ "# Magnetic Skeleton Finder\n", "\n", "[Magnetic Skeleton Finder]: ../../api_static/plasmapy.analysis.magnetic_skeleton.rst\n", "\n", "The [magnetic skeleton finder] is functionality that is designed to find and analyze magnetic skeleton structures using a trilinear method as described in [Haynes et al. (2010)](https://doi.org/10.1063/1.3467499)\n", "In this notebook we will briefly cover how the [magnetic skeleton finder] utilizes the method described in the paper in order to describe the structures of magnetic field." ] }, { "cell_type": "code", "execution_count": 6, "id": "a4069f6d", "metadata": {}, "outputs": [ { "ename": "ModuleNotFoundError", "evalue": "No module named 'plasmapy'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", "Input \u001b[0;32mIn [6]\u001b[0m, in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mplasmapy\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01manalysis\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmagnetic_skeleton\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m (\n\u001b[1;32m 3\u001b[0m magnetic_skeleton_find\n\u001b[1;32m 4\u001b[0m )\n", "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'plasmapy'" ] } ], "source": [ "import numpy as np\n", "\n", "from plasmapy.analysis.magnetic_skeleton import magnetic_skeleton_find" ] }, { "cell_type": "markdown", "id": "8b324d8f", "metadata": {}, "source": [ "## Contents:\n", "\n", "1. [How Magnetic Skeleton Finder works](#How-Magnetic-Skeleton-Finder-works)\n", " 1. [Locating the null points](#Locating-the-null-points)\n", " 1. [Locating the spines](#Locating-the-spines)\n", " 1. [Locating the fan and separators](#Locating-the-fan-and-separators)\n", "1. [Running through an example](#Running_through-an-example)\n", " 1. [Arbitrary Regular Grid](#Arbitrary-regular-grid)\n", " " ] }, { "cell_type": "markdown", "id": "ff2a3f8c", "metadata": {}, "source": [ "## Running through an example" ] }, { "cell_type": "code", "execution_count": null, "id": "3344c0ba", "metadata": {}, "outputs": [], "source": [ "def example():\n", " x_arr = np.linspace(-5, 5, 60)\n", " y_arr = np.linspace(-5, 5, 60)\n", " z_arr = np.linspace(-5, 5, 60)\n", " x, y, z = np.meshgrid(\n", " x_arr,\n", " y_arr,\n", " z_arr,\n", " indexing=\"ij\",\n", " )\n", " u, v, w = vspace_func_3(x, y, z)\n", " nullpoints, spines, fan, separators = magnetic_skeleton_find(\n", " x_arr, y_arr, z_arr, u, v, w\n", " )\n", "\n", "\n", "example()" ] }, { "cell_type": "code", "execution_count": null, "id": "98f802af", "metadata": {}, "outputs": [], "source": [] } ], "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.10.4" } }, "nbformat": 4, "nbformat_minor": 5 }