From a3be115e1bf9e2043f04552e8778eb28e60b46d9 Mon Sep 17 00:00:00 2001 From: Raphael Shirley Date: Thu, 1 Feb 2018 11:55:14 +0000 Subject: [PATCH] Adding specz on HDFN, HS82, SA13 and XMM-13hr #21 #15 #22 #23 --- dmu1/dmu1_ml_HDF-N/2_Merging.ipynb | 42 ++++++++----- .../2.3_Merging.ipynb | 59 ++++++++++++++++++- dmu1/dmu1_ml_SA13/2_Merging.ipynb | 57 ++++++++++++------ dmu1/dmu1_ml_XMM-13hr/2_Merging.ipynb | 49 +++++++++++---- 4 files changed, 158 insertions(+), 49 deletions(-) diff --git a/dmu1/dmu1_ml_HDF-N/2_Merging.ipynb b/dmu1/dmu1_ml_HDF-N/2_Merging.ipynb index aba96113..a6352d74 100644 --- a/dmu1/dmu1_ml_HDF-N/2_Merging.ipynb +++ b/dmu1/dmu1_ml_HDF-N/2_Merging.ipynb @@ -30,9 +30,18 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/rs548/anaconda/envs/herschelhelp_internal/lib/python3.6/site-packages/seaborn/apionly.py:6: UserWarning: As seaborn no longer sets a default style on import, the seaborn.apionly module is deprecated. It will be removed in a future version.\n", + " warnings.warn(msg, UserWarning)\n" + ] + } + ], "source": [ "%matplotlib inline\n", "#%config InlineBackend.figure_format = 'svg'\n", @@ -550,24 +559,29 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ - "#specz = Table.read(\"../../dmu23/dmu23_HDF-N/data/HDF-N-specz-v2.8.fits\")" + "specz = Table.read(\"../../dmu23/dmu23_HDF-N/data/HDF-N-specz-v2.csv\")" ] }, { "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": true - }, + "execution_count": 4, + "metadata": {}, "outputs": [], "source": [ - "#specz['objid'].name = 'specz_id'" + "specz.rename_column('RA', 'ra')\n", + "specz.rename_column('DEC', 'dec')\n", + "specz.rename_column('OBJID', 'specz_id')\n", + "specz.rename_column('Z_SPEC', 'z_spec')\n", + "specz.rename_column('Z_SOURCE', 'z_source')\n", + "specz.rename_column('Z_QUAL', 'z_qual')\n", + "specz.rename_column('REL', 'rel')\n", + "specz.rename_column('AGN', 'agn')" ] }, { @@ -578,10 +592,10 @@ }, "outputs": [], "source": [ - "#nb_merge_dist_plot(\n", - "# SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", - "# SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", - "#)" + "nb_merge_dist_plot(\n", + " SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", + " SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", + ")" ] }, { @@ -592,7 +606,7 @@ }, "outputs": [], "source": [ - "#master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" + "master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" ] }, { diff --git a/dmu1/dmu1_ml_Herschel-Stripe-82/2.3_Merging.ipynb b/dmu1/dmu1_ml_Herschel-Stripe-82/2.3_Merging.ipynb index 518065ba..940c0916 100644 --- a/dmu1/dmu1_ml_Herschel-Stripe-82/2.3_Merging.ipynb +++ b/dmu1/dmu1_ml_Herschel-Stripe-82/2.3_Merging.ipynb @@ -30,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [ { @@ -751,8 +751,61 @@ "collapsed": true }, "source": [ - "## VI - Choosing between multiple measurements\n", - "If running in low memory mode this happens in a seperate notebook." + "## VI - Adding spec-z" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "specz = Table.read(\"../../dmu23/dmu23_Herschel-Stripe-82/data/HELP-SPECZ_Herschel-Stripe-82_20170202.fits\")" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['field',\n", + " 'specz_id',\n", + " 'ra',\n", + " 'dec',\n", + " 'z_spec',\n", + " 'z_source',\n", + " 'z_qual',\n", + " 'z_rel',\n", + " 'agn_flag',\n", + " 'notes']" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "nb_merge_dist_plot(\n", + " SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", + " SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" ] }, { diff --git a/dmu1/dmu1_ml_SA13/2_Merging.ipynb b/dmu1/dmu1_ml_SA13/2_Merging.ipynb index 50982b77..c13fc16f 100644 --- a/dmu1/dmu1_ml_SA13/2_Merging.ipynb +++ b/dmu1/dmu1_ml_SA13/2_Merging.ipynb @@ -30,11 +30,18 @@ }, { "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": true - }, - "outputs": [], + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/rs548/anaconda/envs/herschelhelp_internal/lib/python3.6/site-packages/seaborn/apionly.py:6: UserWarning: As seaborn no longer sets a default style on import, the seaborn.apionly module is deprecated. It will be removed in a future version.\n", + " warnings.warn(msg, UserWarning)\n" + ] + } + ], "source": [ "%matplotlib inline\n", "#%config InlineBackend.figure_format = 'svg'\n", @@ -422,20 +429,32 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## VI - Cross-matching with spec-z catalogue\n", - "\n", - "There is currently no specz available" + "## VI - Cross-matching with spec-z catalogue\n" ] }, { "cell_type": "code", - "execution_count": 17, - "metadata": { - "collapsed": true - }, + "execution_count": 3, + "metadata": {}, "outputs": [], "source": [ - "#specz = Table.read(\"../../dmu23/dmu23_SA13/data/SA13-specz-v2.1.fits\")" + "specz = Table.read(\"../../dmu23/dmu23_SA13/data/SA13-specz-v2.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "specz.rename_column('RA', 'ra')\n", + "specz.rename_column('DEC', 'dec')\n", + "specz.rename_column('OBJID', 'specz_id')\n", + "specz.rename_column('Z_SPEC', 'z_spec')\n", + "specz.rename_column('Z_SOURCE', 'z_source')\n", + "specz.rename_column('Z_QUAL', 'z_qual')\n", + "specz.rename_column('REL', 'rel')\n", + "specz.rename_column('AGN', 'agn')" ] }, { @@ -446,10 +465,10 @@ }, "outputs": [], "source": [ - "#nb_merge_dist_plot(\n", - "# SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", - "# SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", - "#)" + "nb_merge_dist_plot(\n", + " SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", + " SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", + ")" ] }, { @@ -460,7 +479,7 @@ }, "outputs": [], "source": [ - "#master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" + "master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" ] }, { @@ -748,7 +767,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.6.1" } }, "nbformat": 4, diff --git a/dmu1/dmu1_ml_XMM-13hr/2_Merging.ipynb b/dmu1/dmu1_ml_XMM-13hr/2_Merging.ipynb index 3ee84fbe..debc1d31 100644 --- a/dmu1/dmu1_ml_XMM-13hr/2_Merging.ipynb +++ b/dmu1/dmu1_ml_XMM-13hr/2_Merging.ipynb @@ -30,9 +30,18 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/rs548/anaconda/envs/herschelhelp_internal/lib/python3.6/site-packages/seaborn/apionly.py:6: UserWarning: As seaborn no longer sets a default style on import, the seaborn.apionly module is deprecated. It will be removed in a future version.\n", + " warnings.warn(msg, UserWarning)\n" + ] + } + ], "source": [ "%matplotlib inline\n", "#%config InlineBackend.figure_format = 'svg'\n", @@ -420,20 +429,34 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## VI - Cross-matching with spec-z catalogue\n", - "\n", - "There is currently no specz available" + "## VI - Cross-matching with spec-z catalogue" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ - "#specz = Table.read(\"../../dmu23/dmu23_SA13/data/SA13-specz-v2.1.fits\")" + "specz = Table.read(\"../../dmu23/dmu23_XMM-13hr/data/XMM-13hr-specz-v2.csv\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "specz.rename_column('RA', 'ra')\n", + "specz.rename_column('DEC', 'dec')\n", + "specz.rename_column('OBJID', 'specz_id')\n", + "specz.rename_column('Z_SPEC', 'z_spec')\n", + "specz.rename_column('Z_SOURCE', 'z_source')\n", + "specz.rename_column('Z_QUAL', 'z_qual')\n", + "specz.rename_column('REL', 'rel')\n", + "specz.rename_column('AGN', 'agn')" ] }, { @@ -444,10 +467,10 @@ }, "outputs": [], "source": [ - "#nb_merge_dist_plot(\n", - "# SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", - "# SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", - "#)" + "nb_merge_dist_plot(\n", + " SkyCoord(master_catalogue['ra'], master_catalogue['dec']),\n", + " SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)\n", + ")" ] }, { @@ -458,7 +481,7 @@ }, "outputs": [], "source": [ - "#master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" + "master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)" ] }, { @@ -467,7 +490,7 @@ "source": [ "## VII - Choosing between multiple values for the same filter\n", "\n", - "There are no duplicate filers" + "There are no duplicate filters" ] }, {