{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.insert(0, '../../gcr-catalogs')\n", "sys.path.insert(0, '../../generic-catalog-reader')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import GCRCatalogs" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "../../generic-catalog-reader/GCR/composite.py:105: UserWarning: CompositeCatalog is still an experimental feature. Use with care!\n", " warnings.warn('CompositeCatalog is still an experimental feature. Use with care!')\n" ] } ], "source": [ "cc = GCRCatalogs.load_catalog('um_v0.1_test_shear')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['um_v0.1_test', 'shear']" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[cat['catalog_name'] for cat in cc.get_input_kwargs('catalogs')]" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(cc[('um_v0.1_test', 'galaxy_id')] == cc[('shear', 'galaxy_id')]).all()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "../../generic-catalog-reader/GCR/composite.py:105: UserWarning: CompositeCatalog is still an experimental feature. Use with care!\n", " warnings.warn('CompositeCatalog is still an experimental feature. Use with care!')\n" ] } ], "source": [ "cc = GCRCatalogs.load_catalog('proto-dc2_v2.1.2_addon_knots') # this one takes a while because of md5sum check" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['proto-dc2_v2.1.2', 'knots']" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[cat['catalog_name'] for cat in cc.get_input_kwargs('catalogs')]" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10022496" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(cc['knots_flux_ratio'])" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10022496" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(cc['ra'])" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "../../gcr-catalogs/GCRCatalogs/alphaq.py:105: UserWarning: No md5 sum specified in the config file\n", " warnings.warn('No md5 sum specified in the config file')\n", "../../generic-catalog-reader/GCR/composite.py:105: UserWarning: CompositeCatalog is still an experimental feature. Use with care!\n", " warnings.warn('CompositeCatalog is still an experimental feature. Use with care!')\n" ] } ], "source": [ "cc = GCRCatalogs.load_catalog('proto-dc2_v2.1.2_addon_tidal')" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['proto-dc2_v2.1.2_test', 'tidal']" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "[cat['catalog_name'] for cat in cc.get_input_kwargs('catalogs')]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "galaxy_id = cc['galaxy_id']" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(galaxy_id.compressed() == cc[('proto-dc2_v2.1.2_test', 'galaxy_id')][~galaxy_id.mask]).all()" ] }, { "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.6.2" } }, "nbformat": 4, "nbformat_minor": 2 }