{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Make coverage MOCs\n", "\n", "We would like to have a MOC for each survey showing the coverage. In this notebook we simply add all the MOCs in teh data folders together to make a summary MOC. This should be equivalent to using the depth maps." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "import glob\n", "\n", "from pymoc import MOC\n", "\n", "import yaml\n", "\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "dirlist = glob.glob('dmu0_*')" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "surveys = []\n", "for d in dirlist:\n", " surveys.append(d[5:])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "surveys" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "survey_ids = {\n", " 1 : [\"2MASS\", \"2MASS-point-sources\", \" Two Micron All Sky Survey (2MASS)\"],\n", " 2 : [\"AEGIS\", \"\", \" All-wavelength Extended Groth strip International Survey (AEGIS)\"],\n", " 3 : [\"AKARI-NEP-OptNIR\", \"\", \" Optical-NIR catalog of AKARI NEP Deep Field,\"],\n", " 4 : [\"ATLAS\", \"\", \" VST ATLAS SURVEY,\"],\n", " 5 : [\"CANDELS-3D-HST\", \"\", \" 3D-HST+CANDELS catalog,\"],\n", " 6 : [\"CANDELS\", \"\", \" Cosmic Assembly Near-IR Deep Extragalactic Legacy Survey (CANDELS)\"],\n", " 7 : [\"CFHT-WIRDS\", \"\", \" WIRcam Deep Survey (WIRDS)\"],\n", " 8 : [\"CFHTLS\", \"\", \" Canada-France-Hawaii Telescope Legacy Survey (CFHTLS)\"],\n", " 9 : [\"CFHTLenS\", \"\", \" The CFHT Lensing Survey (CHTLenS)\"],\n", " 10 : [\"COMBO-17\", \"\", \" Classifying Objects by Medium-Band Observations 17-filter survey (COMBO-17)\"],\n", " 11 : [\"DECaLS\", \"\", \" DECam Legacy Survey (DECaLS)\"],\n", " 12 : [\"DEEP2\", \"\", \" DEEP2 Galaxy Redshift Survey\"],\n", " 13 : [\"DES\", \"\", \" Dark Energy Survey (DES)\"],\n", " 14 : [\"DataFusion-Spitzer\", \"\", \" DataFusion-Spitzer catalogues (SERVS and SWIRE)\"],\n", " 15 : [\"ESIS\", \"ESIS-VOICE\", \" ESO-Spitzer Imaging extragalactic Survey (ESIS)\"],\n", " 16 : [\"FIREWORKS\", \"\", \" FIREWORKS photometry of GOODS CDF-S\"],\n", " 17 : [\"GOODS-ACS\", \"\", \" GOODS ACS Treasury program\"],\n", " 18 : [\"HSC\", \"\", \" Hyper Suprime-Cam Subaru Strategic Program (HSC-SSP)\"],\n", " 19 : [\"HDFN\", \"Hawaii-HDFN\", \" Hawaii Hubble Deep Field North (Hawaii-HDFN)\"],\n", " 20 : [\"IBIS\", \"\", \" Infrared Bootes Imaging Survey (IBIS)\"],\n", " 21 : [\"INTWFC\", \"\", \" Wide-field optical imaging on ELAIS N1, ELAIS N2, First Look Survey and Lockman Hole\"],\n", " 22 : [\"IRAC-EGS\", \"\", \" UV-to-FIR Analysis of Spitzer/IRAC Sources in the Extended Groth Strip Multiple\"],\n", " 23 : [\"KIDS\", \"\", \" Kilo-Degree Survey (KiDS)\"],\n", " 24 : [\"KPNO-FLS\", \"\", \" Spitzer First Look Survey (FLS) - NOAO Extragalactic - R\"],\n", " 25 : [\"LegacySurvey\", \"\", \" Legacy Surveys\"],\n", " 26 : [\"NDWFS\", \"\", \" NOAO Deep Wide-Field Survey (NDWFS)\"],\n", " 27 : [\"PanSTARRS1-3SS\", \"\", \" Panoramic Survey Telescope and Rapid Response System (PanSTARRS1) 3pi Steradian Survey (3SS)\"],\n", " 28 : [\"RCSLenS\", \"\", \" Red Cluster Sequence Lensing Survey (RCSLenS)\"],\n", " 29 : [\"SDSS-DR13\", \"\", \" Sloan Digital Sky Survey (SDSS) - DR13\"],\n", " 30 : [\"SDSS-S82\", \"\", \" SDSS - Stripe 82\"],\n", " 31 : [\"IAC_Stripe82_Legacy_Project\", \"IAC-S82\", \" Instituto de Astrofísica de Canarias (IAC) Stripe 82 Legacy Project\"],\n", " 32 : [\"SDWFS\", \"\", \" Spitzer Deep, Wide-Field Survey (SDWFS)\"],\n", " 33 : [\"SHELA\", \"\", \" Spitzer/HETDEX Exploratory Large-Area (SHELA) survey\"],\n", " 34 : [\"SIMES\", \"\", \" Spitzer-IRAC/MIPS Extragalactic Survey (SIMES)\"],\n", " 35 : [\"SPLASH-SXDF\", \"\", \" SPLASH-SXDF Multi-Wavelength Photometric Catalog\"],\n", " 36 : [\"SSDF\", \"\", \" Spitzer-South Pole Telescope Deep Field (SSDF)\"],\n", " 37 : [\"SXDS\", \"\", \" Subaru/XMM-Newton Deep Survey (SXDS)\"],\n", " 38 : [\"SpARCS\", \"\", \" Spitzer Adaptation of the Red-sequence Cluster Survey (SpARCS)\"],\n", " 39 : [\"SpIES\", \"\", \" Spitzer IRAC Equatorial Survey (SpIES)\"],\n", " 40 : [\"SpUDS\", \"\", \" Spitzer UKIDSS Ultra Deep Survey (SpUDS)\"],\n", " 41 : [\"UHS\", \"\", \" UKIRT Hemisphere Survey (UHS)\"],\n", " 42 : [\"UKIDSS-DXS\", \"\", \" UKIDSS Deep eXtra-galactic Survey (DXS)\"],\n", " 43 : [\"UKIDSS-LAS\", \"\", \" UKIDSS Large Area Survey (LAS)\"],\n", " 44 : [\"UKIDSS-UDS\", \"\", \" UKIDSS Ultra-Deep Survey (UDS)\"],\n", " 45 : [\"Ultradeep\", \"Ultradeep-Ks-GOODS-N\", \" Ultradeep Ks Imaging in the GOODS-N\"],\n", " 46 : [\"VICS82\", \"\", \" VISTA-CFHT Stripe 82 Survey (VICS82)\"],\n", " 47 : [\"VIPERS-MLS\", \"\", \" VIPERS Multi-Lambda Survey (MLS)\"],\n", " 48 : [\"VISTA-VHS\", \"\", \" Visible and Infrared Survey Telescope for Astronomy (VISTA) Hemisphere Survey (VHS)\"],\n", " 49 : [\"VISTA-VIDEO\", \"VISTA-VIDEO-private\", \" VISTA Deep Extragalactic Observations (VIDEO) Survey\"],\n", " 50 : [\"VISTA-VIKING\", \"\", \" VISTA Kilo-Degree Infrared Galaxy Survey (VIKING)\"],\n", " 51 : [\"zBootes\", \"\", \" zBootes - z-band Observations of the NOAO Deep Wide-Field Survey Bootes Field\"] \n", "}" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['2MASS', '2MASS-point-sources', ' Two Micron All Sky Survey (2MASS)']" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "survey_ids[1]" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "fields = yaml.load(open('../dmu2/meta_main.yml', 'r'))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[{'name': 'AKARI-NEP',\n", " 'description': 'The Infrared Astronomical Satellite AKARI on the North Ecliptic Pole (AKARI-NEP)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/AKARI-NEP_MOC.fits'},\n", " {'name': 'AKARI-SEP',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/AKARI-SEP_MOC.fits'},\n", " {'name': 'Bootes',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/Bootes_MOC.fits'},\n", " {'name': 'CDFS-SWIRE',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/CDFS-SWIRE_MOC.fits'},\n", " {'name': 'COSMOS',\n", " 'description': 'The HELP coverage of the COSMic evOlution Survey field.',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/COSMOS_MOC.fits'},\n", " {'name': 'EGS',\n", " 'description': 'The Extended Groth Strip (EGS)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/EGS_MOC.fits'},\n", " {'name': 'ELAIS-N1',\n", " 'description': 'The European Large Area Infrared Survey field North 1 (ELAIS-N1).',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/ELAIS-N1_MOC.fits'},\n", " {'name': 'ELAIS-N2',\n", " 'description': 'The European Large Area Infrared Survey field North 2 (ELAIS-N2).',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/ELAIS-N2_MOC.fits'},\n", " {'name': 'ELAIS-S1',\n", " 'description': 'The European Large Area Infrared Survey field South 1 (ELAIS-S1).',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/ELAIS-S1_MOC.fits'},\n", " {'name': 'GAMA-09',\n", " 'descrition': 'The GAlaxy and Mass Assembly 9hr field (GAMA-09)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/GAMA-09_MOC.fits'},\n", " {'name': 'GAMA-12',\n", " 'descrition': 'The GAlaxy and Mass Assembly 12hr field (GAMA-12)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/GAMA-12_MOC.fits'},\n", " {'name': 'GAMA-15',\n", " 'descrition': 'The GAlaxy and Mass Assembly 15hr field (GAMA-15)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/GAMA-15_MOC.fits'},\n", " {'name': 'HDF-N',\n", " 'description': 'The Hubble Deep Field - North (HDF-N)',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/HDF-N_MOC.fits'},\n", " {'name': 'Herschel-Stripe-82',\n", " 'description': 'The Herschel coverage of the Sload Digital Sky Survey (SDSS) Stripe 82 field.',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/Herschel-Stripe-82_MOC.fits'},\n", " {'name': 'Lockman-SWIRE',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/Lockman-SWIRE_MOC.fits'},\n", " {'name': 'NGP',\n", " 'description': 'The Herschel HATLAS program coverage of the North Galactic Pole (NGP) field.',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/NGP_MOC.fits'},\n", " {'name': 'SA13',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/SA13_MOC.fits'},\n", " {'name': 'SGP',\n", " 'description': 'The Herschel HATLAS program coverage of the South Galactic Pole (SGP) field.',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/SGP_MOC.fits'},\n", " {'name': 'SPIRE-NEP',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/SPIRE-NEP_MOC.fits'},\n", " {'name': 'SSDF',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/SSDF_MOC.fits'},\n", " {'name': 'xFLS',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/xFLS_MOC.fits'},\n", " {'name': 'XMM-13hr',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/XMM-13hr_MOC.fits'},\n", " {'name': 'XMM-LSS',\n", " 'region': 'dmu_products/dmu2/dmu2_field_coverages/XMM-LSS_MOC.fits'}]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fields['fields']\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "671" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "latex = open('surevey_coverages.tex', 'w+')\n", "latex.write(r\"\"\"\n", "\\begin{landscape}\n", "\\thispagestyle{empty}\n", "\\begin{table}\n", "\\tiny\n", "%\\centering\n", "\\caption{Availability on a given HELP field of each input survey. Table~\\ref{table:fields} describes the id number used for each field. Survey names in there expanded form with references are given in Table~\\ref{table:full-pristine} based on the survey id. }\n", "\\label{table:survey_field_coverages}\n", "\\begin{tabular}{l l l l l l l l l l l l l l l l l l l l l l l l l l l }\n", "\\hline\n", "id&Survey & area (deg.$^2$) & No. fields & \\multicolumn{23}{c}{Area of survey coverage for each field in deg.$^2$ (Use Table~\\ref{table:fields} for key)}\\\\\n", "\\cline{5-27}\n", "& & & &1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16&17&18&19&20&21&22&23\\\\\n", "%\\cline{5-27}\n", "%&&&& 9.2 & 8.7 & 11 & 13 & 5.1 & 3.6 & 14 & 9.2 & 9.0 & 62 & 63 & 62 & 0.7 & 363 & 22 & 178 & 0.3 & 294 & 0.1 & 111 & 7.4 & 0.8 & 22 \\\\ \n", "\\hline\n", "\n", "\"\"\")" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "44\n", "45\n", "46\n", "47\n", "48\n", "49\n", "50\n", "51\n" ] } ], "source": [ "for survey in np.arange(44, 52):\n", " print(survey)" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "45 & Ultradeep & 0.4 (0.0\\%)& 1 & & & & & & & & & & & & & 0.4 & & & & & & & & & & \\\\ \n", "46 & VICS82 & 81 (6.4\\%)& 1 & & & & & & & & & & & & & & 81 & & & & & & & & & \\\\ \n", "47 & VIPERS-MLS & 15 (1.1\\%)& 1 & & & & & & & & & & & & & & & & & & & & & & & 15 \\\\ \n", "48 & VISTA-VHS & 429 (34\\%)& 7 & & 8.7 & & 8.7 & & & & & 9.0 & 24 & & & & 247 & & & & & & 110 & & & 22 \\\\ \n", "49 & VISTA-VIDEO & 14 (1.1\\%)& 3 & & & & 5.1 & & & & & 3.6 & & & & & & & & & & & & & & 5.2 \\\\ \n", "50 & VISTA-VIKING & 436 (34\\%)& 6 & & & & 0.2 & & & & & & 58 & 62 & 61 & & & & & & 245 & & & & & 9.7 \\\\ \n", "51 & zBootes & 6.7 (0.5\\%)& 1 & & & 6.7 & & & & & & & & & & & & & & & & & & & & \\\\ \n" ] } ], "source": [ "help_moc = MOC(filename='../dmu2/help_coverage_MOC.fits')\n", "\n", "#for survey in survey_ids:\n", "for survey in np.arange(45, 52):\n", " survey_name= survey_ids[survey][0]\n", " if survey_ids[survey][1] != \"\":\n", " survey_name = survey_ids[survey][1]\n", " \n", " if survey_name == 'CANDELS':\n", " \n", " survey_moc = ( MOC(filename='../dmu0/dmu0_CANDELS-EGS/survey_coverage_MOC.fits')\n", " + MOC(filename='../dmu0/dmu0_CANDELS-GOODS-N/survey_coverage_MOC.fits')\n", " + MOC(filename='../dmu0/dmu0_CANDELS-GOODS-S/survey_coverage_MOC.fits')\n", " + MOC(filename='../dmu0/dmu0_CANDELS-UDS/survey_coverage_MOC.fits')\n", " )\n", " else:\n", " survey_moc = MOC(filename='../dmu0/dmu0_{}/survey_coverage_MOC.fits'.format(survey_name))\n", " \n", " row = \"\" \n", " n=0\n", " for field in fields['fields']:\n", " field_moc = MOC(filename=field['region'].replace('dmu_products/', '../'))\n", " intersection = survey_moc.intersection(field_moc)\n", " area = intersection.area_sq_deg\n", " area_percent = round(100*area/field_moc.area_sq_deg)\n", " area_frac = round(area/field_moc.area_sq_deg,2)\n", " if area_frac == 1.0:\n", " area_frac = 1\n", " n +=1\n", " \n", " if area < 10:\n", " area = round(area, 1)\n", " else:\n", " area = round(area)\n", " \n", " if area == 0.0:\n", " \n", " n -= 1\n", " row = row + \" & \"\n", " else:\n", " #row = row + \" & {}({}\\\\%)\".format(area, area_percent)\n", " #row = row + \" & {}({})\".format(area, area_frac)\n", " row = row + \" & {}\".format(area)\n", "\n", " \n", " \n", " survey_area = round(survey_moc.intersection(help_moc).area_sq_deg, 1)\n", " survey_percent = round(100*survey_area/help_moc.area_sq_deg, 2)\n", " if survey_percent > 1:\n", " survey_percent = round(survey_percent,1)\n", " if survey_percent > 10:\n", " survey_percent = round(survey_percent)\n", " if survey_area > 10:\n", " survey_area = round(survey_area)\n", " \n", " row = \"{} & {} & {} ({}\\\\%)& {} \".format(survey, survey_ids[survey][0], survey_area, survey_percent, n) + row + \" \\\\\\\\ \"\n", " latex.write(row)\n", " print(row)\n", " \n", " #print(\"{} has a total area of {} square degrees.\".format(survey, survey_moc.area_sq_deg))\n", " \n", " \n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "latex.write(r\"\"\"\n", "\\hline\n", "\n", "\n", "\\end{tabular}\n", "\\end{table}\n", "\\end{landscape}\n", "\n", "\"\"\")\n", "latex.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python (herschelhelp_internal)", "language": "python", "name": "helpint" }, "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.5" } }, "nbformat": 4, "nbformat_minor": 2 }