{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# CDFS SWIRE master catalogue\n", "## Preparation of Fireworks data\n", "\n", "FIREWORKS photometry of GOODS CDF-S catalogue: the catalogue comes from `dmu0_Fireworks`.\n", "\n", "In the catalogue, we keep:\n", "\n", "- The identifier (it's unique in the catalogue);\n", "- The position;\n", "- The stellarity;\n", "- The total magnitude.\n" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This notebook was run with herschelhelp_internal version: \n", "04829ed (Thu Nov 2 16:57:19 2017 +0000)\n" ] } ], "source": [ "from herschelhelp_internal import git_version\n", "print(\"This notebook was run with herschelhelp_internal version: \\n{}\".format(git_version()))" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline\n", "#%config InlineBackend.figure_format = 'svg'\n", "\n", "import matplotlib.pyplot as plt\n", "plt.rc('figure', figsize=(10, 6))\n", "\n", "from collections import OrderedDict\n", "import os\n", "\n", "from astropy import units as u\n", "from astropy.coordinates import SkyCoord\n", "from astropy.table import Column, Table\n", "import numpy as np\n", "\n", "from herschelhelp_internal.flagging import gaia_flag_column\n", "from herschelhelp_internal.masterlist import nb_astcor_diag_plot, remove_duplicates\n", "from herschelhelp_internal.utils import astrometric_correction, mag_to_flux" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "OUT_DIR = os.environ.get('TMP_DIR', \"./data_tmp\")\n", "try:\n", " os.makedirs(OUT_DIR)\n", "except FileExistsError:\n", " pass\n", "\n", "RA_COL = \"fireworks_ra\"\n", "DEC_COL = \"fireworks_dec\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## I - Column selection" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "imported_columns = OrderedDict({\n", " 'Seq':'fireworks_id', \n", " 'RAJ2000':'fireworks_ra', \n", " 'DEJ2000':'fireworks_dec', \n", " 'FU38':'m_fireworks_fu38', \n", " 'e_FU38':'merr_fireworks_fu38', \n", " 'FB435':'m_fireworks_fb435', \n", " 'e_FB435':'merr_fireworks_fb435', \n", " 'FB':'m_fireworks_fb', \n", " 'e_FB':'merr_fireworks_fb',\n", " 'FV':'m_fireworks_fv', \n", " 'e_FV':'merr_fireworks_fv',\n", " 'FV606':'m_fireworks_fv606', \n", " 'e_FV606':'merr_fireworks_fv606',\n", " 'FRc':'m_fireworks_frc', \n", " 'e_FRc':'merr_fireworks_frc',\n", " 'Fi775':'m_fireworks_fi775', \n", " 'e_Fi775':'merr_fireworks_fi775',\n", " 'FI':'m_fireworks_fi', \n", " 'e_FI':'merr_fireworks_fi',\n", " 'Fz850':'m_fireworks_fz850', \n", " 'e_Fz850':'merr_fireworks_fz850',\n", " 'FJ':'m_fireworks_fj', \n", " 'e_FJ':'merr_fireworks_fj',\n", " 'FH':'m_fireworks_fh', \n", " 'e_FH':'merr_fireworks_fh',\n", " 'FKs':'m_fireworks_fks', \n", " 'e_FKs':'merr_fireworks_fks',\n", " #'F3.6':'m_fireworks_f3.6', \n", " #'e_F3.6':'merr_fireworks_F3.6',\n", " #'F4.5':'m_fireworks_F4.5', \n", " #'e_F4.5':'merr_fireworks_F4.5',\n", " #'F5.8':'m_fireworks_F5.8', \n", " #'e_F5.8':'merr_fireworks_F5.8',\n", " #'F8.0':'m_fireworks_F8.0', \n", " #'e_F8.0':'merr_fireworks_F8.0',\n", " 'FKs.t':'m_fireworks_fkst', \n", " 'e_FKs.t':'merr_fireworks_fkst',\n", " 'F24.t':'m_fireworks_f24t',\n", " 'e_F24.t':'merr_fireworks_f24t'\n", " })\n", "\n", "\n", "catalogue = Table.read(\"../../dmu0/dmu0_Fireworks/data/fireworks.fits\")[list(imported_columns)]\n", "for column in imported_columns:\n", " catalogue[column].name = imported_columns[column]\n", "\n", "epoch = 2008\n", "\n", "# Clean table metadata\n", "catalogue.meta = None" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Add flux and band-flag columns\n", "for col in catalogue.colnames:\n", " if col.startswith('m_'):\n", " \n", " errcol = \"merr{}\".format(col[1:])\n", " flux, error = mag_to_flux(np.array(catalogue[col]), np.array(catalogue[errcol]))\n", "\n", " # Fluxes are added in µJy\n", " catalogue.add_column(Column(flux * 1.e6, name=\"f{}\".format(col[1:])))\n", " catalogue.add_column(Column(error * 1.e6, name=\"f{}\".format(errcol[1:])))\n", " \n", " # Band-flag column\n", " catalogue.add_column(Column(np.zeros(len(catalogue), dtype=bool), name=\"flag{}\".format(col[1:])))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "<Table masked=True length=10>\n", "
idx | fireworks_id | fireworks_ra | fireworks_dec | m_fireworks_fu38 | merr_fireworks_fu38 | m_fireworks_fb435 | merr_fireworks_fb435 | m_fireworks_fb | merr_fireworks_fb | m_fireworks_fv | merr_fireworks_fv | m_fireworks_fv606 | merr_fireworks_fv606 | m_fireworks_frc | merr_fireworks_frc | m_fireworks_fi775 | merr_fireworks_fi775 | m_fireworks_fi | merr_fireworks_fi | m_fireworks_fz850 | merr_fireworks_fz850 | m_fireworks_fj | merr_fireworks_fj | m_fireworks_fh | merr_fireworks_fh | m_fireworks_fks | merr_fireworks_fks | m_fireworks_fkst | merr_fireworks_fkst | m_fireworks_f24t | merr_fireworks_f24t | f_fireworks_fu38 | ferr_fireworks_fu38 | flag_fireworks_fu38 | f_fireworks_fb435 | ferr_fireworks_fb435 | flag_fireworks_fb435 | f_fireworks_fb | ferr_fireworks_fb | flag_fireworks_fb | f_fireworks_fv | ferr_fireworks_fv | flag_fireworks_fv | f_fireworks_fv606 | ferr_fireworks_fv606 | flag_fireworks_fv606 | f_fireworks_frc | ferr_fireworks_frc | flag_fireworks_frc | f_fireworks_fi775 | ferr_fireworks_fi775 | flag_fireworks_fi775 | f_fireworks_fi | ferr_fireworks_fi | flag_fireworks_fi | f_fireworks_fz850 | ferr_fireworks_fz850 | flag_fireworks_fz850 | f_fireworks_fj | ferr_fireworks_fj | flag_fireworks_fj | f_fireworks_fh | ferr_fireworks_fh | flag_fireworks_fh | f_fireworks_fks | ferr_fireworks_fks | flag_fireworks_fks | f_fireworks_fkst | ferr_fireworks_fkst | flag_fireworks_fkst | f_fireworks_f24t | ferr_fireworks_f24t | flag_fireworks_f24t |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deg | deg | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | uJy | ||||||||||||||||||||||||||||||||||||||||||||
0 | 1 | 53.2033631 | -27.9372714 | 0.379 | 0.03749 | 0.07 | nan | 0.536 | 0.01313 | 0.721 | 0.01757 | 1.179 | 0.04691 | 1.445 | 0.01582 | 2.636 | 0.06975 | 2.337 | 0.09936 | 3.067 | 0.09619 | 4.073 | 0.202 | 0.163 | 14.31 | 6.378 | 0.34084 | 7.421 | 0.3966 | -20.498 | 7.01084 | 2560943517.16 | 88428268.3376 | False | 3404081897.01 | nan | False | 2216154325.96 | 26800346.3202 | False | 1868959971.65 | 30244571.8933 | False | 1225744632.05 | 52959163.043 | False | 959400631.516 | 13979194.8763 | False | 320331760.085 | 20578792.6828 | False | 421890746.568 | 38608885.2847 | False | 215377335.566 | 19081196.535 | False | 85270733.7344 | 15864524.1255 | False | 3124640085.81 | 41182747182.9 | False | 10204694.3194 | 3203511.12599 | False | 3904810.83749 | 1426357.49951 | False | 5.74380913496e+17 | 3.70890522572e+18 | False |
1 | 2 | 53.2103094 | -27.937425 | 0.295 | 0.04015 | 0.148 | nan | 1.008 | 0.01386 | 1.655 | 0.01861 | 2.027 | 0.04063 | 2.418 | 0.01656 | 3.004 | 0.05869 | 3.398 | 0.10536 | 3.512 | 0.08694 | 3.946 | 0.276 | -0.171 | 14.31 | 5.323 | 0.53908 | 5.976 | 0.60521 | -0.363 | 0.0 | 2766941645.41 | 102320164.49 | False | 3168108159.33 | nan | False | 1434828518.23 | 18316349.0133 | False | 790678628.0 | 13552582.2963 | False | 561306407.675 | 21004991.1239 | False | 391561514.84 | 5972222.95556 | False | 228244331.217 | 12337858.6257 | False | 158781536.421 | 15408183.5016 | False | 142955214.004 | 11447095.7596 | False | 95851739.7686 | 24366029.299 | False | 4250108331.76 | 56016415369.6 | False | 26964973.6354 | 13388406.8006 | False | 14777467.0617 | 8237241.05471 | False | 5072242398.93 | 0.0 | False |
2 | 3 | 53.2042533 | -27.9371053 | 0.239 | 0.04178 | 0.109 | nan | 2.189 | 0.01459 | 5.447 | 0.01962 | 8.797 | 0.04467 | 13.027 | 0.01763 | 30.494 | 0.06376 | 42.097 | 0.11064 | 47.728 | 0.09499 | 66.075 | 0.249 | 0.163 | 14.31 | 58.354 | 0.4049 | 64.601 | 0.44825 | -11.14 | 6.91829 | 2913399222.57 | 112109938.847 | False | 3283976192.5 | nan | False | 483503920.592 | 6497270.85688 | False | 24054703.0499 | 434685.029172 | False | 1099512.06688 | 45236.7746532 | False | 22346.0105773 | 362.850722626 | False | 0.00230356250012 | 0.00013527700777 | False | 5.2625956208e-08 | 5.36275364986e-09 | False | 2.9430659897e-10 | 2.57485968632e-11 | False | 1.34896288259e-17 | 3.09367741716e-18 | False | 3124640085.81 | 41182747182.9 | False | 1.65348401217e-14 | 6.16628305839e-15 | False | 5.24324317246e-17 | 2.16469133271e-17 | False | 1.03752841582e+14 | 6.61111090559e+14 | False |
3 | 4 | 53.1488222 | -27.9376047 | 0.349 | 0.04305 | 0.487 | 0.02308 | 0.46 | 0.01467 | 0.572 | 0.01963 | 0.741 | 0.02594 | 0.845 | 0.01759 | 1.515 | 0.03693 | 1.983 | 0.11174 | 2.569 | 0.05305 | 3.534 | 0.248 | 0.055 | 14.31 | 6.592 | 0.39171 | 10.279 | 1.5538 | 45.7 | 5.27653 | 2632691674.22 | 104387581.512 | False | 2318462095.41 | 49284628.1884 | False | 2376840286.62 | 32114842.3088 | False | 2143877665.97 | 38761089.8473 | False | 1834847607.76 | 43837487.1692 | False | 1667247212.55 | 27011053.2745 | False | 899497581.53 | 30595319.1395 | False | 584520840.359 | 60156747.482 | False | 340721861.659 | 16647961.7073 | False | 140087698.395 | 31998333.5269 | False | 3451437393.36 | 45489934739.7 | False | 8379150.67438 | 3023015.25571 | False | 280801.872812 | 401856.314695 | False | 1.90546071796e-09 | 9.26027942892e-09 | False |
4 | 5 | 53.1564111 | -27.9386647 | 0.0 | 0.01675 | -0.011 | 0.00939 | 0.001 | 0.00578 | -0.004 | 0.00778 | -0.009 | 0.01009 | -0.003 | 0.00701 | 0.004 | 0.01604 | 0.024 | 0.04537 | -0.004 | 0.02234 | -0.036 | 14.31 | -0.025 | 14.31 | 0.434 | 0.31075 | 0.68 | 0.48759 | -10.378 | 5.95989 | 3630780547.7 | 56013213.806 | False | 3667752315.99 | 31720591.1494 | False | 3627438014.76 | 19310944.6231 | False | 3644181507.89 | 26112910.3065 | False | 3661002285.47 | 34022548.8461 | False | 3640826637.89 | 23506810.0518 | False | 3617428867.64 | 53441672.8324 | False | 3551403349.83 | 148403607.871 | False | 3644181507.89 | 74982315.713 | False | 3753185242.38 | 49466970506.3 | False | 3715352290.97 | 48968332317.6 | False | 2434445183.69 | 696765786.677 | False | 1940885877.59 | 871626589.321 | False | 5.14280431949e+13 | 2.82301979996e+14 | False |
5 | 6 | 53.1297942 | -27.9382439 | 0.497 | 0.04684 | 0.625 | 0.02433 | 0.919 | 0.01612 | 1.376 | 0.02154 | 1.414 | 0.02527 | 1.749 | 0.01872 | 1.974 | 0.03583 | 2.09 | 0.1209 | 2.213 | 0.05169 | 2.525 | 0.392 | 0.006 | 14.31 | 2.595 | 0.37657 | 2.263 | 1.5004 | 7.907 | 5.0047 | 2297206307.16 | 99104315.5379 | False | 2041737944.67 | 45752811.7568 | False | 1557399389.08 | 23122815.6913 | False | 1022350938.5 | 20282495.0654 | False | 987188301.068 | 22976343.8473 | False | 725103497.617 | 12502058.4336 | False | 589386250.241 | 19450129.0954 | False | 529663443.892 | 58979621.4641 | False | 472933414.919 | 22515531.9589 | False | 354813389.234 | 128103721.668 | False | 3610771451.0 | 47589957153.0 | False | 332659553.294 | 115377572.78 | False | 451647904.929 | 624141033.14 | False | 2495743.79483 | 11504128.6412 | False |
6 | 7 | 53.1597975 | -27.9386511 | 0.004 | 0.02228 | 0.113 | nan | 0.0 | 0.00764 | -0.003 | 0.01036 | 0.02 | nan | 0.007 | 0.00926 | 0.041 | nan | -0.003 | 0.05832 | 0.077 | nan | -0.081 | 14.31 | 0.029 | 14.31 | 0.436 | 0.29995 | 0.684 | 0.47064 | 0.425 | 6.70151 | 3617428867.64 | 74231949.5453 | False | 3271899836.23 | nan | False | 3630780547.7 | 25548713.6405 | False | 3640826637.89 | 34740449.6629 | False | 3564511334.26 | nan | False | 3607447338.64 | 30767107.341 | False | 3496230040.03 | nan | False | 3640826637.89 | 195565928.99 | False | 3382205566.7 | nan | False | 3912010393.87 | 51560285538.1 | False | 3535086133.62 | 46592424891.4 | False | 2429964897.7 | 671312209.975 | False | 1933748545.3 | 838232538.778 | False | 2454708915.69 | 15151246014.9 | False |
7 | 8 | 53.1559294 | -27.93864 | -0.019 | 0.02712 | 0.002 | 0.00928 | -0.01 | 0.00939 | 0.023 | 0.01252 | -0.009 | 0.01012 | 0.009 | 0.01128 | 0.001 | 0.01605 | -0.017 | 0.07367 | -0.008 | 0.02229 | -0.035 | 14.31 | -0.025 | 14.31 | 0.472 | 0.28056 | 0.779 | 0.41097 | -14.357 | 6.06506 | 3694877122.54 | 92292277.9255 | False | 3624098559.0 | 30975880.2185 | False | 3664375746.48 | 31691388.8555 | False | 3554675819.99 | 40990197.3161 | False | 3661002285.47 | 34123706.0775 | False | 3600808291.73 | 37409747.7387 | False | 3627438014.76 | 53622951.7647 | False | 3688077172.26 | 250245542.232 | False | 3657631930.09 | 75090630.0854 | False | 3749730022.45 | 49421430717.9 | False | 3715352290.97 | 48968332317.6 | False | 2350715115.94 | 607437267.024 | False | 1771740039.94 | 670634359.455 | False | 2.00816780418e+15 | 1.12178797843e+16 | False |
8 | 9 | 53.1508114 | -27.9385994 | -0.015 | 0.03074 | -0.004 | 0.00808 | 0.004 | 0.01046 | 0.002 | 0.01413 | -0.008 | 0.00832 | 0.005 | 0.01268 | -0.006 | 0.01316 | -0.032 | 0.08013 | -0.019 | 0.01826 | -0.029 | 14.31 | -0.055 | 14.31 | 0.837 | 0.27788 | 1.313 | 0.43601 | 3.454 | 5.44554 | 3681289736.43 | 104226833.371 | False | 3644181507.89 | 27119834.8685 | False | 3617428867.64 | 34850367.6949 | False | 3624098559.0 | 47164783.1344 | False | 3657631930.09 | 28028445.1463 | False | 3614098626.4 | 42208015.5215 | False | 3650900524.84 | 44251864.0314 | False | 3739383436.43 | 275975686.772 | False | 3694877122.54 | 62140744.6504 | False | 3729065399.62 | 49149071049.4 | False | 3819442708.4 | 50340243714.5 | False | 1679577313.99 | 429865875.307 | False | 1083427862.15 | 435083015.659 | False | 150799534.18 | 756339239.459 | False |
9 | 10 | 53.1419553 | -27.9386 | -0.036 | 0.0245 | -0.009 | 0.00965 | 0.011 | 0.00834 | 0.002 | 0.01102 | 0.004 | 0.00918 | 0.008 | 0.01 | -0.007 | 0.01416 | -0.041 | 0.06486 | 0.005 | 0.02018 | -0.035 | 14.31 | -0.06 | 14.31 | 0.525 | 0.27571 | 0.824 | 0.43261 | -5.626 | 4.84518 | 3753185242.38 | 84691878.2254 | False | 3661002285.47 | 32538909.4514 | False | 3594181463.15 | 27608431.285 | False | 3624098559.0 | 36783857.7595 | False | 3617428867.64 | 30585695.5487 | False | 3604126286.49 | 33195229.8422 | False | 3654264677.51 | 47658342.4286 | False | 3770509158.33 | 225243685.287 | False | 3614098626.4 | 67173324.3868 | False | 3749730022.45 | 49421430717.9 | False | 3837072454.92 | 50572603722.1 | False | 2238721138.57 | 568497027.556 | False | 1699808513.2 | 677286211.581 | False | 646249172495.0 | 2.88393585096e+12 | False |