diff --git a/examples/symba_energy_momentum/Untitled1.ipynb b/examples/symba_energy_momentum/Untitled1.ipynb new file mode 100644 index 000000000..a90d1792c --- /dev/null +++ b/examples/symba_energy_momentum/Untitled1.ipynb @@ -0,0 +1,2388 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "import xarray as xr\n", + "import numpy as np" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "ds = xr.open_dataset('bin.supercatastrophic_headon.nc')" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.DataArray 'discard_time' (id: 23)>\n",
+       "array([ 0.000000e+000,  5.800000e-006,  5.800000e-006, -1.797693e+308,\n",
+       "       -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n",
+       "       -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n",
+       "       -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n",
+       "       -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n",
+       "       -1.797693e+308, -1.797693e+308, -1.797693e+308])\n",
+       "Coordinates:\n",
+       "  * id       (id) int32 0 1 2 3 4 5 6 7 8 9 10 ... 13 14 15 16 17 18 19 20 21 22
" + ], + "text/plain": [ + "\n", + "array([ 0.000000e+000, 5.800000e-006, 5.800000e-006, -1.797693e+308,\n", + " -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n", + " -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n", + " -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n", + " -1.797693e+308, -1.797693e+308, -1.797693e+308, -1.797693e+308,\n", + " -1.797693e+308, -1.797693e+308, -1.797693e+308])\n", + "Coordinates:\n", + " * id (id) int32 0 1 2 3 4 5 6 7 8 9 10 ... 13 14 15 16 17 18 19 20 21 22" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds['discard_time']" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "ds1 = ds.where(np.abs(ds['discard_time']) < 1e99, drop=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset>\n",
+       "Dimensions:          (id: 3, time: 301)\n",
+       "Coordinates:\n",
+       "  * time             (time) float64 0.0 1e-07 2e-07 ... 2.98e-05 2.99e-05 3e-05\n",
+       "  * id               (id) int32 0 1 2\n",
+       "Data variables: (12/57)\n",
+       "    npl              (time, id) float64 2.0 2.0 2.0 2.0 ... 20.0 20.0 20.0 20.0\n",
+       "    ntp              (time, id) float64 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0\n",
+       "    name             (id) object b'0' b'1' b'2'\n",
+       "    particle_type    (id) object b'Central Body' b'Massive Body' b'Massive Body'\n",
+       "    xhx              (time, id) float64 0.0 1.0 1.0 0.0 1.0 ... 0.0 0.0 0.0 0.0\n",
+       "    xhy              (time, id) float64 0.0 -4.2e-05 4.2e-05 0.0 ... 0.0 0.0 0.0\n",
+       "    ...               ...\n",
+       "    discard_xhy      (id) float64 -2.736e+299 -5.125e-06 5.125e-06\n",
+       "    discard_xhz      (id) float64 0.0 0.0 0.0\n",
+       "    discard_vhx      (id) float64 2.171e-314 -0.0002318 -0.0002318\n",
+       "    discard_vhy      (id) float64 0.0 6.28 -6.281\n",
+       "    discard_vhz      (id) float64 2.171e-314 0.0 0.0\n",
+       "    discard_body_id  (id) float64 -2.147e+09 -2.147e+09 -2.147e+09
" + ], + "text/plain": [ + "\n", + "Dimensions: (id: 3, time: 301)\n", + "Coordinates:\n", + " * time (time) float64 0.0 1e-07 2e-07 ... 2.98e-05 2.99e-05 3e-05\n", + " * id (id) int32 0 1 2\n", + "Data variables: (12/57)\n", + " npl (time, id) float64 2.0 2.0 2.0 2.0 ... 20.0 20.0 20.0 20.0\n", + " ntp (time, id) float64 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0\n", + " name (id) object b'0' b'1' b'2'\n", + " particle_type (id) object b'Central Body' b'Massive Body' b'Massive Body'\n", + " xhx (time, id) float64 0.0 1.0 1.0 0.0 1.0 ... 0.0 0.0 0.0 0.0\n", + " xhy (time, id) float64 0.0 -4.2e-05 4.2e-05 0.0 ... 0.0 0.0 0.0\n", + " ... ...\n", + " discard_xhy (id) float64 -2.736e+299 -5.125e-06 5.125e-06\n", + " discard_xhz (id) float64 0.0 0.0 0.0\n", + " discard_vhx (id) float64 2.171e-314 -0.0002318 -0.0002318\n", + " discard_vhy (id) float64 0.0 6.28 -6.281\n", + " discard_vhz (id) float64 2.171e-314 0.0 0.0\n", + " discard_body_id (id) float64 -2.147e+09 -2.147e+09 -2.147e+09" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds1" + ] + }, + { + "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.8.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/symba_mars_disk/runswiftest.sh b/examples/symba_mars_disk/runswiftest.sh index 96dd99928..748a9d774 100644 --- a/examples/symba_mars_disk/runswiftest.sh +++ b/examples/symba_mars_disk/runswiftest.sh @@ -5,6 +5,7 @@ #SBATCH --time=14-00:00:00 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=12 +#SBATCH --mem=96G #SBATCH --job-name=high_high #SBATCH --no-requeue #SBATCH -o %x.out