{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Extragalactic catalogs: mass relations\n", "\n", "> Notebook owner: Yao-Yuan Mao [@yymao](https://github.com/LSSTDESC/DC2-analysis/issues/new?body=@yymao). Last run: Mar 8, 2024 by @patricialarsen\n", "\n", "In this notebook we demostrate how to plot the halo mass-stellar mass relation and also the BH mass-bulge mass relation for the cosmoDC2/ skysim/ roman_rubin galaxy catalog.\n", "\n", "## Learning objectives\n", "- Use `GCRCatalogs` to access the cosmoDC2, roman_rubin or skysim catalogs. \n", "- Be able to explore useful quantities using `GCRCatalogs`.\n", "- Be able to use filters when accessing quantities." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "import GCRCatalogs" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Uncomment the line corresponding to the catalog you're inspecting" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "gc = GCRCatalogs.load_catalog('cosmoDC2_v1.1.4_small')\n", "#gc = GCRCatalogs.load_catalog('skysim5000_v1.1.2_small')\n", "#gc = GCRCatalogs.load_catalog('roman_rubin_2023_v1.1.1_elais')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "# let's see what masses are availble \n", "sorted(c for c in gc.list_all_quantities(True) if 'mass' in c.lower())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## stellar mass - halo mass relation for low-z central galaxies" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "data = gc.get_quantities(['stellar_mass', 'halo_mass'], filters=['redshift < 0.2', 'is_central'])\n", "cs = plt.hexbin(np.log10(data['halo_mass']), np.log10(data['stellar_mass']), cmap='Blues', bins='log');\n", "plt.colorbar(cs, label='log population');\n", "plt.xlabel(r'$\\log \\, {\\rm M}_h \\, / \\, {\\rm M}_\\odot$');\n", "plt.ylabel(r'$\\log \\, {\\rm M}_* \\, / \\, {\\rm M}_\\odot$');\n", "plt.title(r'$z < 0.2$');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "let's see if the relation changes with redshift" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "data = gc.get_quantities(['stellar_mass', 'halo_mass'], filters=['redshift > 0.9', 'redshift < 1', 'is_central'])\n", "cs = plt.hexbin(np.log10(data['halo_mass']), np.log10(data['stellar_mass']), cmap='Blues', bins='log');\n", "plt.colorbar(cs, label='log population');\n", "plt.xlabel(r'$\\log \\, {\\rm M}_h \\, / \\, {\\rm M}_\\odot$');\n", "plt.ylabel(r'$\\log \\, {\\rm M}_* \\, / \\, {\\rm M}_\\odot$');\n", "plt.title(r'$0.9 < z < 1.0$');" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## bulge mass - black hole mass relation for low-z central galaxies" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [] }, "outputs": [], "source": [ "data = gc.get_quantities(['stellar_mass_bulge', 'blackHoleMass'], filters=['redshift < 0.2', 'is_central'])\n", "cs = plt.hexbin(np.log10(data['stellar_mass_bulge']), np.log10(data['blackHoleMass']), cmap='Blues', bins='log');\n", "plt.colorbar(cs, label='log population');\n", "plt.xlabel(r'$\\log \\, {\\rm M}_{\\rm bulge} \\, / \\, {\\rm M}_\\odot$');\n", "plt.ylabel(r'$\\log \\, {\\rm M}_{\\rm BH} \\, / \\, {\\rm M}_\\odot$');" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "desc-python", "language": "python", "name": "desc-python" }, "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.10.13" } }, "nbformat": 4, "nbformat_minor": 4 }