{ "cells": [ { "cell_type": "markdown", "id": "ad164cbe-c7eb-437c-a980-7940a074c79a", "metadata": {}, "source": [ "## Simple notebook to compare the Signal-to-noise between different input catalogs" ] }, { "cell_type": "markdown", "id": "f4a6b5c6-c9a3-489d-9e53-38f16b83ce09", "metadata": {}, "source": [ "#### Standard imports" ] }, { "cell_type": "code", "execution_count": null, "id": "dcb14a6d-ea05-4caf-bee4-4235666689a4", "metadata": {}, "outputs": [], "source": [ "import hpmcm\n", "import tables_io\n", "import glob\n", "import os\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "id": "1caf695d-7313-46d9-b3bc-f2c4f6e0d4ba", "metadata": {}, "source": [ "#### Configuration data" ] }, { "cell_type": "code", "execution_count": null, "id": "dc6c47f4-65f4-4754-9d94-bbe2b660e689", "metadata": {}, "outputs": [], "source": [ "DATADIR = \"test_data\"\n", "shear_st = \"0p01\"\n", "\n", "tract = 10463\n", "SOURCE_TABLEFILES = sorted(glob.glob(os.path.join(DATADIR, f\"shear_*_{shear_st}_cleaned_{tract}_ns.pq\")))\n", "SOURCE_TABLEFILES.append(os.path.join(DATADIR, f\"object_{tract}.pq\"))\n", "SOURCE_TABLEFILES.reverse()" ] }, { "cell_type": "markdown", "id": "780b62f3-1430-4f78-8eea-f525ba93cebc", "metadata": {}, "source": [ "#### Read the input files" ] }, { "cell_type": "code", "execution_count": null, "id": "d996a1c7-9875-4678-878d-156af617cb54", "metadata": {}, "outputs": [], "source": [ "dd = {i:tables_io.read(file_) for i, file_ in enumerate(SOURCE_TABLEFILES)}" ] }, { "cell_type": "markdown", "id": "88830f95-9724-4ad3-bfad-8f0ea403139e", "metadata": {}, "source": [ "#### Plot the SNR for the various catalgos" ] }, { "cell_type": "code", "execution_count": null, "id": "daf32ac9-93ef-438a-ad2e-99f1a9b6b0ce", "metadata": {}, "outputs": [], "source": [ "#for i, key in enumerate(['Object', 'wmom', 'pgauss', 'gauss']):\n", "for i, key in enumerate(['Object', 'wmom']):\n", " mask = dd[i].snr > 1\n", " _ = plt.hist(dd[i].snr[mask], bins=np.logspace(0, 4, 101), label=key, alpha=0.5)\n", "_ = plt.legend()\n", "_ = plt.xscale('log')\n", "_ = plt.xlabel(\"Signal-to-noise [r-band]\")\n", "_ = plt.ylabel(\"Objects [per 0.04 dex]\")\n", "#_ = plt.yscale('log')" ] }, { "cell_type": "code", "execution_count": null, "id": "cde072df-47f4-4e1f-a507-c125b4249b09", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "2eb02dd6-4a76-4347-9744-694ad14d9766", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.12.12" } }, "nbformat": 4, "nbformat_minor": 5 }