{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# xFLS master catalogue\n", "## Preparation of KPNO-FLS data\n", "\n", "KPNO-FLS catalogue: the catalogue comes from `dmu0_KPNO-FLS`.\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 aperture magnitude;\n", "- The total magnitude.\n", "\n", "We don't know when the maps have been observed. We will use the year of the reference paper." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This notebook was run with herschelhelp_internal version: \n", "0246c5d (Thu Jan 25 17:01:47 2018 +0000) [with local modifications]\n", "This notebook was executed on: \n", "2018-02-21 12:24:27.728133\n" ] } ], "source": [ "from herschelhelp_internal import git_version\n", "print(\"This notebook was run with herschelhelp_internal version: \\n{}\".format(git_version()))\n", "import datetime\n", "print(\"This notebook was executed on: \\n{}\".format(datetime.datetime.now()))" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "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 = \"kpno_ra\"\n", "DEC_COL = \"kpno_dec\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## I - Column selection" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "imported_columns = OrderedDict({\n", " 'internal_id': \"kpno_intid\",\n", " 'RAJ2000': \"kpno_ra\",\n", " 'DEJ2000': \"kpno_dec\",\n", " 'Class': \"kpno_stellarity\",\n", " 'RcmagAp': \"m_ap_mosaic_r\", \n", " 'e_RcmagAp': \"merr_ap_mosaic_r\", \n", " 'RcmagTot': \"m_mosaic_r\", \n", " 'e_RcmagTot': \"merr_mosaic_r\",\n", " })\n", "\n", "\n", "catalogue = Table.read(\"../../dmu0/dmu0_KPNO-FLS/data/KPNO-FLS_xFLS.fits\")[list(imported_columns)]\n", "for column in imported_columns:\n", " catalogue[column].name = imported_columns[column]\n", "\n", "epoch = 2011\n", "\n", "# Clean table metadata\n", "catalogue.meta = None" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "# Adding flux and band-flag columns\n", "for col in catalogue.colnames:\n", " if col.startswith('m_'):\n", " \n", " errcol = \"merr{}\".format(col[1:]) \n", "\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", " if \"ap\" not in col:\n", " catalogue.add_column(Column(np.zeros(len(catalogue), dtype=bool), name=\"flag{}\".format(col[1:])))\n", " \n", "# TODO: Set to True the flag columns for fluxes that should not be used for SED fitting." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<Table length=10>\n", "
idx | kpno_intid | kpno_ra | kpno_dec | kpno_stellarity | m_ap_mosaic_r | merr_ap_mosaic_r | m_mosaic_r | merr_mosaic_r | f_ap_mosaic_r | ferr_ap_mosaic_r | f_mosaic_r | ferr_mosaic_r | flag_mosaic_r |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
deg | deg | mag | mag | mag | mag | ||||||||
0 | 1 | 258.018795833 | 59.6362777778 | 0.368 | 23.71 | 0.11 | 23.12 | 0.13 | 1.19124 | 0.120689 | 2.05116 | 0.245594 | False |
1 | 2 | 258.0183 | 59.6358472222 | 0.307 | 23.43 | 0.08 | 22.47 | 0.11 | 1.5417 | 0.113597 | 3.7325 | 0.378154 | False |
2 | 3 | 258.020195833 | 59.6356472222 | 0.055 | 21.88 | 0.02 | 21.49 | 0.03 | 6.42688 | 0.118387 | 9.20449 | 0.254329 | False |
3 | 4 | 258.0507 | 59.6369083333 | 0.854 | 24.17 | 0.16 | 23.58 | 0.19 | 0.77983 | 0.11492 | 1.34276 | 0.234979 | False |
4 | 5 | 257.9012 | 59.6356083333 | 0.63 | 24.6 | 0.25 | 24.56 | 0.17 | 0.524807 | 0.120841 | 0.544503 | 0.085256 | False |
5 | 6 | 258.0667 | 59.6368888889 | 0.982 | 22.82 | 0.04 | 22.8 | 0.04 | 2.70396 | 0.0996175 | 2.75423 | 0.10147 | False |
6 | 7 | 257.9642 | 59.6354277778 | 0.029 | 21.41 | 0.01 | 20.76 | 0.02 | 9.90832 | 0.091259 | 18.0302 | 0.332128 | False |
7 | 8 | 258.0692 | 59.6377083333 | 0.911 | 24.2 | 0.08 | 24.2 | 0.08 | 0.758577 | 0.055894 | 0.758577 | 0.055894 | False |
8 | 9 | 258.105 | 59.6380583333 | 0.9 | 23.76 | 0.11 | 23.68 | 0.19 | 1.13763 | 0.115257 | 1.22462 | 0.214303 | False |
9 | 10 | 257.947 | 59.6359277778 | 0.624 | 23.2 | 0.07 | 23.03 | 0.08 | 1.90546 | 0.12285 | 2.22843 | 0.164197 | False |