{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Masterlist overview\n", "\n", "This notebook summarises some important properties of the data presented here. This includes\n", "\n", "- The area covered by each field\n", "- The number of total sources in each field\n", "- The number of bands which we have data for in each field\n", "- The size of the masterlist in each field" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/opt/pyenv/versions/3.7.2/lib/python3.7/site-packages/matplotlib/__init__.py:855: MatplotlibDeprecationWarning: \n", "examples.directory is deprecated; in the future, examples will be found relative to the 'datapath' directory.\n", " \"found relative to the 'datapath' directory.\".format(key))\n", "/opt/pyenv/versions/3.7.2/lib/python3.7/site-packages/matplotlib/__init__.py:846: MatplotlibDeprecationWarning: \n", "The text.latex.unicode rcparam was deprecated in Matplotlib 2.2 and will be removed in 3.1.\n", " \"2.2\", name=key, obj_type=\"rcparam\", addendum=addendum)\n", "/opt/pyenv/versions/3.7.2/lib/python3.7/site-packages/seaborn/apionly.py:9: 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": [ "from astropy.table import Table, Column\n", "from astropy import units as u\n", "import numpy as np\n", "\n", "from pymoc import MOC\n", "\n", "from herschelhelp_internal.masterlist import find_last_ml_suffix\n", "\n", "import os\n", "import humanfriendly" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## The definition of HELP DR1\n", "Here we define DR1, which should be considered the principle definition in terms of the dated masterlist file that defines the object list on a given field. In some cases it is different to the masterlist used by an intermediate step because it was in progress as that step began. Nevertheless these files define DR1 so any discrepencies will force these objects lists through. The most likely upshot if this is that there may be objects in the dr1 masterlist that were not used in further steps and therefore lack, photozs, fir fluxes, or Cigale fits." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "dr1 = [\n", "# Field suffix\n", "['AKARI-NEP', '20180215' ],\n", "['AKARI-SEP', '20180221' ],\n", "['Bootes', '20190201' ], \n", "['CDFS-SWIRE', '20180613' ],\n", "['COSMOS', '20190402' ],\n", "['EGS', '20180501' ],\n", "['ELAIS-N1', '20171016' ],\n", "['ELAIS-N2', '20180218' ],\n", "['ELAIS-S1', '20180416' ],\n", "['GAMA-09', '20180601' ],\n", "['GAMA-12', '20180218' ],\n", "['GAMA-15', '20180213' ],\n", "['HDF-N', '20180427' ],\n", "['Herschel-Stripe-82', '20180307' ],\n", "['Lockman-SWIRE', '20180219' ],\n", "['NGP', '20180219' ],\n", "['SA13', '20180501' ],\n", "['SGP', '20180221' ],\n", "['SPIRE-NEP', '20180220' ],\n", "['SSDF', '20180221' ],\n", "['xFLS', '20180501' ],\n", "['XMM-13hr', '20180501' ],\n", "['XMM-LSS', '20190328' ]]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "masterlist_summary = Table()\n", "masterlist_summary.add_column(Column(data = np.array(dr1)[:,0], name = 'field'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), '', dtype=\"S20\"), name = 'dr1_suffix'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), '', dtype=\"S20\"), name = 'last_suffix'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), 0, dtype=int), name = 'objects'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), np.nan, dtype=float), name = 'area_sq_degrees'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), 0, dtype=int), name = 'file_size_bytes'))\n", "masterlist_summary.add_column(Column(data =np.full(len(masterlist_summary), '', dtype=\"S20\"), name = 'file_size_readable'))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total HELP area: 1269.6205101879136 sqare degrees\n" ] } ], "source": [ "help_moc = MOC(filename='../dmu2/help_coverage_MOC.fits')\n", "print('Total HELP area: {} sqare degrees'.format(help_moc.area_sq_deg))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "for field in dr1:\n", " number_objects = len(Table.read('dmu1_ml_{}/data/master_list_cross_ident_{}_{}.fits'.format(field[0], \n", " field[0].lower(), \n", " field[1])))\n", " masterlist_summary['objects'][masterlist_summary['field'] == field[0]] = number_objects\n", " \n", " \n", " moc = MOC(filename='../dmu2/dmu2_field_coverages/{}_MOC.fits'.format(field[0]))\n", " area = moc.area_sq_deg\n", " masterlist_summary['area_sq_degrees'][masterlist_summary['field'] == field[0]] = area\n", " \n", " masterlist_summary['dr1_suffix'][masterlist_summary['field'] == field[0]] = field[1]\n", " masterlist_summary['last_suffix'][masterlist_summary['field'] == field[0]] = find_last_ml_suffix('dmu1_ml_{}/data/'.format(field[0]))\n", " \n", " size = os.stat('dmu1_ml_{}/data/master_catalogue_{}_{}.fits'.format(field[0], \n", " field[0].lower(), \n", " field[1])).st_size\n", "\n", " \n", " \n", " #Can't install packages on Vulcain\n", " #size_readable = humanfriendly.format_size(size)\n", " masterlist_summary['file_size_bytes'][masterlist_summary['field'] == field[0]] = size\n", " masterlist_summary['file_size_readable'][masterlist_summary['field'] == field[0]] = humanfriendly.format_size(size)\n", " \n", "\n", " \n", " #TODO:\n", " num_surveys = 0.\n", " \n", " #Mean depth in g\n", " mean_depth = 0.\n", " \n", " num_bands = 0." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Table length=23\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
idxfielddr1_suffixlast_suffixobjectsarea_sq_degreesfile_size_bytesfile_size_readable
0AKARI-NEP20180215201802155317469.194732358779467348848640348.85 MB
1AKARI-SEP20180221201802218441728.713306475131118538606080538.61 MB
2Bootes2018052020190201348166111.4281529909548650020444805 GB
3CDFS-SWIRE2018061320180613217105112.97124640371706857055939205.71 GB
4COSMOS201904022019040225993745.0838634784968161051717536010.52 GB
5EGS201805012018050114126133.56638327512215838084803203.81 GB
6ELAIS-N12017101620180216402629213.50748455545476352422796805.24 GB
7ELAIS-N2201802182018021817832409.16747990399111320079648002.01 GB
8ELAIS-S1201804162018041616555649.00294064688550819701561601.97 GB
9GAMA-0920180601201901231293798262.013934172849151991161152019.91 GB
10GAMA-1220180218201901281236941562.709332807721071463306688014.63 GB
11GAMA-1520180213201902011423288061.701145659808421659558528016.6 GB
12HDF-N20180427201804271306790.6717832558166041185996160186 MB
13Herschel-Stripe-82201803072019020550196455363.22747930641884127047306240127.05 GB
14Lockman-SWIRE2018021920180219436629822.41386340294921851959318405.2 GB
15NGP20180219201902046759591177.698197107716249548067204.95 GB
16SA13201805012018050197990.2741637932843118427216002.72 MB
17SGP201802212018022129790690294.56845409006424519253088045.19 GB
18SPIRE-NEP201802202018022026740.128066046937739112038401.2 MB
19SSDF201802212018022112661903111.1162494934353980783193608.08 GB
20xFLS20180501201805019771487.4404324214075410504742401.05 GB
21XMM-13hr2018050120180501386290.75702401665836331067616010.68 MB
22XMM-LSS2019032820190328870583721.754579393313742824183872028.24 GB
\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "masterlist_summary.show_in_notebook()" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total number of objects in HELP: 171685693\n" ] } ], "source": [ "print('Total number of objects in HELP: {}'.format(np.sum(masterlist_summary['objects'])))" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total size of masterlist files: 306.24 GB\n" ] } ], "source": [ "print('Total size of masterlist files: {}'.format(humanfriendly.format_size(np.sum(masterlist_summary['file_size_bytes']))))" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": true }, "outputs": [], "source": [ "masterlist_summary.write('dr1_overview.fits', overwrite=True)" ] } ], "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.8" } }, "nbformat": 4, "nbformat_minor": 2 }