{ "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" ] } ], "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": 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_ELAIS-N1.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 | 242.6648 | 53.49125 | 0.951 | 23.2 | 0.09 | 23.01 | 0.11 | 1.90546 | 0.157949 | 2.26986 | 0.229968 | False |
1 | 2 | 242.9633 | 53.4906083333 | 0.755 | 24.16 | 0.23 | 24.29 | 0.28 | 0.787046 | 0.166726 | 0.698231 | 0.180067 | False |
2 | 3 | 243.0122 | 53.4903694444 | 0.919 | 23.58 | 0.14 | 22.63 | 0.12 | 1.34276 | 0.173142 | 3.22107 | 0.356006 | False |
3 | 4 | 242.7964 | 53.49105 | 0.774 | 23.69 | 0.15 | 23.53 | 0.15 | 1.21339 | 0.167636 | 1.40605 | 0.194253 | False |
4 | 5 | 242.6081 | 53.4916888889 | 0.945 | 23.48 | 0.12 | 23.1 | 0.16 | 1.47231 | 0.162726 | 2.08929 | 0.30789 | False |
5 | 6 | 243.0694 | 53.49045 | 0.708 | 24.02 | 0.2 | 24.2 | 0.28 | 0.895364 | 0.164932 | 0.758577 | 0.195629 | False |
6 | 7 | 243.141195833 | 53.4904694444 | 0.868 | 24.56 | 0.33 | 24.31 | 0.17 | 0.544503 | 0.165497 | 0.685488 | 0.107331 | False |
7 | 8 | 242.882495833 | 53.4907194444 | 0.049 | 22.87 | 0.07 | 22.69 | 0.09 | 2.58226 | 0.166484 | 3.04789 | 0.252649 | False |
8 | 9 | 243.034895833 | 53.4908694444 | 0.932 | 23.9 | 0.18 | 23.58 | 0.21 | 1.0 | 0.165786 | 1.34276 | 0.259714 | False |
9 | 10 | 242.883995833 | 53.4914277778 | 0.9 | 24.23 | 0.25 | 23.92 | 0.15 | 0.737904 | 0.169909 | 0.981747 | 0.135633 | False |