{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import astar.data as ad\n", "import astar.visual as vis\n", "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Here we read data from the run directory" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "meshdir = \"/home/mvaisala/astaroth/build/\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#imesh = 30000\n", "imesh = 0\n", "mesh = ad.read.Mesh(imesh, fdir=meshdir)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Auxuliary variables" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "uu_tot = np.sqrt(mesh.uu[0]**2.0 + mesh.uu[1]**2.0 + mesh.uu[2]**2.0)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example visualization funtion call. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "vis.slices.plot_3(mesh, uu_tot, title = r'$\\|u\\|$')\n", "vis.slices.plot_3(mesh, mesh.uu[0], title = r'$u_x$')\n", "vis.slices.plot_3(mesh, mesh.uu[1], title = r'$u_y$')\n", "vis.slices.plot_3(mesh, mesh.uu[2], title = r'$u_z$')\n", "vis.slices.plot_3(mesh, mesh.lnrho, title = r'$\\ln_\\rho$')#, colrange=[0,0.1])\n", "vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$\\rho$')\n", "vis.slices.plot_3(mesh, np.exp(mesh.lnrho), title = r'$N_\\mathrm{col}$', slicetype = 'sum')#, colrange=[130,139])\n", "vis.slices.plot_3(mesh, uu_tot, title = r'$\\Sigma \\|u\\|$', slicetype = 'sum')#, colrange=[130,139])\n", "#vis.slices.plot_3(mesh, mesh.ss, title = r'$s$')\n", "vis.slices.plot_3(mesh, mesh.accretion, title = r'$Accretion buffer$')\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Ploting time series" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ts = ad.read.TimeSeries(fdir=meshdir)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "vis.lineplot.plot_ts(ts, lnrho=True, acc=True, uux=True)\n", "\n" ] }, { "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.3" } }, "nbformat": 4, "nbformat_minor": 2 }