{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# HELP Versions of Bootes Matched Aperture Catalogs\n", "\n", "The Bootes multi-wavelength catalog comes in two versions, an I-band selected version ('Idet') and an IRAC Ch2-selected ('ch2det') version. In almost all respects the catalogs are the same, with identical photometry methods applied to both versions and the same raw data and columns.\n", "\n", "There are however slight formatting differences in the catalogs as well a few columns that differ due to the nature of the selection band.\n", "The key differences are:\n", "1. The Idet catalog contains a flag column 'FLAG_DEEP' which incorporate both information from a mask and information about duplicate object in regions where the I-band frames overlap. When using the catalog, it is usually best to require (FLAG_DEEP == 1) but for the purposes of joining the two versions and completeness it is essential to keep all sources in the 'raw' catalogs.\n", "2. The Idet catalog contains a 'CLASS_STAR' column based on the I-band. However no 'CLASS_STAR' column is available for the ch2 det catalog.\n", "3. For convenience in filesize, the Idet catalog is separated into subsections in Declination.\n", "4. Aperture column naming convention differs slightly.\n", "\n", "The output catalogs contain aperture-corrected 2\" fluxes (uJy) and AB magnitudes. Aperture corrections and zeropoint conversions are done based on the curve-of-growth files and supporting information provided by M.Brown.\n", "\n", "Before merging, catalogs should have astrometry corrected to the GAIA frame as is done for all raw HELP dataproducts.\n", "\n", "When merging the two catalogs, if a source is detected in both catalogs then it is a reasonable assumption that all common values are the same. The fluxes/magnitudes can therefore be taken from the primary catalog (suggest 'Idet'), with unique entries in the secondary catalog ('ch2det') being appended." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import os\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from scipy.interpolate import griddata\n", "\n", "from astropy.table import Table, Column, vstack\n", "from astropy.coordinates import SkyCoord\n", "import astropy.units as u\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "date = '07112017'" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "BANDS = ['u', 'Bw', 'R', 'I', \n", " 'z', 'z_Subaru', 'y', 'J', 'H', 'K', 'Ks',\n", " 'ch1', 'ch2', 'ch3', 'ch4']\n", "\n", "opt_nir_bands = ['u','Bw','R','I','z','z_Subaru','y','J','H', 'K', 'Ks']\n", "\n", "# 'FUV', 'NUV',\n", "\n", "help_col_names = ['lbc_u', \n", " 'mosaic_bw', 'mosaic_r', 'mosaic_i',\n", " 'prime90_z', 'suprime_z', 'lbc_y', \n", " 'newfirm_j', 'newfirm_h', 'onis_k', 'newfirm_k',\n", " 'irac_ch1', 'irac_ch2', 'irac_ch3', 'irac_ch4']\n", "\n", "# 'galex_fuv', 'galex_nuv'," ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Catalog meta information, including aperture sizes and zeropoints for all bands" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "aper_sizes = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0]\n", "\n", "zeropoints_table = Table.read('bandinfo.dat',format='ascii.commented_header')\n", "zeropoints_dict = dict(zip(zeropoints_table['brownname'], zeropoints_table['brown_jyzero']))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Aperture column for I selected catalog (format = 'APER_01', 'APER_02',...')" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "aper1 = 2\n", "aper_irac = 2\n", "aper_mips = 10" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Aperture column for IRAC Ch2 selected catalog (format = 'APER', 'APER_1', ...')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "aper_id_1 = 1\n", "aper_id_irac = 1\n", "aper_id_mips = 7" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Load in aperture correction information:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "galex_aper = np.array([1.5, 2.3, 3.8, 6.0, 9.0, 12.8, 17.3])\n", "galex_fuv_corr = np.array([1.65, 0.77, 0.20, 0.1, 0.07, 0.05, 0.04])\n", "galex_nuv_corr = np.array([1.33, 0.62, 0.21, 0.12, 0.08, 0.06, 0.04])\n", "\n", "aper_corr_fuv = 1/10**griddata(galex_aper, galex_fuv_corr, aper1)\n", "aper_corr_nuv = 1/10**griddata(galex_aper, galex_nuv_corr, aper1)\n", "\n", "dat = np.loadtxt(\"moffat_0.68_2.50.dat\")\n", "arg = np.argmin(np.abs(dat[:,0]-aper1))\n", "aper_corr_068 = dat[arg,1]\n", "\n", "dat = np.loadtxt(\"moffat_1.35_2.50.dat\")\n", "arg = np.argmin(np.abs(dat[:,0]-aper1))\n", "aper_corr_135 = dat[arg,1]\n", "\n", "dat = np.loadtxt(\"moffat_1.60_2.50.dat\")\n", "arg = np.argmin(np.abs(dat[:,0]-aper1))\n", "aper_corr_160 = dat[arg,1]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# I-band Selected Catalog" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "DEC Range: 32_33 \n", "\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/software/local/lib64/python2.7/site-packages/ipykernel/__main__.py:83: RuntimeWarning: invalid value encountered in log10\n", "/software/local/lib64/python2.7/site-packages/ipykernel/__main__.py:87: RuntimeWarning: invalid value encountered in log10\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Band: u Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: Bw Zeropoint: 3627.5 Aperture Correction: 0.5496\n", "Band: R Zeropoint: 3014.9 Aperture Correction: 0.5496\n", "Band: I Zeropoint: 2412.5 Aperture Correction: 0.5496\n", "Band: z Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: z_Subaru Zeropoint: 3631.0 Aperture Correction: 0.8632\n", "Band: y Zeropoint: 3631.0 Aperture Correction: 0.5496\n", "Band: J Zeropoint: 1594.0 Aperture Correction: 0.4555\n", "Band: H Zeropoint: 1024.0 Aperture Correction: 0.5496\n", "Band: K Zeropoint: 692.65 Aperture Correction: 0.5496\n", "Band: Ks Zeropoint: 666.7 Aperture Correction: 0.5496\n", "Band: ch1 Zeropoint: 277.5 Aperture Correction: 0.392811\n", "Band: ch2 Zeropoint: 179.5 Aperture Correction: 0.381845\n", "Band: ch3 Zeropoint: 116.6 Aperture Correction: 0.278138\n", "Band: ch4 Zeropoint: 63.1 Aperture Correction: 0.189416\n", "DEC Range: 33_34 \n", "\n", "Band: u Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: Bw Zeropoint: 3627.5 Aperture Correction: 0.5496\n", "Band: R Zeropoint: 3014.9 Aperture Correction: 0.5496\n", "Band: I Zeropoint: 2412.5 Aperture Correction: 0.5496\n", "Band: z Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: z_Subaru Zeropoint: 3631.0 Aperture Correction: 0.8632\n", "Band: y Zeropoint: 3631.0 Aperture Correction: 0.5496\n", "Band: J Zeropoint: 1594.0 Aperture Correction: 0.4555\n", "Band: H Zeropoint: 1024.0 Aperture Correction: 0.5496\n", "Band: K Zeropoint: 692.65 Aperture Correction: 0.5496\n", "Band: Ks Zeropoint: 666.7 Aperture Correction: 0.5496\n", "Band: ch1 Zeropoint: 277.5 Aperture Correction: 0.392811\n", "Band: ch2 Zeropoint: 179.5 Aperture Correction: 0.381845\n", "Band: ch3 Zeropoint: 116.6 Aperture Correction: 0.278138\n", "Band: ch4 Zeropoint: 63.1 Aperture Correction: 0.189416\n", "DEC Range: 34_35 \n", "\n", "Band: u Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: Bw Zeropoint: 3627.5 Aperture Correction: 0.5496\n", "Band: R Zeropoint: 3014.9 Aperture Correction: 0.5496\n", "Band: I Zeropoint: 2412.5 Aperture Correction: 0.5496\n", "Band: z Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: z_Subaru Zeropoint: 3631.0 Aperture Correction: 0.8632\n", "Band: y Zeropoint: 3631.0 Aperture Correction: 0.5496\n", "Band: J Zeropoint: 1594.0 Aperture Correction: 0.4555\n", "Band: H Zeropoint: 1024.0 Aperture Correction: 0.5496\n", "Band: K Zeropoint: 692.65 Aperture Correction: 0.5496\n", "Band: Ks Zeropoint: 666.7 Aperture Correction: 0.5496\n", "Band: ch1 Zeropoint: 277.5 Aperture Correction: 0.392811\n", "Band: ch2 Zeropoint: 179.5 Aperture Correction: 0.381845\n", "Band: ch3 Zeropoint: 116.6 Aperture Correction: 0.278138\n", "Band: ch4 Zeropoint: 63.1 Aperture Correction: 0.189416\n", "DEC Range: 35_36 \n", "\n", "Band: u Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: Bw Zeropoint: 3627.5 Aperture Correction: 0.5496\n", "Band: R Zeropoint: 3014.9 Aperture Correction: 0.5496\n", "Band: I Zeropoint: 2412.5 Aperture Correction: 0.5496\n", "Band: z Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: z_Subaru Zeropoint: 3631.0 Aperture Correction: 0.8632\n", "Band: y Zeropoint: 3631.0 Aperture Correction: 0.5496\n", "Band: J Zeropoint: 1594.0 Aperture Correction: 0.4555\n", "Band: H Zeropoint: 1024.0 Aperture Correction: 0.5496\n", "Band: K Zeropoint: 692.65 Aperture Correction: 0.5496\n", "Band: Ks Zeropoint: 666.7 Aperture Correction: 0.5496\n", "Band: ch1 Zeropoint: 277.5 Aperture Correction: 0.392811\n", "Band: ch2 Zeropoint: 179.5 Aperture Correction: 0.381845\n", "Band: ch3 Zeropoint: 116.6 Aperture Correction: 0.278138\n", "Band: ch4 Zeropoint: 63.1 Aperture Correction: 0.189416\n" ] } ], "source": [ "subcat_names = np.array(['32_33', '33_34', '34_35', '35_36'])\n", "\n", "for ixs, subcat in enumerate(subcat_names): \n", " print('DEC Range: {0} {1}'.format(subcat, '\\n'))\n", " outcat = Table()\n", "\n", " cat = Table.read('/data2/ken/bootes/mbrown_cat/Bootes2014a/Bootes_I_2014a_Idet_{0}_phot.fits'.format(subcat),format='fits')\n", " index = np.arange(1, len(cat)+1)\n", " outcat['id'] = index\n", "\n", " outcat.add_column(cat['ALPHA_J2000'])\n", " outcat.add_column(cat['DELTA_J2000'])\n", " outcat.add_column(cat['FLAG_DEEP'])\n", " outcat.add_column(cat['CLASS_STAR'])\n", "\n", " outcat.add_column(cat['IMAFLAGS_APER_0{0}'.format(aper1)], name='IMAFLAGS')\n", " outcat.add_column(cat['SEGFLAGS_APER_0{0}'.format(aper1)], name='SEGFLAGS')\n", "\n", " for idx, band in enumerate(BANDS):\n", " cat = Table.read('/data2/ken/bootes/mbrown_cat/Bootes2014a/Bootes_{0}_2014a_Idet_{1}_phot.fits'.format(band, subcat),format='fits')\n", "\n", " if band in ['FUV']:\n", " mag = cat['MAG_APER_{0:02d}'.format(aper1)]\n", " magerr = cat['MAGERR_APER_{0:02d}'.format(aper1)]\n", " aper_corr = aper_corr_fuv\n", "\n", " if band in ['NUV']:\n", " mag = cat['MAG_APER_{0:02d}'.format(aper1)]\n", " magerr = cat['MAGERR_APER_{0:02d}'.format(aper1)]\n", " aper_corr = aper_corr_nuv\n", " \n", " if band in opt_nir_bands:\n", " mag = cat['MAG_APER_{0:02d}'.format(aper1)]\n", " magerr = cat['MAGERR_APER_{0:02d}'.format(aper1)]\n", "\n", " if band in ['u', 'z', 'J']:\n", " aper_corr = aper_corr_160\n", " elif band == \"z_Subaru\":\n", " aper_corr = aper_corr_068\n", " else:\n", " aper_corr = aper_corr_135\n", "\n", " elif band in ['ch1','ch2','ch3', 'ch4']:\n", " mag = cat['MAG_APER_{0:02d}'.format(aper_irac)]\n", " magerr = cat['MAGERR_APER_{0:02d}'.format(aper_irac)]\n", "\n", " dat = np.loadtxt(\"{0}_psf_flux.dat\".format(band))\n", " arg = np.argmin(np.abs(dat[:,0]-aper1))\n", " aper_corr = dat[arg,1]\n", "\n", " elif band == '24':\n", " mag = cat['MAG_APER_{0:02d}'.format(aper_mips)]\n", " magerr = cat['MAGERR_APER_{0:02d}'.format(aper_mips)]\n", " dat = np.loadtxt(\"mips24_prf_flux.dat\".format(band))\n", " arg = np.argmin(np.abs(dat[:,0]-aper_mips))\n", " aper_corr = dat[arg,1]\n", "\n", " zp = zeropoints_dict[band]\n", " \n", " mag_copy = np.copy(mag)\n", " notobs = np.logical_or(mag_copy == 0., mag_copy == 99.9)\n", "\n", " flux = ((zp*10.0**(-0.4*np.abs(mag_copy)))*u.Jy).to(u.uJy)\n", " \n", " isnegative = (mag_copy < 0) \n", " flux[isnegative] *= -1.\n", " \n", " fluxerr = np.abs(flux) * (magerr/(2.5*np.log10(np.e)))\n", " \n", " flux[notobs] = -99.*u.uJy\n", " fluxerr[notobs] = -99.*u.uJy\n", "\n", " # Aperture correction\n", " flux /= aper_corr\n", " \n", " # Correct Flux error to maintain measured S/N\n", " fluxerr /= aper_corr \n", "\n", " \n", " lim = (flux/fluxerr < 2.)\n", "\n", " # Convert Jansky fluxes back to AB magnitudes\n", " mag = 23.9 - 2.5*np.log10(flux.value)\n", " #magerr = 2.5*np.log10(np.e)*(fluxerr/flux).value\n", " \n", " magerr[lim] = -99.\n", " mag[lim] = 23.9 - 2.5*np.log10((flux + 2*fluxerr).value)[lim]\n", " \n", " flux[fluxerr <= 0.0] = -99.*u.uJy\n", " fluxerr[flux == -99.*u.uJy] = -99*u.uJy\n", "\n", " mag[np.logical_or(flux < -90*u.uJy, fluxerr < -90.*u.uJy)] = -99.\n", " magerr[np.logical_or(flux < -90.*u.uJy, fluxerr < -90*u.uJy)] = -99.\n", " \n", " outcat.add_column(Column(name='m_ap_{0}'.format(help_col_names[idx]),\n", " data=mag))\n", " outcat.add_column(Column(name='merr_ap_{0}'.format(help_col_names[idx]),\n", " data=magerr))\n", "\n", " outcat.add_column(Column(name='f_ap_{0}'.format(help_col_names[idx]),\n", " data=flux))\n", " outcat.add_column(Column(name='ferr_ap_{0}'.format(help_col_names[idx]),\n", " data=fluxerr))\n", "\n", " print('Band: {0} Zeropoint: {1} Aperture Correction: {2}'.format(band, zp, aper_corr))\n", " \n", " outname = 'bootes_merged_Icorr_2014a_{0}_ap{1}_{2}.fits'.format(subcat, aper1, date)\n", " if os.path.isfile(outname):\n", " os.remove(outname)\n", " outcat.write(outname,\n", " format='fits')\n", "\n", " if ixs == 0:\n", " combined_cat = outcat.copy()\n", " else:\n", " combined_cat = vstack([combined_cat, outcat])" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": true }, "outputs": [], "source": [ "new_ids = np.arange(1, len(combined_cat)+1)\n", "\n", "combined_cat['id'] = new_ids\n", "outname = 'Bootes_merged_Icorr_2014a_{0}_ap{1}_{2}.fits'.format('all', aper1, date)\n", "if os.path.isfile(outname):\n", " os.remove(outname)\n", "combined_cat.write(outname, format='fits')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# IRAC Ch2-selected Catalog" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/software/local/lib64/python2.7/site-packages/astropy/units/quantity.py:641: RuntimeWarning: divide by zero encountered in true_divide\n", " *arrays, **kwargs)\n", "/software/local/lib64/python2.7/site-packages/ipykernel/__main__.py:73: RuntimeWarning: invalid value encountered in log10\n", "/software/local/lib64/python2.7/site-packages/ipykernel/__main__.py:77: RuntimeWarning: invalid value encountered in log10\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Band: u Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: Bw Zeropoint: 3627.5 Aperture Correction: 0.5496\n", "Band: R Zeropoint: 3014.9 Aperture Correction: 0.5496\n", "Band: I Zeropoint: 2412.5 Aperture Correction: 0.5496\n", "Band: z Zeropoint: 3631.0 Aperture Correction: 0.4555\n", "Band: z_Subaru Zeropoint: 3631.0 Aperture Correction: 0.8632\n", "Band: y Zeropoint: 3631.0 Aperture Correction: 0.5496\n", "Band: J Zeropoint: 1594.0 Aperture Correction: 0.4555\n", "Band: H Zeropoint: 1024.0 Aperture Correction: 0.5496\n", "Band: K Zeropoint: 692.65 Aperture Correction: 0.5496\n", "Band: Ks Zeropoint: 666.7 Aperture Correction: 0.5496\n", "Band: ch1 Zeropoint: 277.5 Aperture Correction: 0.392811\n", "Band: ch2 Zeropoint: 179.5 Aperture Correction: 0.381845\n", "Band: ch3 Zeropoint: 116.6 Aperture Correction: 0.278138\n", "Band: ch4 Zeropoint: 63.1 Aperture Correction: 0.189416\n" ] } ], "source": [ "outcat = Table()\n", "\n", "cat = Table.read('/data2/ken/bootes/mbrown_cat/Bootes2014a_ch2/ch2v34_sdwfs_{0}_2014a.fits'.format('ch2'),format='fits')\n", "index = np.arange(1, len(cat)+1)\n", "outcat['id'] = index\n", "\n", "outcat.add_column(cat['ALPHA_J2000'])\n", "outcat.add_column(cat['DELTA_J2000'])\n", "#outcat.add_column(cat['FLAG_DEEP'])\n", "#outcat.add_column(cat['CLASS_STAR'])\n", "\n", "outcat.add_column(cat['IMAFLAGS_APER_{0}'.format(aper_id_1)], name='IMAFLAGS')\n", "outcat.add_column(cat['SEGFLAGS_APER_{0}'.format(aper_id_1)], name='SEGFLAGS')\n", "\n", "\n", "for idx, band in enumerate(BANDS):\n", " cat = Table.read('/data2/ken/bootes/mbrown_cat/Bootes2014a_ch2/ch2v34_sdwfs_{0}_2014a.fits'.format(band),format='fits')\n", "\n", " if band in ['NUV']:\n", " mag = cat['MAG_APER_{0}'.format(aper_id_1)]\n", " magerr = cat['MAGERR_APER_{0}'.format(aper_id_1)]\n", " aper_corr = aper_corr_nuv\n", " \n", " if band in opt_nir_bands:\n", " mag = cat['MAG_APER_{0}'.format(aper_id_1)]\n", " magerr = cat['MAGERR_APER_{0}'.format(aper_id_1)]\n", "\n", " if band in [\"u\", \"z\", \"J\"]:\n", " aper_corr = aper_corr_160\n", " elif band == \"z_Subaru\":\n", " aper_corr = aper_corr_068\n", " else:\n", " aper_corr = aper_corr_135\n", "\n", " elif band in ['ch1','ch2','ch3', 'ch4']:\n", " mag = cat['MAG_APER_{0}'.format(aper_id_irac)]\n", " magerr = cat['MAGERR_APER_{0}'.format(aper_id_irac)]\n", "\n", " dat = np.loadtxt(\"{0}_psf_flux.dat\".format(band))\n", " arg = np.argmin(np.abs(dat[:,0]-aper1))\n", " aper_corr = dat[arg,1]\n", "\n", " elif band == '24':\n", " mag = cat['MAG_APER_{0}'.format(aper_id_mips)]\n", " magerr = cat['MAGERR_APER_{0}'.format(aper_id_mips)]\n", " dat = np.loadtxt(\"mips24_prf_flux.dat\".format(band))\n", " arg = np.argmin(np.abs(dat[:,0]-aper_mips))\n", " aper_corr = dat[arg,1]\n", "\n", " zp = zeropoints_dict[band]\n", "\n", " mag_copy = np.copy(mag)\n", " notobs = np.logical_or(mag_copy == 0., mag_copy == 99.9)\n", "\n", " flux = ((zp*10.0**(-0.4*np.abs(mag_copy)))*u.Jy).to(u.uJy)\n", "\n", " isnegative = (mag_copy < 0) \n", " flux[isnegative] *= -1.\n", "\n", " fluxerr = np.abs(flux) * (magerr.data/(2.5*np.log10(np.e)))\n", "\n", " flux[notobs] = -99.*u.uJy\n", " fluxerr[notobs] = -99.*u.uJy\n", "\n", " # Aperture correction\n", " flux /= aper_corr\n", " # Correct Flux error to maintain measured S/N\n", " fluxerr /= aper_corr \n", " \n", " lim = (flux/fluxerr < 2.)\n", "\n", " # Convert Jansky fluxes back to AB magnitudes\n", " mag = 23.9 - 2.5*np.log10(flux.value)\n", " #magerr = 2.5*np.log10(np.e)*(fluxerr/flux).value\n", "\n", " magerr[lim] = -99.\n", " mag[lim] = 23.9 - 2.5*np.log10((flux + 2*fluxerr).value)[lim]\n", "\n", " flux[fluxerr <= 0.0] = -99.*u.uJy\n", " fluxerr[flux == -99.*u.uJy] = -99*u.uJy\n", "\n", " mag[np.logical_or(flux < -90*u.uJy, fluxerr < -90.*u.uJy)] = -99.\n", " magerr[np.logical_or(flux < -90.*u.uJy, fluxerr < -90*u.uJy)] = -99.\n", "\n", " outcat.add_column(Column(name='m_ap_{0}'.format(help_col_names[idx]),\n", " data=mag))\n", " outcat.add_column(Column(name='merr_ap_{0}'.format(help_col_names[idx]),\n", " data=magerr))\n", "\n", " outcat.add_column(Column(name='f_ap_{0}'.format(help_col_names[idx]),\n", " data=flux))\n", " outcat.add_column(Column(name='ferr_ap_{0}'.format(help_col_names[idx]),\n", " data=fluxerr))\n", "\n", " print('Band: {0} Zeropoint: {1} Aperture Correction: {2}'.format(band, zp, aper_corr))\n", "\n", "outname = 'bootes_merged_ch2corr_2014a_all_ap{0}_{1}.fits'.format(aper1, date)\n", "\n", "if os.path.isfile(outname):\n", " os.remove(outname)\n", "\n", "outcat.write(outname, format='fits')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.13" } }, "nbformat": 4, "nbformat_minor": 2 }