diff --git a/examples/demo_coordinate_system_datasets.ipynb b/examples/demo_coordinate_system_datasets.ipynb index 877024f82..d60b06abb 100644 --- a/examples/demo_coordinate_system_datasets.ipynb +++ b/examples/demo_coordinate_system_datasets.ipynb @@ -2,7 +2,6 @@ "cells": [ { "cell_type": "markdown", - "id": "2c4a9006-fb3e-4675-8dca-94c0ae1a88fe", "metadata": {}, "source": [ "# Tests of coordinate system effects on shear profiles\n", @@ -25,7 +24,6 @@ }, { "cell_type": "markdown", - "id": "ac4d1294-718b-405b-95b7-74e397ede069", "metadata": {}, "source": [ "## Instructions to download text data\n", @@ -51,8 +49,7 @@ }, { "cell_type": "code", - "execution_count": 1, - "id": "f63b0937-4fb2-4ed4-8b70-4e1c4a2e24de", + "execution_count": null, "metadata": { "tags": [] }, @@ -64,8 +61,7 @@ }, { "cell_type": "code", - "execution_count": 2, - "id": "7e26eafb-4609-4c3a-a36b-4f7849d759db", + "execution_count": null, "metadata": { "tags": [] }, @@ -84,8 +80,7 @@ }, { "cell_type": "code", - "execution_count": 3, - "id": "e802529c-995e-4095-9e82-65f6a3a7f051", + "execution_count": null, "metadata": { "tags": [] }, @@ -97,7 +92,6 @@ }, { "cell_type": "markdown", - "id": "8f71fa8a-4c78-4033-a91c-3caf2b8a8078", "metadata": {}, "source": [ "## Example galaxy cluster from CosmoDC2\n", @@ -107,8 +101,7 @@ }, { "cell_type": "code", - "execution_count": 4, - "id": "6ff8236d-3cef-4990-a6b2-a089aa8318ea", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -117,8 +110,7 @@ }, { "cell_type": "code", - "execution_count": 5, - "id": "8a18381a-a8cf-47c0-85bd-b745a565b041", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -129,8 +121,7 @@ }, { "cell_type": "code", - "execution_count": 6, - "id": "00d69ca3-43ef-4533-9fa3-2ec2d0d8bfce", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -139,8 +130,7 @@ }, { "cell_type": "code", - "execution_count": 7, - "id": "e79f1e35-2eb1-44c5-b8f4-12b6688a88d6", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -154,8 +144,7 @@ }, { "cell_type": "code", - "execution_count": 8, - "id": "4fe65c42-d695-43fb-b269-5a7513dd05ac", + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -171,7 +160,6 @@ }, { "cell_type": "markdown", - "id": "6fe3907e-bb9d-4565-a061-6189704fcc4c", "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." @@ -179,25 +167,9 @@ }, { "cell_type": "code", - "execution_count": 9, - "id": "b15c9144-ab4b-46cc-8f8e-5d2424b4028d", + "execution_count": null, "metadata": {}, - "outputs": [ - { - "ename": "ValueError", - "evalue": "coordinate_system must be 'sky' or 'pixel'.", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[9], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Create a GalaxyCluster.\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m cluster \u001b[38;5;241m=\u001b[39m \u001b[43mclmm\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mGalaxyCluster\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mName of cluster\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcluster_ra\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcluster_dec\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcluster_z\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgalaxies\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcoordinate_system\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcelestial\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# Convert elipticities into shears for the members.\u001b[39;00m\n\u001b[1;32m 5\u001b[0m cluster\u001b[38;5;241m.\u001b[39mcompute_tangential_and_cross_components()\n", - "File \u001b[0;32m/pscratch/sd/a/avestruz/clmm-area/lib/python3.11/site-packages/clmm/galaxycluster.py:56\u001b[0m, in \u001b[0;36mGalaxyCluster.__init__\u001b[0;34m(self, validate_input, *args, **kwargs)\u001b[0m\n\u001b[1;32m 54\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(args) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(kwargs) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 55\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_add_values(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m---> 56\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_check_types\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 57\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mset_ra_lower(ra_low\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\n", - "File \u001b[0;32m/pscratch/sd/a/avestruz/clmm-area/lib/python3.11/site-packages/clmm/galaxycluster.py:83\u001b[0m, in \u001b[0;36mGalaxyCluster._check_types\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 81\u001b[0m validate_argument(\u001b[38;5;28mvars\u001b[39m(\u001b[38;5;28mself\u001b[39m), \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mz\u001b[39m\u001b[38;5;124m\"\u001b[39m, (\u001b[38;5;28mfloat\u001b[39m, \u001b[38;5;28mstr\u001b[39m), argmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, eqmin\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 82\u001b[0m validate_argument(\u001b[38;5;28mvars\u001b[39m(\u001b[38;5;28mself\u001b[39m), \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mgalcat\u001b[39m\u001b[38;5;124m\"\u001b[39m, GCData)\n\u001b[0;32m---> 83\u001b[0m \u001b[43m_validate_coordinate_system\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mvars\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcoordinate_system\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 84\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munique_id \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mstr\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munique_id)\n\u001b[1;32m 85\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mra \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mfloat\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mra)\n", - "File \u001b[0;32m/pscratch/sd/a/avestruz/clmm-area/lib/python3.11/site-packages/clmm/utils/validation.py:247\u001b[0m, in \u001b[0;36m_validate_coordinate_system\u001b[0;34m(loc, coordinate_system, valid_type)\u001b[0m\n\u001b[1;32m 245\u001b[0m validate_argument(loc, coordinate_system, valid_type)\n\u001b[1;32m 246\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m loc[coordinate_system] \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msky\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpixel\u001b[39m\u001b[38;5;124m\"\u001b[39m]:\n\u001b[0;32m--> 247\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcoordinate_system\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m must be \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msky\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m or \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpixel\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", - "\u001b[0;31mValueError\u001b[0m: coordinate_system must be 'sky' or 'pixel'." - ] - } - ], + "outputs": [], "source": [ "# Create a GalaxyCluster.\n", "cluster = clmm.GalaxyCluster(\"Name of cluster\", cluster_ra, cluster_dec, cluster_z, galaxies, coordinate_system=\"celestial\")\n", @@ -221,7 +193,6 @@ }, { "cell_type": "markdown", - "id": "94723df5-971e-43cd-aeba-3cd9c49d8474", "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." @@ -230,7 +201,6 @@ { "cell_type": "code", "execution_count": null, - "id": "bab06128-681c-4774-b51f-a78f215d0e1c", "metadata": {}, "outputs": [], "source": [ @@ -254,7 +224,6 @@ }, { "cell_type": "markdown", - "id": "f50c2431-e368-465c-9042-80f482951d81", "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. We do notice an excess with the correct coordinate system at larger radii." @@ -263,7 +232,6 @@ { "cell_type": "code", "execution_count": null, - "id": "a7a1350f-ba18-4ab4-8ec9-06d1b55466cc", "metadata": {}, "outputs": [], "source": [ @@ -308,7 +276,6 @@ }, { "cell_type": "markdown", - "id": "0c3d5d3d-0d6a-4c55-99f5-141e5ee9329a", "metadata": {}, "source": [ "## Example source galaxies from M. Oguri\n", @@ -321,7 +288,6 @@ { "cell_type": "code", "execution_count": null, - "id": "493d1ce7-288e-4fe9-8e49-c01702f31614", "metadata": {}, "outputs": [], "source": [ @@ -341,7 +307,6 @@ { "cell_type": "code", "execution_count": null, - "id": "4c22f1f2-9ca5-4342-b18c-bb9e4e562040", "metadata": {}, "outputs": [], "source": [ @@ -360,7 +325,6 @@ }, { "cell_type": "markdown", - "id": "02037f9b-bbf1-46fd-a6a9-cbbda1dc0530", "metadata": {}, "source": [ "We inspect the first galaxy cluster, Abell 1703." @@ -369,7 +333,6 @@ { "cell_type": "code", "execution_count": null, - "id": "5a3a4fd5-0a9b-4dfc-a4f8-4f853174420a", "metadata": {}, "outputs": [], "source": [ @@ -390,7 +353,6 @@ }, { "cell_type": "markdown", - "id": "0275d3a6-4b95-4d98-8c1f-cec9c5db7534", "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**." @@ -399,7 +361,6 @@ { "cell_type": "code", "execution_count": null, - "id": "3cf8feb9-e4e2-4ab4-8fcd-498eb025d945", "metadata": {}, "outputs": [], "source": [ @@ -467,7 +428,6 @@ }, { "cell_type": "markdown", - "id": "611ee615-05a0-49d1-a9a3-1820a136fa1b", "metadata": {}, "source": [ "## Example source galaxies from HSC Y3\n", @@ -478,7 +438,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d98e194a-5d49-4a03-9ecf-8b8e244222c2", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +447,6 @@ { "cell_type": "code", "execution_count": null, - "id": "f4b75a91-bdf7-48ce-83e6-38910b1c6ab6", "metadata": {}, "outputs": [], "source": [ @@ -498,7 +456,6 @@ { "cell_type": "code", "execution_count": null, - "id": "3b6c7291-1c2d-4658-b5ac-e9d0cb8dea95", "metadata": {}, "outputs": [], "source": [ @@ -507,7 +464,6 @@ }, { "cell_type": "markdown", - "id": "8cda0597-5ee2-42a4-8d0c-93c3918e6d8a", "metadata": {}, "source": [ "Here, we use a KDTree implementation in scipy to extract the background source galaxies for the first galaxy cluster in the dataset." @@ -516,7 +472,6 @@ { "cell_type": "code", "execution_count": null, - "id": "6bb6d126-c1ce-496c-827e-fd5211763737", "metadata": {}, "outputs": [], "source": [ @@ -530,7 +485,6 @@ { "cell_type": "code", "execution_count": null, - "id": "69f17557-2516-412d-8cdc-eb3dddaa9db4", "metadata": {}, "outputs": [], "source": [ @@ -541,7 +495,6 @@ { "cell_type": "code", "execution_count": null, - "id": "fd5bc3d8-8cca-4811-ae1b-417247638c72", "metadata": {}, "outputs": [], "source": [ @@ -553,7 +506,6 @@ { "cell_type": "code", "execution_count": null, - "id": "b5f5f9fc-6894-449a-b8bb-bc52050f8871", "metadata": {}, "outputs": [], "source": [ @@ -563,7 +515,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d70b3a90-fafd-451e-82e1-1376fb440e84", "metadata": {}, "outputs": [], "source": [ @@ -573,7 +524,6 @@ { "cell_type": "code", "execution_count": null, - "id": "e6ef0fed-b730-49f5-8a2c-18a8e79c5783", "metadata": {}, "outputs": [], "source": [ @@ -591,7 +541,6 @@ { "cell_type": "code", "execution_count": null, - "id": "743af48d-5284-4d50-9021-8ac29fb73dfa", "metadata": {}, "outputs": [], "source": [ @@ -600,7 +549,6 @@ }, { "cell_type": "markdown", - "id": "b11276ff-e3c1-4ddc-80ef-16c407a3fff5", "metadata": {}, "source": [ "Now we construct a radial profile of the tangential and cross terms for the galaxy cluster" @@ -609,7 +557,6 @@ { "cell_type": "code", "execution_count": null, - "id": "79c5afb9-927e-4d90-bfb0-2d556cd27a7c", "metadata": {}, "outputs": [], "source": [ @@ -634,7 +581,6 @@ { "cell_type": "code", "execution_count": null, - "id": "f4b3f0b1-c22f-406c-b6b7-b44a76394eed", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +608,6 @@ }, { "cell_type": "markdown", - "id": "c06de4dd-be05-4b16-9d99-bfab31ee04c9", "metadata": {}, "source": [ "## Example explicit lensing profile measurement comparison with CLMM profile\n", @@ -673,7 +618,6 @@ { "cell_type": "code", "execution_count": null, - "id": "276c6b03-5612-45e1-b202-1464b8331550", "metadata": {}, "outputs": [], "source": [ @@ -688,7 +632,6 @@ { "cell_type": "code", "execution_count": null, - "id": "878ea70c-99f9-45b7-aef7-b1e14ee4ad86", "metadata": {}, "outputs": [], "source": [ @@ -700,7 +643,6 @@ { "cell_type": "code", "execution_count": null, - "id": "51dfa7d4-d8d0-4dab-ba6a-463c9da9d5c9", "metadata": {}, "outputs": [], "source": [ @@ -709,7 +651,6 @@ }, { "cell_type": "markdown", - "id": "939e8ffc-c9d7-4813-8b99-a46e5facafd2", "metadata": {}, "source": [ "Below, we measure lensing signals with simplified assumptions. We do not account for responsivity, multiplicative, nor additive biases. " @@ -718,7 +659,6 @@ { "cell_type": "code", "execution_count": null, - "id": "da723c9a-f702-463b-b1e3-5bcf404d0fe4", "metadata": {}, "outputs": [], "source": [ @@ -800,7 +740,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d1262e48-b5f0-4f31-8507-84af6bdeed80", "metadata": {}, "outputs": [], "source": [ @@ -827,7 +766,6 @@ { "cell_type": "code", "execution_count": null, - "id": "fdcd2d5d-c771-4973-bdea-c8be4de3feb6", "metadata": {}, "outputs": [], "source": [ @@ -849,7 +787,6 @@ { "cell_type": "code", "execution_count": null, - "id": "9fc830fa-5c35-4e12-a88e-cc945c78841f", "metadata": { "tags": [] }, @@ -901,7 +838,6 @@ { "cell_type": "code", "execution_count": null, - "id": "7caca756-3e93-4e8b-8502-fe1a001ba5c0", "metadata": {}, "outputs": [], "source": [ @@ -917,7 +853,6 @@ }, { "cell_type": "markdown", - "id": "e68eef0e-e363-484c-92bc-0d429c16bbeb", "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." @@ -926,7 +861,6 @@ { "cell_type": "code", "execution_count": null, - "id": "366b3a5e-52e4-453d-ba93-e3c0a8cf22f5", "metadata": {}, "outputs": [], "source": [ @@ -953,7 +887,6 @@ { "cell_type": "code", "execution_count": null, - "id": "d8777fb0-3682-4a7c-9a87-bb91729a1fac", "metadata": {}, "outputs": [], "source": [] @@ -961,9 +894,9 @@ ], "metadata": { "kernelspec": { - "display_name": "desc-stack-weekly-latest", + "display_name": "Python 3", "language": "python", - "name": "desc-stack-weekly-latest" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -975,7 +908,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.7" + "version": "3.6.9" } }, "nbformat": 4,