{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Make depth summary figures\n", "\n", "This notebook is to produce some figures for the ELAIS-N1 paper.\n", "\n", "First we will, for every helpix 13 in HELP get the highest K or Ks depth, g depth, and irac 1 depth. We will then plot cumulative area histograms and generate the 25%, 50%, 75% areas to summarise the depths across all HELP.\n", "\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This notebook was run with herschelhelp_internal version: \n", "1407877 (Mon Feb 4 12:56:29 2019 +0000)\n" ] } ], "source": [ "from herschelhelp_internal import git_version\n", "print(\"This notebook was run with herschelhelp_internal version: \\n{}\".format(git_version()))\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/rs548/anaconda/envs/herschelhelp_internal/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88\n", " return f(*args, **kwds)\n" ] } ], "source": [ "import pyvo as vo\n", "import glob\n", "import time\n", "import numpy as np\n", "\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt\n", "from mpl_toolkits.axes_grid1.inset_locator import inset_axes\n", "\n", "import random\n", "\n", "import herschelhelp as hh\n", "from herschelhelp_internal.utils import flux_to_mag\n", "\n", "from astropy.table import Table, Column, vstack, join, unique\n", "\n", "from pymoc import MOC\n", "\n", "import pandas as pd\n", "\n", "import yaml\n", "\n", "from pcigale.sed import SED\n", "from pcigale.sed_modules import get_module" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "\n", "#Then we establish the VO connection to our database\n", "service = vo.dal.TAPService(\"https://herschel-vos.phys.sussex.ac.uk/__system__/tap/run/tap\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "herschelhelp_python_loc = ('../../../../herschelhelp_python/')\n", "\n", "filter_locs = glob.glob(herschelhelp_python_loc + 'database_builder/filters/*')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "filters = [f.split('/')[-1].split('.')[0] for f in filter_locs]\n", "filters.remove('readme')\n", "\n", "bands = ['u', 'g', 'r', 'i', 'z', 'y',\n", " 'J', 'H', 'K', 'Ks',\n", " 'i1', 'i2', 'i3', 'i4']" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['wfi_696nm',\n", " 'suprime_nb816',\n", " 'wfc3_f125w',\n", " 'mmt_g',\n", " 'omegacam_r',\n", " 'decam_z',\n", " 'wfi_416nm',\n", " 'sdss_i',\n", " 'omegacam_g',\n", " 'suprime_ib464',\n", " 'wfi_571nm',\n", " 'mmt_r',\n", " 'wfc3_f105w',\n", " 'spire_350',\n", " 'decam_y',\n", " 'suprime_ib505',\n", " 'cfht12k_b',\n", " '90prime_z',\n", " 'omegacam_u',\n", " 'suprime_ip',\n", " 'isaac_k',\n", " 'galex_nuv',\n", " 'acs_f775w',\n", " 'moircs_k',\n", " 'sdss_z',\n", " 'acs_f606w',\n", " 'cfht12k_r',\n", " 'decam_i',\n", " 'quirc_hk',\n", " 'mmt_u',\n", " 'suprime_zpp',\n", " 'suprime_ia624',\n", " 'megacam_r',\n", " 'bessell_v',\n", " 'wircam_ks',\n", " 'mips_24',\n", " 'omega2000_j',\n", " 'wfi_r',\n", " 'spire_250',\n", " 'suprime_r',\n", " 'gpc1_i',\n", " 'suprime_g',\n", " 'bessell_b',\n", " 'bessell_u',\n", " 'mosaic_r',\n", " 'wfi_753nm',\n", " 'acs_f850lp',\n", " 'ukidss_y',\n", " 'megacam_g',\n", " 'wfc_z',\n", " 'lbc_u',\n", " 'suprime_ia527',\n", " 'wfc_i',\n", " 'wfi_b123',\n", " 'gpc1_y',\n", " 'suprime_b',\n", " 'wfi_b',\n", " 'wfi_u',\n", " 'suprime_ia679',\n", " 'ukidss_j',\n", " 'suprime_ib827',\n", " 'suprime_ia484',\n", " 'ukidss_k',\n", " 'megacam_u',\n", " 'newfirm_j1',\n", " 'suprime_n816',\n", " 'gpc1_z',\n", " 'newfirm_j3',\n", " 'suprime_v',\n", " 'wfi_v',\n", " 'mosaic_b',\n", " 'mosaic_u',\n", " 'ukidss_h',\n", " 'bessell_r',\n", " 'suprime_ib574',\n", " 'newfirm_j2',\n", " 'suprime_zp',\n", " 'wfc3_f140w',\n", " 'suprime_z',\n", " 'irac_i3',\n", " 'irac_i2',\n", " 'bessell_i',\n", " 'megacam_z',\n", " 'vista_z',\n", " 'wfc_g',\n", " 'wfi_856nm',\n", " 'wfc_r',\n", " 'suprime_y',\n", " 'vista_ks',\n", " 'irac_i1',\n", " 'acs_f814w',\n", " 'mosaic_z',\n", " 'megacam_y',\n", " 'suprime_ib427',\n", " 'wfc3_f160w',\n", " 'wfi_646nm',\n", " 'vista_y',\n", " 'suprime_nb711',\n", " 'spire_500',\n", " 'pacs_red',\n", " 'gpc1_g',\n", " 'newfirm_h1',\n", " 'suprime_ia738',\n", " 'vista_j',\n", " 'mosaic_i',\n", " 'irac_i4',\n", " 'wfi_815nm',\n", " 'lbc_y',\n", " 'newfirm_h2',\n", " 'wfi_485nm',\n", " 'megacam_i',\n", " 'moircs_ks',\n", " 'nicmos_f160w',\n", " 'wfi_i',\n", " 'acs_f435w',\n", " 'vista_h',\n", " 'suprime_i',\n", " 'gpc1_r',\n", " 'wfc_u',\n", " 'wfi_461nm',\n", " 'cfht12k_i',\n", " 'wfc3_f098m',\n", " 'newfirm_h',\n", " 'decam_r',\n", " 'omegacam_z',\n", " 'pacs_green',\n", " 'nicmos_f110w',\n", " 'wfi_914nm',\n", " 'sdss_u',\n", " 'suprime_rc',\n", " 'wircam_y',\n", " 'newfirm_k',\n", " 'omega2000_ks',\n", " 'mmt_z',\n", " 'wfi_518nm',\n", " 'decam_g',\n", " 'tifkam_ks',\n", " 'newfirm_j',\n", " 'wircs_j',\n", " 'suprime_ia767',\n", " 'sdss_r',\n", " 'suprime_n921',\n", " 'mmt_i',\n", " 'wfi_604nm',\n", " 'wircs_k',\n", " 'galex_fuv',\n", " '90prime_r',\n", " 'wircam_j',\n", " 'suprime_ib709',\n", " 'wircam_h',\n", " 'suprime_rp',\n", " '90prime_g',\n", " 'hawki_k',\n", " 'omegacam_i',\n", " 'sdss_g']" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "filters" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Job still running after 0 seconds.\n", "Job still running after 11 seconds.\n" ] } ], "source": [ "irac_i1_query=\"\"\"\n", "SELECT DISTINCT hp_idx_O_10, ferr_ap_irac_i1_mean\n", "FROM depth.main\n", "WHERE ferr_ap_irac_i1_mean IS NOT NULL\n", "\"\"\"\n", "\n", "#Then we execute the query\n", "#resultset = service.run_async(irac_i1_query)\n", "job = service.submit_job(irac_i1_query)\n", "job.run()\n", "job_url = job.url\n", "job_result = vo.dal.tap.AsyncTAPJob(job_url)\n", "start_time = time.time()\n", "while job.phase == 'EXECUTING':\n", " print('Job still running after {} seconds.'.format(round(time.time() - start_time)))\n", " time.sleep(10) #wait ten seconds and try again\n", " \n", "table = job_result.fetch_result() \n", "i1_table = table.table" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Table masked=True length=83313\n", "
hp_idx_o_10 | ferr_ap_irac_i1_mean |
---|---|
uJy | |
int64 | float64 |
1547506 | 1.43366666666667 |
1547507 | 1.52794117647059 |
1547510 | 1.66105263157895 |
1547511 | 1.94072727272727 |
1547512 | 1.62485294117647 |
1547513 | 1.03740540540541 |
1547514 | 1.42491329479769 |
1547515 | 0.732934782608696 |
1547516 | 1.19547872340426 |
... | ... |
11870851 | 206.8402 |
11870852 | 106.708244 |
11870853 | 261.2762 |
11870854 | 265.9595 |
11870855 | 260.12 |
11870856 | 303.03732 |
11870857 | 232.01556 |
11870858 | 557.28467 |
11870860 | 679.73 |
11870864 | 152.82677 |