{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "5a38ed25", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:48:39.822802Z", "start_time": "2022-11-20T12:48:03.992510Z" } }, "outputs": [], "source": [ "import numpy as np\n", "%matplotlib notebook\n", "import matplotlib.pyplot as plt\n", "try:\n", " import csiborgtools\n", "except ModuleNotFoundError:\n", " import sys\n", " sys.path.append(\"../\")\n", " import csiborgtools\n", "import utils\n", "%load_ext autoreload\n", "%autoreload 2\n", "\n", "import joblib\n", "from os.path import join" ] }, { "cell_type": "code", "execution_count": 2, "id": "f39874e4", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:48:39.888076Z", "start_time": "2022-11-20T12:48:39.824849Z" } }, "outputs": [], "source": [ "from astropy.cosmology import FlatLambdaCDM, z_at_value\n", "from astropy import units" ] }, { "cell_type": "code", "execution_count": 6, "id": "d243cc59", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:48:50.480986Z", "start_time": "2022-11-20T12:48:46.442880Z" } }, "outputs": [], "source": [ "Nsim = 9844\n", "Nsnap = 1016\n", "# data, box = utils.load_processed(Nsim, Nsnap)\n", "data, box = utils.load_processed(Nsim, Nsnap)" ] }, { "cell_type": "code", "execution_count": 10, "id": "344e6b96", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:49:41.830512Z", "start_time": "2022-11-20T12:49:41.793552Z" } }, "outputs": [], "source": [ "X = np.vstack([data[\"peak_{}\".format(p)] for p in (\"x\", \"y\", \"z\")]).T" ] }, { "cell_type": "code", "execution_count": 12, "id": "d8bb7dce", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:51:00.688105Z", "start_time": "2022-11-20T12:51:00.262736Z" } }, "outputs": [], "source": [ "from sklearn.neighbors import NearestNeighbors" ] }, { "cell_type": "code", "execution_count": 13, "id": "71026a85", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:51:22.817846Z", "start_time": "2022-11-20T12:51:22.762451Z" } }, "outputs": [], "source": [ "neighbors = NearestNeighbors()" ] }, { "cell_type": "code", "execution_count": 14, "id": "3ca4a7b7", "metadata": { "ExecuteTime": { "end_time": "2022-11-20T12:51:52.857117Z", "start_time": "2022-11-20T12:51:52.659741Z" } }, "outputs": [ { "data": { "text/html": [ "
NearestNeighbors()In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook.
NearestNeighbors()