{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyse 2M++ resims" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/scratch/pyenvs/versions/3.6.5/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n", " from ._conv import register_converters as _register_converters\n" ] } ], "source": [ "import numpy as np\n", "import matplotlib.pylab as plt\n", "from src.read_all_h5 import explore_chain, rebuild_spliced_h5\n", "from src.special_regions import *\n", "import healpy as hp\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Just some helper Routines" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "#little reading routine\n", "def load_resim(fname,ncpu=1):\n", " print (\"reading : \", fname)\n", " \n", " if ncpu>0:\n", " a=rebuild_spliced_h5(fname,['u_pos','u_vel'],ncpu,verbose=False)\n", " return np.array(a[\"u_pos\"][...]),np.array(a[\"u_vel\"][...])\n", " else:\n", " print ('Error: need number of processes to read files !')\n", " \n", " return None\n", "#print special regions\n", "special_coords.keys()\n", "\n", "#set observer\n", "corner=np.array([-0.5*677.77,-0.5*677.77,-0.5*677.77])\n", "\n", "#change coordinates\n", "def cart2sphere(pos,corner=np.array([0,0,0]),rmax=100):\n", " r = np.sqrt((pos[:,0]+corner[0])**2+(pos[:,1]+corner[1])**2+(pos[:,2]+corner[2])**2)\n", " foo=np.where(r" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "plot_radial_density(r,ra,dec)\n" ] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "511.99999999999983\n" ] } ], "source": [ "print (np.shape(pos1)[0]**(1./3.))" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "10\n" ] } ], "source": [ "import glob\n", "aux = glob.glob(\"/data/lavaux/PM_HOT_0.30_try2_epsilon_0.01/output_7610.h5_*\")\n", "print(len(aux))\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.6.5" } }, "nbformat": 4, "nbformat_minor": 2 }