diff --git a/README.md b/README.md index 7ee5ff075..c9a97fd36 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ - # CLMM [![Build and Check](https://github.com/LSSTDESC/CLMM/workflows/Build%20and%20Check/badge.svg)](https://github.com/LSSTDESC/CLMM/actions?query=workflow%3A%22Build+and+Check%22) [![Coverage Status](https://coveralls.io/repos/github/LSSTDESC/CLMM/badge.svg?branch=main)](https://coveralls.io/github/LSSTDESC/CLMM?branch=main) @@ -110,6 +109,7 @@ the `CCL` publication be cited. See details The `Cluster Toolkit` documentation can be found [here](https://cluster-toolkit.readthedocs.io/en/latest/#). +The data for the notebook test_coordinate.ipynb is available at https://www.dropbox.com/scl/fo/dwsccslr5iwb7lnkf8jvx/AJkjgFeemUEHpHaZaHHqpAg?rlkey=efbtsr15mdrs3y6xsm7l48o0r&st=xb58ap0g&dl=0 # Contributing to CLMM diff --git a/docs/doc-config.ini b/docs/doc-config.ini index f6475ae66..cb9d24c5c 100644 --- a/docs/doc-config.ini +++ b/docs/doc-config.ini @@ -33,5 +33,6 @@ OTHER ../examples/demo_compute_deltasigma_weights.ipynb ../examples/demo_mass_conversion.ipynb ../examples/demo_mock_ensemble_realistic.ipynb +../examples/demo_coordinate_system_datasets.ipynb #../examples/other_compare_NFW_critical_massdef.ipynb #../examples/other_flat_sky_limitations.ipynb diff --git a/examples/DC2/DC2_gt_profiles.ipynb b/examples/DC2/DC2_gt_profiles.ipynb index d971b50b7..153820205 100644 --- a/examples/DC2/DC2_gt_profiles.ipynb +++ b/examples/DC2/DC2_gt_profiles.ipynb @@ -600,7 +600,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -614,7 +614,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.9.0" } }, "nbformat": 4, diff --git a/examples/DC2/data_and_model_demo_DC2.ipynb b/examples/DC2/data_and_model_demo_DC2.ipynb index f69fe46e9..a91c0c12c 100644 --- a/examples/DC2/data_and_model_demo_DC2.ipynb +++ b/examples/DC2/data_and_model_demo_DC2.ipynb @@ -340,7 +340,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.1" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_boost_factors.ipynb b/examples/demo_boost_factors.ipynb index fda156a82..6f236bd22 100644 --- a/examples/demo_boost_factors.ipynb +++ b/examples/demo_boost_factors.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "b803f8e6", "metadata": {}, "source": [ "# Boost factors" @@ -11,7 +10,6 @@ { "cell_type": "code", "execution_count": null, - "id": "7180b199", "metadata": {}, "outputs": [], "source": [ @@ -26,7 +24,6 @@ }, { "cell_type": "markdown", - "id": "11e76008", "metadata": {}, "source": [ "Make sure we know which version we're using" @@ -35,7 +32,6 @@ { "cell_type": "code", "execution_count": null, - "id": "389d5ab7", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +40,6 @@ }, { "cell_type": "markdown", - "id": "d86fa53c", "metadata": {}, "source": [ "### Define cosmology object" @@ -53,7 +48,6 @@ { "cell_type": "code", "execution_count": null, - "id": "74bcb35c", "metadata": {}, "outputs": [], "source": [ @@ -62,7 +56,6 @@ }, { "cell_type": "markdown", - "id": "6b458081", "metadata": {}, "source": [ "First, we want to generate a $\\Delta\\Sigma$ (excess surface density) profile from mock data, to which we can apply boost factors. The mock data is generated in the following cells." @@ -70,7 +63,6 @@ }, { "cell_type": "markdown", - "id": "de5340ee", "metadata": {}, "source": [ "Generate cluster object from mock data" @@ -79,7 +71,6 @@ { "cell_type": "code", "execution_count": null, - "id": "6cec7b64", "metadata": {}, "outputs": [], "source": [ @@ -107,7 +98,6 @@ }, { "cell_type": "markdown", - "id": "50045a1f", "metadata": {}, "source": [ "Loading this into a CLMM cluster object centered on (0,0)" @@ -116,7 +106,6 @@ { "cell_type": "code", "execution_count": null, - "id": "a564b1c9", "metadata": {}, "outputs": [], "source": [ @@ -127,7 +116,6 @@ }, { "cell_type": "markdown", - "id": "eb9c2218", "metadata": {}, "source": [ "Compute cross and tangential excess surface density for each source galaxy" @@ -136,7 +124,6 @@ { "cell_type": "code", "execution_count": null, - "id": "bc5b051d", "metadata": {}, "outputs": [], "source": [ @@ -154,7 +141,6 @@ }, { "cell_type": "markdown", - "id": "26081451", "metadata": {}, "source": [ "Calculate the binned profile" @@ -163,7 +149,6 @@ { "cell_type": "code", "execution_count": null, - "id": "eaadac01", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +175,6 @@ }, { "cell_type": "markdown", - "id": "7e88afc4", "metadata": {}, "source": [ "Plot the $\\Delta\\Sigma$ profile" @@ -199,7 +183,6 @@ { "cell_type": "code", "execution_count": null, - "id": "0aeb2f52", "metadata": {}, "outputs": [], "source": [ @@ -219,7 +202,6 @@ }, { "cell_type": "markdown", - "id": "e28ec4c5", "metadata": {}, "source": [ "## Boost Factors" @@ -227,7 +209,6 @@ }, { "cell_type": "markdown", - "id": "19912d42", "metadata": {}, "source": [ "CLMM offers two boost models, the NFW boost model, and a powerlaw boost model. \n", @@ -242,7 +223,6 @@ { "cell_type": "code", "execution_count": null, - "id": "e6b6ee3d", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +235,6 @@ }, { "cell_type": "markdown", - "id": "58cbc299", "metadata": {}, "source": [ "Plot the two boost factors, $B(R)$" @@ -264,7 +243,6 @@ { "cell_type": "code", "execution_count": null, - "id": "1c1de291", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +256,6 @@ }, { "cell_type": "markdown", - "id": "30e8e6a0", "metadata": {}, "source": [ "The $\\Delta\\Sigma$ profiles can be corrected with the boost factor using `correct_sigma_with_boost_values` or `correct_sigma_with_boost_model`. \n", @@ -289,7 +266,6 @@ }, { "cell_type": "markdown", - "id": "6c4daf84", "metadata": {}, "source": [ "\n", @@ -309,7 +285,6 @@ }, { "cell_type": "markdown", - "id": "48e0f2ef", "metadata": {}, "source": [ "First we will apply the boost factor with `correct_sigma_with_boost_values`" @@ -318,7 +293,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d7b5f71d", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +306,6 @@ }, { "cell_type": "markdown", - "id": "15252880", "metadata": {}, "source": [ "Plot the result" @@ -341,7 +314,6 @@ { "cell_type": "code", "execution_count": null, - "id": "e2d90e0c", "metadata": {}, "outputs": [], "source": [ @@ -380,7 +352,6 @@ }, { "cell_type": "markdown", - "id": "caf00c95", "metadata": {}, "source": [ "Now the same again but with `correct_sigma_with_boost_model`" @@ -389,7 +360,6 @@ { "cell_type": "code", "execution_count": null, - "id": "b4b3f953", "metadata": {}, "outputs": [], "source": [ @@ -440,7 +410,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -454,7 +424,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_compute_deltasigma_weights.ipynb b/examples/demo_compute_deltasigma_weights.ipynb index d261446b4..9e4cbe5c1 100644 --- a/examples/demo_compute_deltasigma_weights.ipynb +++ b/examples/demo_compute_deltasigma_weights.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "68dc9675-9e74-434d-aba3-e90e5a0280c6", "metadata": {}, "source": [ "# Weak lensing weights\n", @@ -35,7 +34,6 @@ { "cell_type": "code", "execution_count": null, - "id": "88e8bdd1", "metadata": {}, "outputs": [], "source": [ @@ -63,7 +61,6 @@ { "cell_type": "code", "execution_count": null, - "id": "2b021533-9563-4b7f-9f77-6b9765938e71", "metadata": {}, "outputs": [], "source": [ @@ -73,7 +70,6 @@ { "cell_type": "code", "execution_count": null, - "id": "b8b70cdf", "metadata": {}, "outputs": [], "source": [ @@ -83,7 +79,6 @@ { "cell_type": "code", "execution_count": null, - "id": "4bcd70d3", "metadata": {}, "outputs": [], "source": [ @@ -97,7 +92,6 @@ { "cell_type": "code", "execution_count": null, - "id": "74790332", "metadata": {}, "outputs": [], "source": [ @@ -128,7 +122,6 @@ }, { "cell_type": "markdown", - "id": "d1e1ec03", "metadata": {}, "source": [ "## Compute the WL weights" @@ -136,7 +129,6 @@ }, { "cell_type": "markdown", - "id": "de35fdb0-5551-4a41-8200-e43abca422b8", "metadata": {}, "source": [ "### redshift point estimate + no shape error\n", @@ -148,7 +140,6 @@ }, { "cell_type": "markdown", - "id": "747e99bf", "metadata": {}, "source": [ "#### Using the functional interface\n", @@ -159,7 +150,6 @@ { "cell_type": "code", "execution_count": null, - "id": "3432e008", "metadata": {}, "outputs": [], "source": [ @@ -169,7 +159,6 @@ { "cell_type": "code", "execution_count": null, - "id": "05f947c3", "metadata": {}, "outputs": [], "source": [ @@ -182,7 +171,6 @@ }, { "cell_type": "markdown", - "id": "206a9562", "metadata": {}, "source": [ "#### As a method of the `GalaxyCluster` object\n", @@ -192,7 +180,6 @@ { "cell_type": "code", "execution_count": null, - "id": "0ce7f15d", "metadata": {}, "outputs": [], "source": [ @@ -203,7 +190,6 @@ }, { "cell_type": "markdown", - "id": "b5195cda-4092-470f-a2de-5d9816a8aa70", "metadata": {}, "source": [ "### photoz + no shape errors" @@ -211,7 +197,6 @@ }, { "cell_type": "markdown", - "id": "5f288e2c-32cc-4f35-8744-c66c073b3024", "metadata": {}, "source": [ "When considering the photo-z distribution, we can compute the weight based on an effective critical surface density:\n", @@ -229,7 +214,6 @@ }, { "cell_type": "markdown", - "id": "6355d76b", "metadata": {}, "source": [ "#### Using the functional interface\n", @@ -240,7 +224,6 @@ { "cell_type": "code", "execution_count": null, - "id": "0dbbfa25", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +238,6 @@ { "cell_type": "code", "execution_count": null, - "id": "aee36658", "metadata": {}, "outputs": [], "source": [ @@ -268,7 +250,6 @@ }, { "cell_type": "markdown", - "id": "5285a1a7-e990-4d83-a418-15e04d80a948", "metadata": {}, "source": [ "#### As a method of the `GalaxyCluster` object\n", @@ -279,7 +260,6 @@ { "cell_type": "code", "execution_count": null, - "id": "b56b9478", "metadata": {}, "outputs": [], "source": [ @@ -290,7 +270,6 @@ }, { "cell_type": "markdown", - "id": "8aff3684-360f-4084-9a51-fb5fb407adc7", "metadata": {}, "source": [ "### redshift point estimate + shape error" @@ -298,7 +277,6 @@ }, { "cell_type": "markdown", - "id": "b1f4fd49-4a5a-480a-a67c-046da6dd4b80", "metadata": {}, "source": [ "$$\n", @@ -309,7 +287,6 @@ { "cell_type": "code", "execution_count": null, - "id": "ccfe5c83", "metadata": {}, "outputs": [], "source": [ @@ -330,7 +307,6 @@ }, { "cell_type": "markdown", - "id": "1eb3565f-49b1-40db-986f-0294dad06ad6", "metadata": {}, "source": [ "### photoz + shape error" @@ -338,7 +314,6 @@ }, { "cell_type": "markdown", - "id": "d8cdadd9-3da3-4371-9e12-684aca1d6083", "metadata": {}, "source": [ "$$\n", @@ -349,7 +324,6 @@ { "cell_type": "code", "execution_count": null, - "id": "5e581173", "metadata": {}, "outputs": [], "source": [ @@ -370,7 +344,6 @@ }, { "cell_type": "markdown", - "id": "84764558-67df-470f-93ff-32bd5956b40d", "metadata": {}, "source": [ "With `add=True`, the weights have been added as new columns in the `cl.galcat` Table. A new `sigma_c` column is also automatically added." @@ -379,7 +352,6 @@ { "cell_type": "code", "execution_count": null, - "id": "1d0cdfbc-8ffd-4c7f-b8a5-9ca3dbf1dfc3", "metadata": {}, "outputs": [], "source": [ @@ -388,7 +360,6 @@ }, { "cell_type": "markdown", - "id": "392114b6-08bd-4243-9383-59a0fd3b0014", "metadata": { "tags": [] }, @@ -407,7 +378,6 @@ { "cell_type": "code", "execution_count": null, - "id": "683d2ce5-914c-4abe-96c8-e97f2d07fb43", "metadata": {}, "outputs": [], "source": [ @@ -431,7 +401,6 @@ }, { "cell_type": "markdown", - "id": "f8096f22-4552-46e8-9bfe-4e26667994fe", "metadata": {}, "source": [ "### Vizualizing the results\n", @@ -442,7 +411,6 @@ { "cell_type": "code", "execution_count": null, - "id": "7d6749d0", "metadata": {}, "outputs": [], "source": [ @@ -495,7 +463,6 @@ }, { "cell_type": "markdown", - "id": "70d75c94-60f1-429e-ad6e-6aaacaf48ebb", "metadata": {}, "source": [ "- The galaxy weights increase with the true galaxy redshift (left panel, red dots), i.e. weights take account that galaxies far from the cluster are more sheared than closer ones.\n", @@ -510,7 +477,6 @@ }, { "cell_type": "markdown", - "id": "dff3d90e", "metadata": {}, "source": [ "### Background probability" @@ -518,7 +484,6 @@ }, { "cell_type": "markdown", - "id": "7231e5ec-062a-49ee-a41a-3e2c0d36e5cd", "metadata": {}, "source": [ "The probability for a galaxy with photometric redshift of being in the background of the cluster is given by\n", @@ -530,7 +495,6 @@ { "cell_type": "code", "execution_count": null, - "id": "6481f253", "metadata": {}, "outputs": [], "source": [ @@ -558,7 +522,6 @@ { "cell_type": "code", "execution_count": null, - "id": "8e4e4fcf-84d3-43d6-8bb3-498b5f8121c4", "metadata": {}, "outputs": [], "source": [ @@ -568,7 +531,6 @@ { "cell_type": "code", "execution_count": null, - "id": "3753c288-4a93-40a7-9eb4-efe0bd658f37", "metadata": {}, "outputs": [], "source": [ @@ -580,7 +542,6 @@ { "cell_type": "code", "execution_count": null, - "id": "ffe9ee72", "metadata": {}, "outputs": [], "source": [ @@ -592,7 +553,6 @@ { "cell_type": "code", "execution_count": null, - "id": "cc7b66f7", "metadata": {}, "outputs": [], "source": [ @@ -667,7 +627,6 @@ }, { "cell_type": "markdown", - "id": "5cb9e668-5f92-4614-a04a-b2c7d020b27b", "metadata": {}, "source": [ "The figure above shows the background probability $P(z > z_l)$ for each galaxy.\n", @@ -679,7 +638,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -693,7 +652,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_coordinate_system_datasets.ipynb b/examples/demo_coordinate_system_datasets.ipynb new file mode 100644 index 000000000..acbedfb65 --- /dev/null +++ b/examples/demo_coordinate_system_datasets.ipynb @@ -0,0 +1,1013 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Tests of coordinate system effects on shear profiles\n", + "\n", + "Author: Tomomi Sunayama, July 15, 2024\n", + "\n", + "Tested, modified, and documented by: Camille Avestruz, July 18, 2024\n", + "\n", + "Reviewed by: Caio Lima de Oliveira, July 19, 2024\n", + "\n", + "This notebook illustrates the impact of having an incorrect coordinate system when calculating shear profiles. The default coordinate system for `CLMM` is the euclidean/pixel coordinate system. This is consistent with DC2 catalogs. However, if we input a catalog that assumes a celestial (sky) coordinate system and use the default euclidean (pixel) coordinate system (or vice versa), the signal of shear around a cluster disappears because the signal essentially looks random.\n", + "\n", + "We test:\n", + "- CosmoDC2 source galaxies with shears extracted from `TXPipe` for a single galaxy cluster (euclidean/pixel coordinate system)\n", + "- Example source galaxies for galaxy clusters from a [Summer School](https://github.com/oguri/wlcluster_tutorial) taught by Masamune Oguri (euclidean/pixel coordinate system)\n", + "- HSC Y3 source galaxies with shears post processed by Tomomi Sunayama (celestial/sky coordinate system)\n", + "\n", + "We also \n", + "- Compare the explicit calculation of a shear profile on the HSC Y3 source galaxies against a profile produced from `CLMM`. \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Instructions to download text data\n", + "\n", + "Before running this notebook, you will need to download some data. The data is available through a [dropbox link](https://www.dropbox.com/scl/fo/dwsccslr5iwb7lnkf8jvx/AJkjgFeemUEHpHaZaHHqpAg?rlkey=efbtsr15mdrs3y6xsm7l48o0r&st=xb58ap0g&dl=0)\n", + "\n", + "First, create a directory where you want to put the example data, e.g. for a given `data_coords_dir`:\n", + "```\n", + "mkdir -p /data_coords\n", + "cd /data_coords\n", + "```\n", + "Download all files from [dropbox link](https://www.dropbox.com/scl/fo/dwsccslr5iwb7lnkf8jvx/AJkjgFeemUEHpHaZaHHqpAg?rlkey=efbtsr15mdrs3y6xsm7l48o0r&st=xb58ap0g&dl=0). This will be a zip file, `CLMM_data.zip` of size 242 Mb. scp or move this to `data_coords_dir`.\n", + "\n", + "From the directory, you should be able to unzip:\n", + "```\n", + "unzip data_CLMM.zip -d .\n", + "```\n", + "You now have the necessary data files to run this notebook. \n", + "\n", + "**Make sure to change the `data_coords_dir` variable in the cell below to the appropriate location where you unzipped these files.**\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# CHANGE TO YOUR LOCATION\n", + "data_coords_dir = \"/data_coords/\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "# %matplotlib inline\n", + "from astropy.table import Table\n", + "import pickle as pkl\n", + "from pathlib import Path\n", + "import pandas\n", + "from astropy.io import fits" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "from clmm import Cosmology\n", + "\n", + "cosmo = Cosmology(H0=70.0, Omega_dm0=0.27 - 0.045, Omega_b0=0.045, Omega_k0=0.0)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example galaxy cluster from CosmoDC2\n", + "\n", + "Here, we plot an example galaxy cluster shear profile using `clmm`. The cluster and source galaxy files are generated from the CosmoDC2 processed through TXPipe. We test the coordinate system." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cluster = pandas.read_pickle(data_coords_dir + \"/test_cluster.pkl\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cluster_z = cluster[\"redshift\"] # Cluster redshift\n", + "cluster_ra = cluster[\"ra\"] # Cluster Ra in deg\n", + "cluster_dec = cluster[\"dec\"]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "source = np.genfromtxt(data_coords_dir + \"/test_source.txt\", names=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "gal_ra = source[\"ra\"]\n", + "gal_dec = source[\"dec\"]\n", + "gal_e1 = source[\"e1\"]\n", + "gal_e2 = source[\"e2\"]\n", + "gal_z = source[\"zmean\"]\n", + "gal_id = np.arange(len(source[\"ra\"]))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import clmm\n", + "import clmm.dataops as da\n", + "from clmm.utils import convert_units\n", + "\n", + "# Create a GCData with the galaxies.\n", + "galaxies = clmm.GCData(\n", + " [gal_ra, gal_dec, gal_e1, gal_e2, gal_z, gal_id], names=[\"ra\", \"dec\", \"e1\", \"e2\", \"z\", \"id\"]\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we create a `GalaxyCluster` object, specifying an *incorrect* coordinate system. For source galaxies from CosmoDC2, these are in the **euclidean** coordinate system. We use the implemented kwarg when defining the galaxy cluster object to specify the **celestial** coordinate system." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Create a GalaxyCluster.\n", + "cluster = clmm.GalaxyCluster(\n", + " \"Name of cluster\", cluster_ra, cluster_dec, cluster_z, galaxies, coordinate_system=\"celestial\"\n", + ")\n", + "\n", + "# Convert elipticities into shears for the members.\n", + "cluster.compute_tangential_and_cross_components()\n", + "print(cluster.galcat.colnames)\n", + "\n", + "# Measure profile and add profile table to the cluster.\n", + "seps = convert_units(cluster.galcat[\"theta\"], \"radians\", \"Mpc\", cluster.z, cosmo)\n", + "\n", + "cluster.make_radial_profile(\n", + " bins=da.make_bins(0.1, 3.0, 15, method=\"evenlog10width\"),\n", + " bin_units=\"Mpc\",\n", + " cosmo=cosmo,\n", + " include_empty_bins=False,\n", + " gal_ids_in_bins=True,\n", + ")\n", + "print(cluster.profile.colnames)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here, we plot the resulting profile when `clmm` uses assumes a coordinate system inconsistent with the catalogs provided. You will note that the signal is virtually zero at almost all radii." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(6, 4))\n", + "ax = fig.add_axes((0, 0, 1, 1))\n", + "errorbar_kwargs = dict(linestyle=\"\", marker=\"o\", markersize=1, elinewidth=0.5, capthick=0.5)\n", + "ax.errorbar(\n", + " cluster.profile[\"radius\"],\n", + " cluster.profile[\"gt\"],\n", + " cluster.profile[\"gt_err\"],\n", + " c=\"k\",\n", + " **errorbar_kwargs\n", + ")\n", + "ax.set_xlabel(\"r [Mpc]\", fontsize=10)\n", + "ax.set_ylabel(r\"$g_t$\", fontsize=10)\n", + "ax.grid(lw=0.3)\n", + "ax.minorticks_on()\n", + "ax.grid(which=\"minor\", lw=0.1)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we create a `GalaxyCluster` object, specifying the *correct* coordinate system. For source galaxies from CosmoDC2, these are in the **euclidean** coordinate system. We use the implemented kwarg when defining the galaxy cluster object to also specify the **euclidean** coordinate system. However, with a single galaxy cluster, the signal is not significant enough to clearly see a difference. There is a possible excess excess with the correct coordinate system at larger radii. Note: First, the lensing signal in CosmoDC2 clusters at the inner radii is known to be weak due to a limitation in the resolution when the ray tracing was performed in generating the source galaxy shears. Second, this has been process through `TXPipe`, which is something else we will need to understand." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cluster2 = clmm.GalaxyCluster(\n", + " \"Name of cluster\", cluster_ra, cluster_dec, cluster_z, galaxies, coordinate_system=\"euclidean\"\n", + ")\n", + "cluster2.compute_tangential_and_cross_components()\n", + "print(cluster.galcat.colnames)\n", + "\n", + "# Measure profile and add profile table to the cluster.\n", + "seps = convert_units(cluster2.galcat[\"theta\"], \"radians\", \"Mpc\", cluster2.z, cosmo)\n", + "\n", + "cluster2.make_radial_profile(\n", + " bins=da.make_bins(0.1, 3.0, 15, method=\"evenlog10width\"),\n", + " bin_units=\"Mpc\",\n", + " cosmo=cosmo,\n", + " include_empty_bins=False,\n", + " gal_ids_in_bins=True,\n", + ")\n", + "print(cluster.profile.colnames)\n", + "fig = plt.figure(figsize=(6, 4))\n", + "ax = fig.add_axes((0, 0, 1, 1))\n", + "errorbar_kwargs = dict(linestyle=\"\", marker=\"o\", markersize=1, elinewidth=0.5, capthick=0.5)\n", + "ax.errorbar(\n", + " cluster.profile[\"radius\"], cluster.profile[\"gt\"], cluster.profile[\"gt_err\"], label=\"celestial\"\n", + ")\n", + "ax.errorbar(\n", + " cluster2.profile[\"radius\"],\n", + " cluster2.profile[\"gt\"],\n", + " cluster2.profile[\"gt_err\"],\n", + " label=\"euclidean\",\n", + ")\n", + "ax.set_xlabel(\"r [Mpc]\", fontsize=20)\n", + "ax.set_ylabel(r\"$g_t$\", fontsize=20)\n", + "ax.grid(lw=0.3)\n", + "ax.minorticks_on()\n", + "ax.grid(which=\"minor\", lw=0.1)\n", + "plt.legend(fontsize=20)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example source galaxies from M. Oguri\n", + "\n", + "This dataset is a curated selection of cluster and source catalogs from Summer School lectures delivered by Masamune Oguri. There are eight galaxy clusters in this selection. \n", + "\n", + "More details on the corresponding tutorial can be found at this [GitHub link](https://github.com/oguri/wlcluster_tutorial). These are also in the **euclidean** coordinate system." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "clusters = [\n", + " \"a1703\",\n", + " \"gho1320\",\n", + " \"sdss0851\",\n", + " \"sdss1050\",\n", + " \"sdss1138\",\n", + " \"sdss1226\",\n", + " \"sdss1329\",\n", + " \"sdss1531\",\n", + "]\n", + "\n", + "zl_all = {\n", + " \"a1703\": 0.277,\n", + " \"gho1320\": 0.308,\n", + " \"sdss0851\": 0.370,\n", + " \"sdss1050\": 0.60,\n", + " \"sdss1138\": 0.451,\n", + " \"sdss1226\": 0.435,\n", + " \"sdss1329\": 0.443,\n", + " \"sdss1531\": 0.335,\n", + "}\n", + "\n", + "ra_cl_all = {\n", + " \"a1703\": 198.771833,\n", + " \"gho1320\": 200.703208,\n", + " \"sdss0851\": 132.911917,\n", + " \"sdss1050\": 162.666250,\n", + " \"sdss1138\": 174.537292,\n", + " \"sdss1226\": 186.712958,\n", + " \"sdss1329\": 202.393708,\n", + " \"sdss1531\": 232.794167,\n", + "}\n", + "\n", + "dec_cl_all = {\n", + " \"a1703\": 51.817389,\n", + " \"gho1320\": 31.654944,\n", + " \"sdss0851\": 33.518361,\n", + " \"sdss1050\": 0.285306,\n", + " \"sdss1138\": 27.908528,\n", + " \"sdss1226\": 21.831194,\n", + " \"sdss1329\": 22.721167,\n", + " \"sdss1531\": 34.240278,\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cname = \"a1703\"\n", + "\n", + "# cluster redshift\n", + "zl = zl_all.get(cname)\n", + "\n", + "# coordinates of the cluster center\n", + "ra_cl = ra_cl_all.get(cname)\n", + "dec_cl = dec_cl_all.get(cname)\n", + "\n", + "# fix source redshift to 1.0\n", + "zs = 1.0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We inspect the first galaxy cluster, Abell 1703." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "rfile = data_coords_dir + \"/data/shear_\" + cname + \".dat\"\n", + "data = np.loadtxt(rfile, comments=\"#\")\n", + "\n", + "ra = data[:, 0]\n", + "dec = data[:, 1]\n", + "e1 = data[:, 2]\n", + "e2 = data[:, 3]\n", + "wei = data[:, 4]\n", + "ids = np.arange(np.shape(data)[0])\n", + "redshifts = np.ones(np.shape(data)[0])\n", + "galaxies = clmm.GCData(\n", + " [ra, dec, e1, e2, redshifts, ids], names=[\"ra\", \"dec\", \"e1\", \"e2\", \"z\", \"id\"]\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here we create a GalaxyCluster object, specifying the correct coordinate system. For source galaxies from the Oguri curated dataset, these are in the euclidean coordinate system. We use the implemented kwarg when defining the galaxy cluster object to also **specify the euclidean coordinate system**." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cluster = clmm.GalaxyCluster(\"A1703euc\", ra_cl, dec_cl, zl, galaxies, coordinate_system=\"euclidean\")\n", + "\n", + "# Convert elipticities into shears for the members.\n", + "cluster.compute_tangential_and_cross_components()\n", + "print(cluster.galcat.colnames)\n", + "\n", + "# Measure profile and add profile table to the cluster.\n", + "seps = convert_units(cluster.galcat[\"theta\"], \"radians\", \"Mpc\", cluster.z, cosmo)\n", + "\n", + "cluster.make_radial_profile(\n", + " bins=da.make_bins(0.2, 3.0, 8, method=\"evenlog10width\"),\n", + " bin_units=\"Mpc\",\n", + " cosmo=cosmo,\n", + " include_empty_bins=False,\n", + " gal_ids_in_bins=True,\n", + ")\n", + "print(cluster.profile.colnames)\n", + "\n", + "\n", + "fig = plt.figure(figsize=(6, 4))\n", + "ax = fig.add_axes((0, 0, 1, 1))\n", + "errorbar_kwargs = dict(linestyle=\"\", marker=\"o\", markersize=1, elinewidth=0.5, capthick=0.5)\n", + "ax.errorbar(\n", + " cluster.profile[\"radius\"], cluster.profile[\"gt\"], cluster.profile[\"gt_err\"], label=\"euclidean\"\n", + ")\n", + "\n", + "# assume incorrect coordinates\n", + "cluster2 = clmm.GalaxyCluster(\n", + " \"A1703cel\", ra_cl, dec_cl, zl, galaxies, coordinate_system=\"celestial\"\n", + ")\n", + "\n", + "cluster2.compute_tangential_and_cross_components()\n", + "print(cluster2.galcat.colnames)\n", + "\n", + "# Measure profile and add profile table to the cluster.\n", + "seps = convert_units(cluster2.galcat[\"theta\"], \"radians\", \"Mpc\", cluster.z, cosmo)\n", + "\n", + "cluster2.make_radial_profile(\n", + " bins=da.make_bins(0.2, 3.0, 8, method=\"evenlog10width\"),\n", + " bin_units=\"Mpc\",\n", + " cosmo=cosmo,\n", + " include_empty_bins=False,\n", + " gal_ids_in_bins=True,\n", + ")\n", + "print(cluster2.profile.colnames)\n", + "\n", + "ax.errorbar(\n", + " cluster2.profile[\"radius\"],\n", + " cluster2.profile[\"gt\"],\n", + " cluster2.profile[\"gt_err\"],\n", + " label=\"celestial\",\n", + ")\n", + "\n", + "\n", + "ax.set_xlabel(\"r [Mpc]\", fontsize=20)\n", + "ax.set_ylabel(r\"$g_t$\", fontsize=20)\n", + "ax.grid(lw=0.3)\n", + "ax.minorticks_on()\n", + "ax.grid(which=\"minor\", lw=0.1)\n", + "plt.legend(fontsize=20)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example source galaxies from HSC Y3\n", + "\n", + "This dataset is a simplified version of HSC Y3 data (GAMA15H), post-processed by Tomomi Sunayama for testing purposes. The pre-processed data is already public. These catalogs assume a **celestial** coordinate system." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cluster_cat = np.genfromtxt(\n", + " data_coords_dir + \"/GAMA15H/redmapper_dr8_GAMA15H.txt\",\n", + " dtype=np.dtype(\n", + " [(\"ra\", np.float64), (\"dec\", np.float64), (\"z\", np.float64), (\"richness\", np.float64)]\n", + " ),\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "source_cat = fits.getdata(data_coords_dir + \"/GAMA15H/GAMA15H_tutorial.fits\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cl = cluster_cat[0]" + ] + }, + { + "cell_type": "markdown", + "id": "8820c46a", + "metadata": {}, + "source": [ + "Here, we use a KDTree implementation in scipy to extract the background source galaxies for the first galaxy cluster in the dataset." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from scipy import spatial\n", + "\n", + "source1 = source_cat[source_cat[\"photoz\"] > (cl[\"z\"] + 0.3)]\n", + "tree = spatial.cKDTree(np.array((source1[\"ra\"], source1[\"dec\"])).T)\n", + "sel = tree.query_ball_point([cl[\"ra\"], cl[\"dec\"]], 3)\n", + "bg = source1[sel]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf2df4dc", + "metadata": {}, + "outputs": [], + "source": [ + "# Inspect background source galaxy selection\n", + "bg" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a77e1bfe", + "metadata": {}, + "outputs": [], + "source": [ + "sources = clmm.GCData(\n", + " [bg[\"RA\"], bg[\"Dec\"], bg[\"e1\"], bg[\"e2\"], bg[\"photoz\"], bg[\"weight\"]],\n", + " names=[\"ra\", \"dec\", \"e1\", \"e2\", \"z\", \"w_ls\"],\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "45d76a13", + "metadata": {}, + "outputs": [], + "source": [ + "cluster = clmm.GalaxyCluster(\n", + " \"redmapper\", cl[\"ra\"], cl[\"dec\"], cl[\"z\"], sources, coordinate_system=\"celestial\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b1f88b26", + "metadata": {}, + "outputs": [], + "source": [ + "sigma_c = cosmo.eval_sigma_crit(cl[\"z\"], sources[\"z\"])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6de9c9de", + "metadata": {}, + "outputs": [], + "source": [ + "cluster.compute_tangential_and_cross_components(\n", + " shape_component1=\"e1\",\n", + " shape_component2=\"e2\",\n", + " tan_component=\"DS_t\",\n", + " cross_component=\"DS_x\",\n", + " cosmo=cosmo,\n", + " is_deltasigma=True,\n", + " use_pdz=False,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5fa13fb2", + "metadata": {}, + "outputs": [], + "source": [ + "cluster" + ] + }, + { + "cell_type": "markdown", + "id": "a4dcd4a7", + "metadata": {}, + "source": [ + "Now we construct a radial profile of the tangential and cross terms for the galaxy cluster" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "seps = convert_units(cluster.galcat[\"theta\"], \"radians\", \"Mpc\", cluster.z, cosmo)\n", + "\n", + "cluster.make_radial_profile(\n", + " tan_component_in=\"DS_t\",\n", + " cross_component_in=\"DS_x\",\n", + " tan_component_out=\"DS_t\",\n", + " cross_component_out=\"DS_x\",\n", + " weights_in=\"w_ls\",\n", + " bins=da.make_bins(0.1, 20.0, 15, method=\"evenlog10width\"),\n", + " bin_units=\"Mpc\",\n", + " cosmo=cosmo,\n", + " include_empty_bins=False,\n", + " gal_ids_in_bins=False,\n", + ")\n", + "print(cluster.profile.colnames)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "286dc0f9", + "metadata": {}, + "outputs": [], + "source": [ + "fig = plt.figure(figsize=(6, 6))\n", + "ax = fig.add_axes((0, 0, 1, 1))\n", + "errorbar_kwargs = dict(linestyle=\"\", marker=\"o\", markersize=1, elinewidth=0.5, capthick=0.5)\n", + "ax.errorbar(\n", + " cluster.profile[\"radius\"],\n", + " cluster.profile[\"DS_t\"] / 1e13,\n", + " cluster.profile[\"DS_t_err\"] / 1e13,\n", + " label=\"celestial\",\n", + ")\n", + "plt.loglog()\n", + "\n", + "ax.set_xlabel(\"r [Mpc]\", fontsize=20)\n", + "ax.set_ylabel(r\"$\\Delta\\Sigma(r)$\", fontsize=20)\n", + "ax.grid(lw=0.3)\n", + "ax.minorticks_on()\n", + "ax.grid(which=\"minor\", lw=0.1)\n", + "plt.legend(fontsize=20)\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "id": "05e4ee26", + "metadata": {}, + "source": [ + "## Example explicit lensing profile measurement comparison with CLMM profile\n", + "\n", + "Here, we use the example HSC Y3 dataset to explicitly measure the lensing signal without using CLMM for comparison. Note, we need to still define a cosmology to calculate comoving distances." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "651e0048", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from astropy.io import fits\n", + "import matplotlib as mpl\n", + "import matplotlib.pyplot as plt\n", + "from scipy import spatial\n", + "from astropy.cosmology import WMAP5" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dbefe49d", + "metadata": {}, + "outputs": [], + "source": [ + "# Read in the data\n", + "cluster_cat = np.genfromtxt(\n", + " data_coords_dir + \"GAMA15H/redmapper_dr8_GAMA15H.txt\",\n", + " dtype=np.dtype(\n", + " [(\"RA\", np.float64), (\"Dec\", np.float64), (\"z\", np.float64), (\"richness\", np.float64)]\n", + " ),\n", + ")\n", + "source_cat = fits.getdata(data_coords_dir + \"GAMA15H/GAMA15H_tutorial.fits\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a826c6e0", + "metadata": {}, + "outputs": [], + "source": [ + "cosmo = WMAP5" + ] + }, + { + "cell_type": "markdown", + "id": "ca4bd885", + "metadata": {}, + "source": [ + "Below, we measure lensing signals with simplified assumptions. We do not account for responsivity, multiplicative, nor additive biases. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "3fdca16e", + "metadata": {}, + "outputs": [], + "source": [ + "# Define functions for the explicit calculation\n", + "\n", + "\n", + "def calcDistanceAngle(a1, d1, a2, d2):\n", + " \"\"\"Compute the angle between lens and source galaxies from ra, dec in radians\n", + " a1 (float, ndarray) : lens RA in radians\n", + " d1 (float, ndarray) : lens DEC in radians\n", + " a2 (float, ndarray) : src RA in radians\n", + " d2 (float, ndarray) : src DEC in radians\n", + " \"\"\"\n", + " return np.arccos(np.cos(d1) * np.cos(d2) * np.cos(a1 - a2) + np.sin(d1) * np.sin(d2))\n", + "\n", + "\n", + "def cosPhi2(a1, a2, d1, d2, distanceAngle):\n", + " \"\"\"Compute $\\cos(2\\phi)$ for a given distance angle between lens and source galaxies from ra, dec in radians\n", + " a1 (float, ndarray) : lens RA in radians\n", + " a2 (float, ndarray) : src RA in radians\n", + " d1 (float, ndarray) : lens DEC in radians\n", + " d2 (float, ndarray) : src DEC in radians\n", + " distanceAngle (float, ndarray) : angular distance between lens and source in radians\n", + " \"\"\"\n", + " return np.sin(a2 - a1) * np.cos(d1) / np.sin(distanceAngle)\n", + "\n", + "\n", + "def sinPhi2(a1, a2, d1, d2, distanceAngle):\n", + " \"\"\"Compute $\\sin(2\\phi)$ for a given distance angle between lens and source galaxies from ra, dec in radians\n", + " a1 (float, ndarray) : lens RA in radians\n", + " a2 (float, ndarray) : src RA in radians\n", + " d1 (float, ndarray) : lens DEC in radians\n", + " d2 (float, ndarray) : src DEC in radians\n", + " distanceAngle (float, ndarray) : angular distance between lens and source in radians\n", + " \"\"\"\n", + " return (-np.cos(d2) * np.sin(d1) + np.sin(d2) * np.cos(d1) * np.cos(a1 - a2)) / np.sin(\n", + " distanceAngle\n", + " )\n", + "\n", + "\n", + "def compute_sin2phi_cos2phi(a1, a2, d1, d2, distanceAngle):\n", + " \"\"\"Compute necessary coefficients for the et and ex components, sin2phi and cos2phi\n", + " a1 (float, ndarray) : lens RA in radians\n", + " a2 (float, ndarray) : src RA in radians\n", + " d1 (float, ndarray) : lens DEC in radians\n", + " d2 (float, ndarray) : src DEC in radians\n", + " distanceAngle (float, ndarray) : angular distance between lens and source in radians\n", + " \"\"\"\n", + " cosp = cosPhi2(a1, a2, d1, d2, distanceAngle)\n", + " sinp = sinPhi2(a1, a2, d1, d2, distanceAngle)\n", + " cos2p = cosp**2 - sinp**2\n", + " sin2p = 2.0 * sinp * cosp\n", + " return cos2p, sin2p\n", + "\n", + "\n", + "def calc_et_ex(e1, e2, cos2p, sin2p):\n", + " \"\"\"Calculate the et and ex from the e1 e2 values of all sources and their sin2phi, cos2phi\"\"\"\n", + " et = -(e1 * cos2p + e2 * sin2p)\n", + " ex = -(-e1 * sin2p + e2 * cos2p)\n", + " return et, ex\n", + "\n", + "\n", + "def populate_profile_sums(ps, i_r, src_in_bin, Sigma_cr, sel, et, ex):\n", + " \"\"\"Populate the profile sums at a given radian bin from the calculated selection, sigma_crit, et, and ex\"\"\"\n", + " ps[\"n\"][i_r] += sel.sum()\n", + " ps[\"e_sq\"][i_r] += np.sum(et**2 + ex**2)\n", + "\n", + " wt = src_in_bin[\"weight\"] * Sigma_cr**-2 # multiply by the lens weights if it is not one\n", + " ps[\"w\"][i_r] += np.sum(wt)\n", + "\n", + " wetsigma = wt * Sigma_cr * et\n", + " ps[\"wetsigma\"][i_r] += np.sum(wetsigma)\n", + " ps[\"wetsigma_sq\"][i_r] += np.sum(wetsigma**2)\n", + "\n", + " wexsigma = wt * Sigma_cr * ex\n", + " ps[\"wexsigma\"][i_r] += np.sum(wexsigma)\n", + " ps[\"wexsigma_sq\"][i_r] += np.sum(wexsigma**2)\n", + "\n", + " wsigmainv = wt * 1.0 / Sigma_cr\n", + " ps[\"wsigmainv\"][i_r] += np.sum(wsigmainv)\n", + "\n", + " wzs = wt * src_in_bin[\"photoz\"]\n", + " ps[\"wzs\"][i_r] += np.sum(wzs)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f343ae7c", + "metadata": {}, + "outputs": [], + "source": [ + "# Relevant constants, radial binning, source photoz range and lens photoz range\n", + "\n", + "d2r = np.pi / 180.0\n", + "r2d = 180.0 / np.pi\n", + "Mpc = 3.08568025 * 10**19 # 1Mpc = 3.08568025*10**19 km\n", + "M_sun = 1.9884 * 10**33 # solar mass [g]\n", + "c_light = 2.99792458 * 10**5 # speed of light [km/s]\n", + "G = 6.67384 * 10 ** (-20) # gravitational constant [km^3s^-2kg^-1]\n", + "Sigma_cr_fact = c_light**2 / (4 * np.pi * G) * Mpc * 10**3 / M_sun\n", + "rbin_edges = np.logspace(-1, np.log10(20), 15) # Define your radial bins\n", + "\n", + "# Named numpy arrays for relevant profile values to explicitly compute and sum at each radii\n", + "profile_names = [\n", + " \"e_sq\",\n", + " \"w\",\n", + " \"wetsigma\",\n", + " \"wetsigma_sq\",\n", + " \"wexsigma\",\n", + " \"wexsigma_sq\",\n", + " \"wsigmainv\",\n", + " \"wzs\",\n", + " \"n\",\n", + "]\n", + "profile_sums = np.rec.fromarrays(\n", + " [np.zeros(len(rbin_edges) - 1) for i in profile_names], names=profile_names\n", + ")\n", + "\n", + "source_pz = {\"min\": 0.5, \"max\": 10}\n", + "lens_pz = {\"min\": 0.1, \"max\": 0.2}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8da9ec37", + "metadata": {}, + "outputs": [], + "source": [ + "# Select lens clusters and source galaxies from catalogs using kdtree\n", + "\n", + "source_pz_criteria = (source_cat[\"photoz\"] < source_pz[\"max\"]) & (\n", + " source_cat[\"photoz\"] > source_pz[\"min\"]\n", + ")\n", + "selected_sources = source_cat[source_pz_criteria]\n", + "\n", + "tree = spatial.cKDTree(np.array((selected_sources[\"RA\"], selected_sources[\"Dec\"])).T)\n", + "\n", + "# We only select one,selecting many will take much more time to compute.\n", + "lens_pz_criteria = (cluster_cat[\"z\"] > lens_pz[\"min\"]) & (cluster_cat[\"z\"] < lens_pz[\"max\"])\n", + "lens_clusters = cluster_cat[lens_pz_criteria][:1]\n", + "\n", + "# Set weights for the cluster lenses to one\n", + "lens_weights = np.ones(lens_clusters.size)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "972bdfcb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "# Calculate lensing profiles for each cluster lens\n", + "\n", + "for ilens in np.arange(lens_clusters.size):\n", + "\n", + " # Select source galaxies for this cluster lens\n", + " sel = tree.query_ball_point([lens_clusters[\"RA\"][ilens], lens_clusters[\"Dec\"][ilens]], 3)\n", + " sel_z = (\n", + " source_cat[sel][\"photoz\"] > lens_clusters[\"z\"][ilens]\n", + " ) # Try to change the source galaxy selection\n", + " source_bg = source_cat[sel][sel_z]\n", + "\n", + " # Compute an angle between the lens and the source\n", + " theta_ls = calcDistanceAngle(\n", + " lens_clusters[\"RA\"][ilens] * d2r,\n", + " lens_clusters[\"Dec\"][ilens] * d2r,\n", + " source_bg[\"RA\"] * d2r,\n", + " source_bg[\"Dec\"] * d2r,\n", + " )\n", + "\n", + " # Compute the comoving distance of the lens\n", + " l_chi = cosmo.comoving_distance((lens_clusters[\"z\"][ilens])).value\n", + " r = theta_ls * l_chi\n", + " assign_r = np.digitize(r, rbin_edges)\n", + "\n", + " for i_r in range(len(rbin_edges) - 1):\n", + " # Subselection mask of source galaxies in the radial bin\n", + " sel = assign_r == i_r + 1\n", + "\n", + " # Subselected source galaxies and their respective angle, theta, to lens\n", + " source_bg_inbin = source_bg[sel]\n", + " theta_sub = theta_ls[sel]\n", + "\n", + " # Compute the cos(2*phi) and sin(2*phi) for a given distance angle between lens and source galaxies\n", + " cos2p, sin2p = compute_sin2phi_cos2phi(\n", + " lens_clusters[\"RA\"][ilens] * d2r,\n", + " source_bg_inbin[\"RA\"] * d2r,\n", + " lens_clusters[\"Dec\"][ilens] * d2r,\n", + " source_bg_inbin[\"Dec\"] * d2r,\n", + " theta_sub,\n", + " )\n", + "\n", + " # Calculate tangential and cross terms from e1, e2 of all source galaxies in the rbin\n", + " et, ex = calc_et_ex(source_bg_inbin[\"e1\"], source_bg_inbin[\"e2\"], cos2p, sin2p)\n", + "\n", + " # Calculate critical surface mass density [M_sun/ comoving Mpc^2]. (1+zl)**-2 is for comoving coordinates.\n", + " comoving_distance = cosmo.comoving_distance((source_bg_inbin[\"photoz\"])).value\n", + " Sigma_cr = (\n", + " Sigma_cr_fact\n", + " / (1.0 - l_chi / comoving_distance)\n", + " / l_chi\n", + " / (1.0 + lens_clusters[\"z\"][ilens])\n", + " / 10**12\n", + " )\n", + "\n", + " # Populate the profile_sums at this radial bin for this cluster lens\n", + " populate_profile_sums(profile_sums, i_r, source_bg_inbin, Sigma_cr, sel, et, ex)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8078ef52", + "metadata": {}, + "outputs": [], + "source": [ + "# Compute the lensing signal and errors to plot\n", + "\n", + "radial_bin = (\n", + " 2.0\n", + " * (rbin_edges[1:] ** 3 - rbin_edges[:-1] ** 3)\n", + " / (3.0 * (rbin_edges[1:] ** 2 - rbin_edges[:-1] ** 2))\n", + ")\n", + "gt = 0.5 * profile_sums[\"wetsigma\"] / profile_sums[\"w\"]\n", + "gt_err = 0.5 * np.sqrt(profile_sums[\"wetsigma_sq\"]) / profile_sums[\"w\"]\n", + "gx = 0.5 * profile_sums[\"wexsigma\"] / profile_sums[\"w\"]\n", + "gx_err = 0.5 * np.sqrt(profile_sums[\"wexsigma_sq\"]) / profile_sums[\"w\"]\n", + "sigma_cr = 1.0 / (profile_sums[\"wsigmainv\"] / profile_sums[\"w\"])" + ] + }, + { + "cell_type": "markdown", + "id": "4f4756df", + "metadata": {}, + "source": [ + "Below, we compare the explicitly calculated lensing signal against the CLMM calculated signal. You will notice that the `CLMM` calculated profile is systematically lower than the one calculated using Tomomi's code. This is likely due to a combination of assumed weighting scheme and other factors that differ between HSC post-processing and what `CLMM` assumes or a \"little h\" problem, which we will need to understand and possibly address." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Figure for the lensing signal\n", + "plt.figure(figsize=(6, 6))\n", + "\n", + "# From explicit calculation\n", + "plt.errorbar(radial_bin, gt, yerr=gt_err, label=\"original\")\n", + "\n", + "# From CLMM\n", + "plt.errorbar(\n", + " cluster.profile[\"radius\"],\n", + " cluster.profile[\"DS_t\"] / 1e13,\n", + " cluster.profile[\"DS_t_err\"] / 1e13,\n", + " label=\"CLMM\",\n", + ")\n", + "plt.loglog()\n", + "plt.legend(fontsize=20)\n", + "plt.xlabel(r\"$R[h^{-1}{\\rm Mpc}]$\", fontsize=20)\n", + "plt.ylabel(r\"$\\Delta\\Sigma(R)$\", fontsize=20)" + ] + } + ], + "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.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/demo_dataops_functionality.ipynb b/examples/demo_dataops_functionality.ipynb index d26413402..a985af223 100644 --- a/examples/demo_dataops_functionality.ipynb +++ b/examples/demo_dataops_functionality.ipynb @@ -505,7 +505,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "- e.g., generate 20 bins between 1 and 6 Mpc, each contaning the same number of galaxies" + " e.g., generate 20 bins between 1 and 6 Mpc, each contaning the same number of galaxies" ] }, { @@ -794,7 +794,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -808,7 +808,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.4" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_mass_conversion.ipynb b/examples/demo_mass_conversion.ipynb index 3cb6e9aa8..587d5243b 100644 --- a/examples/demo_mass_conversion.ipynb +++ b/examples/demo_mass_conversion.ipynb @@ -384,7 +384,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -398,7 +398,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_mock_ensemble.ipynb b/examples/demo_mock_ensemble.ipynb index 84354b111..fd3c734db 100644 --- a/examples/demo_mock_ensemble.ipynb +++ b/examples/demo_mock_ensemble.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "ee163bf2", "metadata": {}, "source": [ "# Generate mock data for a cluster ensemble\n", @@ -12,7 +11,6 @@ { "cell_type": "code", "execution_count": null, - "id": "7d8e5d58", "metadata": {}, "outputs": [], "source": [ @@ -37,7 +35,6 @@ { "cell_type": "code", "execution_count": null, - "id": "47314c70-58d9-4e9d-8053-f424767c9926", "metadata": {}, "outputs": [], "source": [ @@ -47,7 +44,6 @@ { "cell_type": "code", "execution_count": null, - "id": "0a88a2e2", "metadata": {}, "outputs": [], "source": [ @@ -56,7 +52,6 @@ }, { "cell_type": "markdown", - "id": "df55d889", "metadata": {}, "source": [ "## Generating a cluster catalog and associated source catalogs\n", @@ -66,7 +61,6 @@ { "cell_type": "code", "execution_count": null, - "id": "910f87b4", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +90,6 @@ }, { "cell_type": "markdown", - "id": "ed013971", "metadata": {}, "source": [ "### Background galaxy catalog generation\n", @@ -116,7 +109,6 @@ { "cell_type": "code", "execution_count": null, - "id": "9e662adc-6d92-4c8a-87a3-926c47567e73", "metadata": {}, "outputs": [], "source": [ @@ -130,7 +122,6 @@ { "cell_type": "code", "execution_count": null, - "id": "60d9e41b", "metadata": {}, "outputs": [], "source": [ @@ -196,7 +187,6 @@ { "cell_type": "code", "execution_count": null, - "id": "544e0b75-0a5e-4506-bc35-63314c6b508c", "metadata": {}, "outputs": [], "source": [ @@ -205,7 +195,6 @@ }, { "cell_type": "markdown", - "id": "a7f6a520", "metadata": {}, "source": [ "## Creating ClusterEnsemble object and estimation of individual excess surface density profiles\n", @@ -222,7 +211,6 @@ { "cell_type": "code", "execution_count": null, - "id": "cdb973ec", "metadata": {}, "outputs": [], "source": [ @@ -246,7 +234,6 @@ }, { "cell_type": "markdown", - "id": "774b45da", "metadata": {}, "source": [ "There is also the option to create an `ClusterEnsemble` object without the clusters list. Then, the user may compute the individual profile for each wanted cluster and compute the radial profile once all the indvidual profiles have been computed. This method may be reccomended if there a large number of clusters to avoid excess of memory allocation, since the user can generate each cluster separately, compute its individual profile and then delete the cluster object. " @@ -255,7 +242,6 @@ { "cell_type": "code", "execution_count": null, - "id": "dff912bc", "metadata": {}, "outputs": [], "source": [ @@ -278,7 +264,6 @@ }, { "cell_type": "markdown", - "id": "dce0a7da", "metadata": {}, "source": [ "A third option is where all clusters already have the profile computed, and we just add those to the `ClusterEnsemble` object:" @@ -287,7 +272,6 @@ { "cell_type": "code", "execution_count": null, - "id": "489277dd", "metadata": {}, "outputs": [], "source": [ @@ -310,7 +294,6 @@ { "cell_type": "code", "execution_count": null, - "id": "9de6b261-f1aa-4b43-941b-d415462fec95", "metadata": {}, "outputs": [], "source": [ @@ -320,7 +303,6 @@ { "cell_type": "code", "execution_count": null, - "id": "a92f1bed", "metadata": {}, "outputs": [], "source": [ @@ -338,7 +320,6 @@ }, { "cell_type": "markdown", - "id": "99e3fe18", "metadata": {}, "source": [ "## Stacked profile of the cluster ensemble\n", @@ -348,7 +329,6 @@ { "cell_type": "code", "execution_count": null, - "id": "5f028309", "metadata": {}, "outputs": [], "source": [ @@ -357,7 +337,6 @@ }, { "cell_type": "markdown", - "id": "907fd664", "metadata": {}, "source": [ "## Covariance (Bootstrap, sample, Jackknife) of the stack between radial bins\n", @@ -372,7 +351,6 @@ { "cell_type": "code", "execution_count": null, - "id": "22db4f4d", "metadata": {}, "outputs": [], "source": [ @@ -388,7 +366,6 @@ { "cell_type": "code", "execution_count": null, - "id": "892abedb", "metadata": {}, "outputs": [], "source": [ @@ -431,7 +408,6 @@ { "cell_type": "code", "execution_count": null, - "id": "f3e698d9", "metadata": {}, "outputs": [], "source": [ @@ -455,7 +431,6 @@ }, { "cell_type": "markdown", - "id": "bfeeb5cf-d8ce-4cd0-93aa-9c36e874e8c4", "metadata": {}, "source": [ "## Visualizing the stacked profiles and corresponding model" @@ -463,7 +438,6 @@ }, { "cell_type": "markdown", - "id": "a237d1ce-92b9-4bcc-8711-e9ab7eafc377", "metadata": {}, "source": [ "In the figure below, we plot:\n", @@ -475,7 +449,6 @@ { "cell_type": "code", "execution_count": null, - "id": "e15ad6da-b66c-4bbd-875c-e0437b4390f8", "metadata": {}, "outputs": [], "source": [ @@ -489,7 +462,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d8e95aaa", "metadata": {}, "outputs": [], "source": [ @@ -588,7 +560,6 @@ }, { "cell_type": "markdown", - "id": "aa1791f1", "metadata": {}, "source": [ "## Saving/Loading ClusterEnsemble\n", @@ -598,7 +569,6 @@ { "cell_type": "code", "execution_count": null, - "id": "cd489bbf", "metadata": {}, "outputs": [], "source": [ @@ -608,7 +578,6 @@ { "cell_type": "code", "execution_count": null, - "id": "c3a86d18", "metadata": {}, "outputs": [], "source": [ @@ -618,9 +587,9 @@ ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -632,7 +601,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/demo_mock_ensemble_realistic.ipynb b/examples/demo_mock_ensemble_realistic.ipynb index bb0f9147f..42cae6d7d 100644 --- a/examples/demo_mock_ensemble_realistic.ipynb +++ b/examples/demo_mock_ensemble_realistic.ipynb @@ -1179,9 +1179,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.11", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "python3.11" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -1193,7 +1193,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.9.0" } }, "nbformat": 4, diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index ce22a18b8..393606340 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -541,7 +541,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -555,7 +555,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/mass_fitting/Example1_Fit_Halo_Mass_to_Shear_Catalog.ipynb b/examples/mass_fitting/Example1_Fit_Halo_Mass_to_Shear_Catalog.ipynb index 60f8acb0e..aa5db1668 100644 --- a/examples/mass_fitting/Example1_Fit_Halo_Mass_to_Shear_Catalog.ipynb +++ b/examples/mass_fitting/Example1_Fit_Halo_Mass_to_Shear_Catalog.ipynb @@ -671,7 +671,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -685,7 +685,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/mass_fitting/Example2_Fit_Halo_Mass_to_Shear_Catalog.ipynb b/examples/mass_fitting/Example2_Fit_Halo_Mass_to_Shear_Catalog.ipynb index 21b72ef29..567d5f292 100644 --- a/examples/mass_fitting/Example2_Fit_Halo_Mass_to_Shear_Catalog.ipynb +++ b/examples/mass_fitting/Example2_Fit_Halo_Mass_to_Shear_Catalog.ipynb @@ -605,7 +605,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -619,7 +619,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/mass_fitting/Example3_Fit_Halo_Mass_to_Shear_Catalog.ipynb b/examples/mass_fitting/Example3_Fit_Halo_Mass_to_Shear_Catalog.ipynb index 6c9c07b41..993d839ff 100644 --- a/examples/mass_fitting/Example3_Fit_Halo_Mass_to_Shear_Catalog.ipynb +++ b/examples/mass_fitting/Example3_Fit_Halo_Mass_to_Shear_Catalog.ipynb @@ -959,9 +959,9 @@ ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -973,7 +973,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.5" + "version": "3.6.9" } }, "nbformat": 4, diff --git a/examples/mass_fitting/Example4_Fit_Halo_mass_to_HSC_data.ipynb b/examples/mass_fitting/Example4_Fit_Halo_mass_to_HSC_data.ipynb index 0c423d25b..74502f5c7 100644 --- a/examples/mass_fitting/Example4_Fit_Halo_mass_to_HSC_data.ipynb +++ b/examples/mass_fitting/Example4_Fit_Halo_mass_to_HSC_data.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "e320d2bf-dce6-4a5b-ab38-04b0c948155f", "metadata": { "tags": [] }, @@ -43,7 +42,6 @@ }, { "cell_type": "markdown", - "id": "4ef8f003-be65-44a3-8b0a-04749d1f7f13", "metadata": {}, "source": [ "\n", @@ -55,7 +53,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d3503a1a-103f-48aa-b600-ef2d72de82a0", "metadata": {}, "outputs": [], "source": [ @@ -70,7 +67,6 @@ }, { "cell_type": "markdown", - "id": "5e228cf4-f5f3-4b55-97b7-f1e022a5b29c", "metadata": {}, "source": [ "\n", @@ -93,7 +89,6 @@ }, { "cell_type": "markdown", - "id": "c684515e-e176-4b92-9509-0217ade681a0", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] @@ -155,7 +150,6 @@ }, { "cell_type": "markdown", - "id": "9f4535f6-23b6-46e8-b9f8-7aeb899bfe7c", "metadata": {}, "source": [ "\n", @@ -169,7 +163,6 @@ { "cell_type": "code", "execution_count": null, - "id": "a04d966e-e00b-4e07-94d9-c3cc13b6183c", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +180,6 @@ { "cell_type": "code", "execution_count": null, - "id": "88e10ef1-f035-462b-98c6-ceac1d32a7e1", "metadata": {}, "outputs": [], "source": [ @@ -197,7 +189,6 @@ { "cell_type": "code", "execution_count": null, - "id": "58147358-bd97-4d81-9111-4909afb67e47", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +201,6 @@ { "cell_type": "code", "execution_count": null, - "id": "cb6c53e2-aa5e-40e1-b46f-a955f0eb055a", "metadata": {}, "outputs": [], "source": [ @@ -244,7 +234,6 @@ { "cell_type": "code", "execution_count": null, - "id": "f6a2ae58-d538-479c-ac26-27dbf9838780", "metadata": {}, "outputs": [], "source": [ @@ -275,7 +264,6 @@ { "cell_type": "code", "execution_count": null, - "id": "8a98993f-2261-452b-8515-a2c64d52c744", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +296,6 @@ { "cell_type": "code", "execution_count": null, - "id": "6d599e88-8a45-4b44-a46a-f2c00d86bd7b", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +327,6 @@ }, { "cell_type": "markdown", - "id": "e71d6d00-f18e-4e27-969b-f02f13032713", "metadata": {}, "source": [ "\n", @@ -351,7 +337,6 @@ { "cell_type": "code", "execution_count": null, - "id": "1c4b465d-9e1c-4b63-a43e-eeea6139b462", "metadata": {}, "outputs": [], "source": [ @@ -389,7 +374,6 @@ { "cell_type": "code", "execution_count": null, - "id": "42573e50-85cc-4977-baf4-723711792c6b", "metadata": {}, "outputs": [], "source": [ @@ -427,7 +411,6 @@ { "cell_type": "code", "execution_count": null, - "id": "db4ebc79-67e8-43da-ad89-ca96666f541d", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +435,6 @@ { "cell_type": "code", "execution_count": null, - "id": "87e51a27-936a-48f5-abc7-120cff89b3ac", "metadata": {}, "outputs": [], "source": [ @@ -519,7 +501,6 @@ { "cell_type": "code", "execution_count": null, - "id": "c83799a1-5122-4e89-b67d-8f691ff9d541", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +532,6 @@ { "cell_type": "code", "execution_count": null, - "id": "f1175703-d2ea-4f13-9f01-3cee81d90f84", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +553,6 @@ { "cell_type": "code", "execution_count": null, - "id": "dc59846f-a380-449d-a30b-5261085a34f2", "metadata": {}, "outputs": [], "source": [ @@ -585,7 +564,6 @@ { "cell_type": "code", "execution_count": null, - "id": "2f5b8ac6-7294-4e85-97ac-28b62512be60", "metadata": {}, "outputs": [], "source": [ @@ -600,7 +578,6 @@ { "cell_type": "code", "execution_count": null, - "id": "84e71bf0-5aa8-4c48-8042-bd461430291a", "metadata": {}, "outputs": [], "source": [ @@ -632,7 +609,6 @@ { "cell_type": "code", "execution_count": null, - "id": "2d0e95d3-bc69-4cf7-8ac0-1788b74fe5d6", "metadata": {}, "outputs": [], "source": [ @@ -650,7 +626,6 @@ { "cell_type": "code", "execution_count": null, - "id": "3acffc41-3f07-4a33-8f31-8b27b4363d7e", "metadata": {}, "outputs": [], "source": [ @@ -765,7 +740,6 @@ }, { "cell_type": "markdown", - "id": "aaa8f5fb-82f0-490e-8fea-3a1f18b34311", "metadata": {}, "source": [ "### Reference\n", @@ -795,7 +769,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -809,7 +783,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.6.9" } }, "nbformat": 4,