{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Characterizing magnetic reconnection regions using Gaussian mixture models on particle velocity distributions\n",
    "\n",
    "This notebook shows an exemple of the application of Gaussian mixture models (GMM) on particle velocity distributions from PIC simulations. The objective is to detect and to characterize magnetic reconnections.\n",
    "Details can be found in the following paper: https://arxiv.org/abs/1910.10012."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prerequisites\n",
    "\n",
    "The GMM algorithm is applied on a 2D grid from a double Harris sheet simulation. The mesh is composed of thousands of cells. Therefore, the algorithm is run in parallel using *mpi4py* with the script *mpi_script.py*. As the latter needs to several core, it muse be run outside from this notebook by following the different steps:\n",
    "1. download the data, extract the archive, and put the folder in the same place than *mpi_script.py*. The data can be downloaded with the following link: https://osf.io/sh89u/?view_only=4e4fd8f513a34ebebdcca1747a505581.\n",
    "2. run *mpi_script.py* with the following command (<nb_cores> is the number of cores you want to use):\n",
    "```\n",
    "mpiexec -n <nb_cores> python mpi_script.py\n",
    "```\n",
    "3. you should a output file in h5 format"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
