{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Load Dataset" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import opal\n", "\n", "ds = opal.load_dataset('amr/plt0000000380/', ftype=opal.filetype.AMR)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "print ( ds )" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Projection Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.projection_plot(axis='z', field='rho', unit='C/m**3', zoom=1.0, color='gray', overlay_particles=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.slice_plot(normal='z', field='rho', unit='C/m**3', zoom=1.0, color='gray')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Slice Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.slice_plot(normal='z', field='Ex', unit='V/m', zoom=1.0, color='gray')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.slice_plot(normal='z', field='electric_field_y', unit='V/m', zoom=1.0, color='gray')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Line Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "plt.figure(figsize=(15, 10))\n", "ds.line_plot(axis='y', field='electrostatic_potential', unit='V')\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Particle Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.particle_plot('particle_position_x', 'particle_magnetic_field_z', x_unit='cm')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "ds.particle_plot('particle_position_x', 'particle_momentum_x',\n", " 'particle_electric_field_x', x_unit='cm',\n", " z_unit='V/m')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.particle_plot('particle_position_x', 'particle_electric_field_x', x_unit='cm', y_unit='V/m')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overlay Particles onto Fields" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.projection_plot(axis='z', field='electrostatic_potential', unit='V*m',\n", " zoom=1.0, color='gray', overlay_particles=True, method='integrate')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.slice_plot(normal='y', field='electrostatic_potential', unit='V',\n", " zoom=1.0, color='gray', overlay_particles=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds.slice_plot(normal='y', field='Ez', unit='V/m',\n", " zoom=1.0, color='black', overlay_particles=True)" ] } ], "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.5.2" } }, "nbformat": 4, "nbformat_minor": 2 }