EGS master catalogue

This notebook presents the merge of the various pristine catalogues to produce HELP mater catalogue on EGS.

In [1]:
from herschelhelp_internal import git_version
print("This notebook was run with herschelhelp_internal version: \n{}".format(git_version()))
This notebook was run with herschelhelp_internal version: 
44f1ae0 (Thu Nov 30 18:27:54 2017 +0000)
In [2]:
%matplotlib inline
#%config InlineBackend.figure_format = 'svg'

import matplotlib.pyplot as plt
plt.rc('figure', figsize=(10, 6))

import os
import time

from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Column, Table
import numpy as np
from pymoc import MOC

from herschelhelp_internal.masterlist import merge_catalogues, nb_merge_dist_plot, specz_merge
from herschelhelp_internal.utils import coords_to_hpidx, ebv, gen_help_id, inMoc
In [3]:
TMP_DIR = os.environ.get('TMP_DIR', "./data_tmp")
OUT_DIR = os.environ.get('OUT_DIR', "./data")
SUFFIX = os.environ.get('SUFFIX', time.strftime("_%Y%m%d"))

try:
    os.makedirs(OUT_DIR)
except FileExistsError:
    pass

I - Reading the prepared pristine catalogues

In [4]:
aegis = Table.read("{}/AEGIS.fits".format(TMP_DIR))
candels = Table.read("{}/CANDELS-EGS.fits".format(TMP_DIR))
wirds = Table.read("{}/CFHT-WIRDS.fits".format(TMP_DIR))
cfhtls_wide = Table.read("{}/CFHTLS-WIDE.fits".format(TMP_DIR))
cfhtls_deep = Table.read("{}/CFHTLS-DEEP.fits".format(TMP_DIR))
cfhtlens = Table.read("{}/CFHTLENS.fits".format(TMP_DIR))
deep = Table.read("{}/DEEP2.fits".format(TMP_DIR))
irac = Table.read("{}/IRAC-EGS.fits".format(TMP_DIR))
hsc = Table.read("{}/HSC.fits".format(TMP_DIR))
ps1 = Table.read("{}/PS1.fits".format(TMP_DIR))
legacy = Table.read("{}/LegacySurvey.fits".format(TMP_DIR))
uhs = Table.read("{}/UHS.fits".format(TMP_DIR))

II - Merging tables

We first merge the optical catalogues and then add the infrared ones.

At every step, we look at the distribution of the distances separating the sources from one catalogue to the other (within a maximum radius) to determine the best cross-matching radius.

HSC

In [5]:
master_catalogue = hsc
master_catalogue['hsc_ra'].name = 'ra'
master_catalogue['hsc_dec'].name = 'dec'

Add PanSTARRS

In [6]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(ps1['ps1_ra'], ps1['ps1_dec'])
)
In [7]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, ps1, "ps1_ra", "ps1_dec", radius=0.8*u.arcsec)

AEGIS

In [8]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(aegis['aegis_ra'], aegis['aegis_dec'])
)
In [9]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, aegis, "aegis_ra", "aegis_dec", radius=0.8*u.arcsec)

CANDELS

In [10]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(candels['candels-egs_ra'], candels['candels-egs_dec'])
)
In [11]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, candels, "candels-egs_ra", "candels-egs_dec", radius=0.8*u.arcsec)

CFHT-WIRDS

In [12]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(wirds['wirds_ra'], wirds['wirds_dec'])
)
In [13]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, wirds, "wirds_ra", "wirds_dec", radius=0.8*u.arcsec)

CFHTLS-WIDE

In [14]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(cfhtls_wide['cfhtls-wide_ra'], cfhtls_wide['cfhtls-wide_dec'])
)
In [15]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, 
                                    cfhtls_wide, 
                                    "cfhtls-wide_ra", 
                                    "cfhtls-wide_dec", 
                                    radius=0.8*u.arcsec)

CFHTLS-DEEP

In [16]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(cfhtls_deep['cfhtls-deep_ra'], cfhtls_deep['cfhtls-deep_dec'])
)
In [17]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, 
                                    cfhtls_deep, 
                                    "cfhtls-deep_ra", 
                                    "cfhtls-deep_dec", 
                                    radius=0.8*u.arcsec)

CFHTLenS

In [18]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(cfhtlens['cfhtlens_ra'], cfhtlens['cfhtlens_dec'])
)
In [19]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, cfhtlens, "cfhtlens_ra", "cfhtlens_dec", radius=0.8*u.arcsec)

DEEP2

In [20]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(deep['deep2_ra'], deep['deep2_dec'])
)
In [21]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, deep, "deep2_ra", "deep2_dec", radius=0.8*u.arcsec)

IRAC-EGS

In [22]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(irac['irac-egs_ra'], irac['irac-egs_dec'])
)
In [23]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, irac, "irac-egs_ra", "irac-egs_dec", radius=0.8*u.arcsec)

Legacy Survey

In [24]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(legacy['legacy_ra'], legacy['legacy_dec'])
)
In [25]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, legacy, "legacy_ra", "legacy_dec", radius=0.8*u.arcsec)

UHS

In [26]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(uhs['uhs_ra'], uhs['uhs_dec'])
)
In [27]:
# Given the graph above, we use 0.8 arc-second radius
master_catalogue = merge_catalogues(master_catalogue, uhs, "uhs_ra", "uhs_dec", radius=0.8*u.arcsec)

Cleaning

When we merge the catalogues, astropy masks the non-existent values (e.g. when a row comes only from a catalogue and has no counterparts in the other, the columns from the latest are masked for that row). We indicate to use NaN for masked values for floats columns, False for flag columns and -1 for ID columns.

In [28]:
for col in master_catalogue.colnames:
    if "m_" in col or "merr_" in col or "f_" in col or "ferr_" in col or "stellarity" in col:
        master_catalogue[col].fill_value = np.nan
    elif "flag" in col:
        master_catalogue[col].fill_value = 0
    elif "id" in col:
        master_catalogue[col].fill_value = -1
        
master_catalogue = master_catalogue.filled()
In [29]:
master_catalogue[:10].show_in_notebook()
Out[29]:
<Table length=10>
idxhsc_idradecm_ap_suprime_gmerr_ap_suprime_gm_suprime_gmerr_suprime_gm_ap_suprime_rmerr_ap_suprime_rm_suprime_rmerr_suprime_rm_ap_suprime_imerr_ap_suprime_im_suprime_imerr_suprime_im_ap_suprime_zmerr_ap_suprime_zm_suprime_zmerr_suprime_zm_ap_suprime_ymerr_ap_suprime_ym_suprime_ymerr_suprime_yhsc_stellarityf_ap_suprime_gferr_ap_suprime_gf_suprime_gferr_suprime_gflag_suprime_gf_ap_suprime_rferr_ap_suprime_rf_suprime_rferr_suprime_rflag_suprime_rf_ap_suprime_iferr_ap_suprime_if_suprime_iferr_suprime_iflag_suprime_if_ap_suprime_zferr_ap_suprime_zf_suprime_zferr_suprime_zflag_suprime_zf_ap_suprime_yferr_ap_suprime_yf_suprime_yferr_suprime_yflag_suprime_yhsc_flag_cleanedhsc_flag_gaiaflag_mergedps1_idm_ap_gpc1_gmerr_ap_gpc1_gm_gpc1_gmerr_gpc1_gm_ap_gpc1_rmerr_ap_gpc1_rm_gpc1_rmerr_gpc1_rm_ap_gpc1_imerr_ap_gpc1_im_gpc1_imerr_gpc1_im_ap_gpc1_zmerr_ap_gpc1_zm_gpc1_zmerr_gpc1_zm_ap_gpc1_ymerr_ap_gpc1_ym_gpc1_ymerr_gpc1_yf_ap_gpc1_gferr_ap_gpc1_gf_gpc1_gferr_gpc1_gflag_gpc1_gf_ap_gpc1_rferr_ap_gpc1_rf_gpc1_rferr_gpc1_rflag_gpc1_rf_ap_gpc1_iferr_ap_gpc1_if_gpc1_iferr_gpc1_iflag_gpc1_if_ap_gpc1_zferr_ap_gpc1_zf_gpc1_zferr_gpc1_zflag_gpc1_zf_ap_gpc1_yferr_ap_gpc1_yf_gpc1_yferr_gpc1_yflag_gpc1_yps1_flag_cleanedps1_flag_gaiaaegis_idm_aegis_kmerr_aegis_km_ap_aegis_kmerr_ap_aegis_km_ap_aegis_jmerr_ap_aegis_jf_aegis_kferr_aegis_kflag_aegis_kf_ap_aegis_kferr_ap_aegis_kf_ap_aegis_jferr_ap_aegis_jm_aegis_jmerr_aegis_jf_aegis_jferr_aegis_jflag_aegis_jaegis_flag_cleanedaegis_flag_gaiacandels-egs_idcandels-egs_stellarityf_ap_acs_f606wferr_ap_acs_f606wf_acs_f606wferr_acs_f606wf_ap_acs_f814wferr_ap_acs_f814wf_acs_f814wferr_acs_f814wf_ap_wfc3_f125wferr_ap_wfc3_f125wf_wfc3_f125wferr_wfc3_f125wf_ap_wfc3_f140wferr_ap_wfc3_f140wf_wfc3_f140wferr_wfc3_f140wf_ap_wfc3_f160wferr_ap_wfc3_f160wf_wfc3_f160wferr_wfc3_f160wf_candels-megacam_uferr_candels-megacam_uf_candels-megacam_gferr_candels-megacam_gf_candels-megacam_rferr_candels-megacam_rf_candels-megacam_iferr_candels-megacam_if_candels-megacam_zferr_candels-megacam_zf_candels-wircam_jferr_candels-wircam_jf_candels-wircam_hferr_candels-wircam_hf_candels-wircam_kferr_candels-wircam_kf_candels-newfirm_j1ferr_candels-newfirm_j1f_candels-newfirm_j2ferr_candels-newfirm_j2f_candels-newfirm_j3ferr_candels-newfirm_j3f_candels-newfirm_h1ferr_candels-newfirm_h1f_candels-newfirm_h2ferr_candels-newfirm_h2f_candels-newfirm_kferr_candels-newfirm_kf_candels-irac_i1ferr_candels-irac_i1f_candels-irac_i2ferr_candels-irac_i2f_candels-irac_i3ferr_candels-irac_i3f_candels-irac_i4ferr_candels-irac_i4m_ap_acs_f606wmerr_ap_acs_f606wm_acs_f606wmerr_acs_f606wflag_acs_f606wm_ap_acs_f814wmerr_ap_acs_f814wm_acs_f814wmerr_acs_f814wflag_acs_f814wm_ap_wfc3_f125wmerr_ap_wfc3_f125wm_wfc3_f125wmerr_wfc3_f125wflag_wfc3_f125wm_ap_wfc3_f140wmerr_ap_wfc3_f140wm_wfc3_f140wmerr_wfc3_f140wflag_wfc3_f140wm_ap_wfc3_f160wmerr_ap_wfc3_f160wm_wfc3_f160wmerr_wfc3_f160wflag_wfc3_f160wm_candels-megacam_umerr_candels-megacam_um_ap_candels-megacam_umerr_ap_candels-megacam_uf_ap_candels-megacam_uferr_ap_candels-megacam_uflag_candels-megacam_um_candels-megacam_gmerr_candels-megacam_gm_ap_candels-megacam_gmerr_ap_candels-megacam_gf_ap_candels-megacam_gferr_ap_candels-megacam_gflag_candels-megacam_gm_candels-megacam_rmerr_candels-megacam_rm_ap_candels-megacam_rmerr_ap_candels-megacam_rf_ap_candels-megacam_rferr_ap_candels-megacam_rflag_candels-megacam_rm_candels-megacam_imerr_candels-megacam_im_ap_candels-megacam_imerr_ap_candels-megacam_if_ap_candels-megacam_iferr_ap_candels-megacam_iflag_candels-megacam_im_candels-megacam_zmerr_candels-megacam_zm_ap_candels-megacam_zmerr_ap_candels-megacam_zf_ap_candels-megacam_zferr_ap_candels-megacam_zflag_candels-megacam_zm_candels-wircam_jmerr_candels-wircam_jm_ap_candels-wircam_jmerr_ap_candels-wircam_jf_ap_candels-wircam_jferr_ap_candels-wircam_jflag_candels-wircam_jm_candels-wircam_hmerr_candels-wircam_hm_ap_candels-wircam_hmerr_ap_candels-wircam_hf_ap_candels-wircam_hferr_ap_candels-wircam_hflag_candels-wircam_hm_candels-wircam_kmerr_candels-wircam_km_ap_candels-wircam_kmerr_ap_candels-wircam_kf_ap_candels-wircam_kferr_ap_candels-wircam_kflag_candels-wircam_km_candels-newfirm_j1merr_candels-newfirm_j1m_ap_candels-newfirm_j1merr_ap_candels-newfirm_j1f_ap_candels-newfirm_j1ferr_ap_candels-newfirm_j1flag_candels-newfirm_j1m_candels-newfirm_j2merr_candels-newfirm_j2m_ap_candels-newfirm_j2merr_ap_candels-newfirm_j2f_ap_candels-newfirm_j2ferr_ap_candels-newfirm_j2flag_candels-newfirm_j2m_candels-newfirm_j3merr_candels-newfirm_j3m_ap_candels-newfirm_j3merr_ap_candels-newfirm_j3f_ap_candels-newfirm_j3ferr_ap_candels-newfirm_j3flag_candels-newfirm_j3m_candels-newfirm_h1merr_candels-newfirm_h1m_ap_candels-newfirm_h1merr_ap_candels-newfirm_h1f_ap_candels-newfirm_h1ferr_ap_candels-newfirm_h1flag_candels-newfirm_h1m_candels-newfirm_h2merr_candels-newfirm_h2m_ap_candels-newfirm_h2merr_ap_candels-newfirm_h2f_ap_candels-newfirm_h2ferr_ap_candels-newfirm_h2flag_candels-newfirm_h2m_candels-newfirm_kmerr_candels-newfirm_km_ap_candels-newfirm_kmerr_ap_candels-newfirm_kf_ap_candels-newfirm_kferr_ap_candels-newfirm_kflag_candels-newfirm_km_candels-irac_i1merr_candels-irac_i1m_ap_candels-irac_i1merr_ap_candels-irac_i1f_ap_candels-irac_i1ferr_ap_candels-irac_i1flag_candels-irac_i1m_candels-irac_i2merr_candels-irac_i2m_ap_candels-irac_i2merr_ap_candels-irac_i2f_ap_candels-irac_i2ferr_ap_candels-irac_i2flag_candels-irac_i2m_candels-irac_i3merr_candels-irac_i3m_ap_candels-irac_i3merr_ap_candels-irac_i3f_ap_candels-irac_i3ferr_ap_candels-irac_i3flag_candels-irac_i3m_candels-irac_i4merr_candels-irac_i4m_ap_candels-irac_i4merr_ap_candels-irac_i4f_ap_candels-irac_i4ferr_ap_candels-irac_i4flag_candels-irac_i4candels-egs_flag_cleanedcandels-egs_flag_gaiawirds_idm_wirds_umerr_wirds_um_ap_wirds_umerr_ap_wirds_um_wirds_gmerr_wirds_gm_ap_wirds_gmerr_ap_wirds_gm_wirds_rmerr_wirds_rm_ap_wirds_rmerr_ap_wirds_rm_wirds_imerr_wirds_im_ap_wirds_imerr_ap_wirds_im_wirds_zmerr_wirds_zm_ap_wirds_zmerr_ap_wirds_zm_wirds_jmerr_wirds_jm_ap_wirds_jmerr_ap_wirds_jm_wirds_hmerr_wirds_hm_ap_wirds_hmerr_ap_wirds_hm_wirds_kmerr_wirds_km_ap_wirds_kmerr_ap_wirds_kf_wirds_uferr_wirds_uflag_wirds_uf_ap_wirds_uferr_ap_wirds_uf_wirds_gferr_wirds_gflag_wirds_gf_ap_wirds_gferr_ap_wirds_gf_wirds_rferr_wirds_rflag_wirds_rf_ap_wirds_rferr_ap_wirds_rf_wirds_iferr_wirds_iflag_wirds_if_ap_wirds_iferr_ap_wirds_if_wirds_zferr_wirds_zflag_wirds_zf_ap_wirds_zferr_ap_wirds_zf_wirds_jferr_wirds_jflag_wirds_jf_ap_wirds_jferr_ap_wirds_jf_wirds_hferr_wirds_hflag_wirds_hf_ap_wirds_hferr_ap_wirds_hf_wirds_kferr_wirds_kflag_wirds_kf_ap_wirds_kferr_ap_wirds_kwirds_flag_cleanedcfht-wirds_flag_gaiacfhtls-wide_idcfhtls-wide_stellaritym_cfhtls-wide_umerr_cfhtls-wide_um_cfhtls-wide_gmerr_cfhtls-wide_gm_cfhtls-wide_rmerr_cfhtls-wide_rm_cfhtls-wide_imerr_cfhtls-wide_im_cfhtls-wide_zmerr_cfhtls-wide_zm_ap_cfhtls-wide_umerr_ap_cfhtls-wide_um_ap_cfhtls-wide_gmerr_ap_cfhtls-wide_gm_ap_cfhtls-wide_rmerr_ap_cfhtls-wide_rm_ap_cfhtls-wide_imerr_ap_cfhtls-wide_im_ap_cfhtls-wide_zmerr_ap_cfhtls-wide_zf_cfhtls-wide_uferr_cfhtls-wide_uflag_cfhtls-wide_uf_cfhtls-wide_gferr_cfhtls-wide_gflag_cfhtls-wide_gf_cfhtls-wide_rferr_cfhtls-wide_rflag_cfhtls-wide_rf_cfhtls-wide_iferr_cfhtls-wide_iflag_cfhtls-wide_if_cfhtls-wide_zferr_cfhtls-wide_zflag_cfhtls-wide_zf_ap_cfhtls-wide_uferr_ap_cfhtls-wide_uf_ap_cfhtls-wide_gferr_ap_cfhtls-wide_gf_ap_cfhtls-wide_rferr_ap_cfhtls-wide_rf_ap_cfhtls-wide_iferr_ap_cfhtls-wide_if_ap_cfhtls-wide_zferr_ap_cfhtls-wide_zcfhtls-wide_flag_cleanedcfhtls-wide_flag_gaiacfhtls-deep_idcfhtls-deep_stellaritym_cfhtls-deep_umerr_cfhtls-deep_um_cfhtls-deep_gmerr_cfhtls-deep_gm_cfhtls-deep_rmerr_cfhtls-deep_rm_cfhtls-deep_imerr_cfhtls-deep_im_cfhtls-deep_zmerr_cfhtls-deep_zm_ap_cfhtls-deep_umerr_ap_cfhtls-deep_um_ap_cfhtls-deep_gmerr_ap_cfhtls-deep_gm_ap_cfhtls-deep_rmerr_ap_cfhtls-deep_rm_ap_cfhtls-deep_imerr_ap_cfhtls-deep_im_ap_cfhtls-deep_zmerr_ap_cfhtls-deep_zf_cfhtls-deep_uferr_cfhtls-deep_uflag_cfhtls-deep_uf_cfhtls-deep_gferr_cfhtls-deep_gflag_cfhtls-deep_gf_cfhtls-deep_rferr_cfhtls-deep_rflag_cfhtls-deep_rf_cfhtls-deep_iferr_cfhtls-deep_iflag_cfhtls-deep_if_cfhtls-deep_zferr_cfhtls-deep_zflag_cfhtls-deep_zf_ap_cfhtls-deep_uferr_ap_cfhtls-deep_uf_ap_cfhtls-deep_gferr_ap_cfhtls-deep_gf_ap_cfhtls-deep_rferr_ap_cfhtls-deep_rf_ap_cfhtls-deep_iferr_ap_cfhtls-deep_if_ap_cfhtls-deep_zferr_ap_cfhtls-deep_zcfhtls-deep_flag_cleanedcfhtls-deep_flag_gaiacfhtlens_idcfhtlens_stellaritym_cfhtlens_umerr_cfhtlens_um_cfhtlens_gmerr_cfhtlens_gm_cfhtlens_rmerr_cfhtlens_rm_cfhtlens_imerr_cfhtlens_im_cfhtlens_zmerr_cfhtlens_zf_cfhtlens_uferr_cfhtlens_um_ap_cfhtlens_umerr_ap_cfhtlens_uf_ap_cfhtlens_uferr_ap_cfhtlens_uflag_cfhtlens_uf_cfhtlens_gferr_cfhtlens_gm_ap_cfhtlens_gmerr_ap_cfhtlens_gf_ap_cfhtlens_gferr_ap_cfhtlens_gflag_cfhtlens_gf_cfhtlens_rferr_cfhtlens_rm_ap_cfhtlens_rmerr_ap_cfhtlens_rf_ap_cfhtlens_rferr_ap_cfhtlens_rflag_cfhtlens_rf_cfhtlens_iferr_cfhtlens_im_ap_cfhtlens_imerr_ap_cfhtlens_if_ap_cfhtlens_iferr_ap_cfhtlens_iflag_cfhtlens_if_cfhtlens_zferr_cfhtlens_zm_ap_cfhtlens_zmerr_ap_cfhtlens_zf_ap_cfhtlens_zferr_ap_cfhtlens_zflag_cfhtlens_zcfhtlens_flag_cleanedcfhtlens_flag_gaiadeep2_idm_deep2_bmerr_deep2_bm_deep2_rmerr_deep2_rm_deep2_imerr_deep2_if_deep2_bferr_deep2_bf_ap_deep2_bferr_ap_deep2_bm_ap_deep2_bmerr_ap_deep2_bflag_deep2_bf_deep2_rferr_deep2_rf_ap_deep2_rferr_ap_deep2_rm_ap_deep2_rmerr_ap_deep2_rflag_deep2_rf_deep2_iferr_deep2_if_ap_deep2_iferr_ap_deep2_im_ap_deep2_imerr_ap_deep2_iflag_deep2_ideep_flag_cleaneddeep2_flag_gaiairac-egs_idf_irac-egs_i1ferr_irac-egs_i1f_irac-egs_i2ferr_irac-egs_i2f_irac-egs_i3ferr_irac-egs_i3f_irac-egs_i4ferr_irac-egs_i4m_irac-egs_i1merr_irac-egs_i1m_ap_irac-egs_i1merr_ap_irac-egs_i1f_ap_irac-egs_i1ferr_ap_irac-egs_i1flag_irac-egs_i1m_irac-egs_i2merr_irac-egs_i2m_ap_irac-egs_i2merr_ap_irac-egs_i2f_ap_irac-egs_i2ferr_ap_irac-egs_i2flag_irac-egs_i2m_irac-egs_i3merr_irac-egs_i3m_ap_irac-egs_i3merr_ap_irac-egs_i3f_ap_irac-egs_i3ferr_ap_irac-egs_i3flag_irac-egs_i3m_irac-egs_i4merr_irac-egs_i4m_ap_irac-egs_i4merr_ap_irac-egs_i4f_ap_irac-egs_i4ferr_ap_irac-egs_i4flag_irac-egs_i4wfc_flag_cleanedirac-egs_flag_gaialegacy_idf_bass_gferr_bass_gf_ap_bass_gferr_ap_bass_gf_bass_rferr_bass_rf_ap_bass_rferr_ap_bass_rf_bass_zferr_bass_zf_ap_bass_zferr_ap_bass_zlegacy_stellaritym_bass_gmerr_bass_gflag_bass_gm_ap_bass_gmerr_ap_bass_gm_bass_rmerr_bass_rflag_bass_rm_ap_bass_rmerr_ap_bass_rm_bass_zmerr_bass_zflag_bass_zm_ap_bass_zmerr_ap_bass_zlegacy_flag_cleanedlegacy_flag_gaiauhs_iduhs_stellaritym_uhs_jmerr_uhs_jm_ap_uhs_jmerr_ap_uhs_jf_uhs_jferr_uhs_jflag_uhs_jf_ap_uhs_jferr_ap_uhs_juhs_flag_cleaneduhs_flag_gaia
degdegmagmagmagmagmagmaguJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJyuJymagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmagmaguJyuJyuJyuJyuJyuJy
074649014095605543214.01885343952.387310620421.73240.0028178121.41240.0034616220.34170.0016623320.03090.0021369319.70540.00094921519.34170.0012416819.39650.0016347619.06230.002145519.18960.0028745318.82190.003808180.07.362740.01910859.886170.0315197False26.50530.040581335.29060.0694584False47.62510.041636766.57450.0761364False63.29710.095304886.1160.170172False76.59020.202776107.460.376912FalseFalse2True-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
173984930547265512214.10679106351.881664522221.3740.0027986421.54010.0026804120.05470.0017378120.15740.0016490819.20570.00095307919.21570.00088430818.71320.0012438118.83050.0011828318.61360.0022582818.7340.002097181.010.24260.02640178.789640.0216994False34.52470.055259531.40750.0477036False75.46340.066243174.76930.0608979False118.7690.13606106.6120.116146False130.1840.270777116.5210.225068FalseFalse2False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
274648752102606669214.79735831853.055699479921.96910.0051730521.07460.0060033720.79140.0035109119.88710.0040535520.26880.0018096419.37860.0023515819.88160.0028985419.06180.0039308719.65160.0054109418.81320.007678760.05.920750.028209813.4940.0746127False17.51570.056639740.28710.15041False28.34630.04724664.34990.139374False40.49170.10809986.15320.311915False50.04570.249411108.3180.76607FalseFalse0False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
374649151534559278213.85443844652.424117319421.2170.0024860419.5360.0024742820.78450.0028020218.98620.0029347620.40150.001871518.62450.0021792820.29570.0038825918.4550.0040803620.08570.0063869118.19630.007174550.011.83540.027155.66830.126862False17.62850.045494792.36550.249665False25.08380.0432373128.8790.258685False27.65060.0988782150.6540.566181False33.55310.197378191.2021.26346FalseFalse0False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
474648606073709035214.92986686552.533050866721.09580.0020532420.7140.0022111820.6020.0024690720.09350.0025719220.4790.0020073719.83830.002023620.26170.003552919.65260.0034932820.16590.0084170719.49890.007727990.013.23340.025025818.81120.0383102False20.8540.04742433.3120.0789103False23.35520.043180542.13770.0785364False28.53140.093364649.99890.160868False31.16250.24158457.60090.409988FalseFalse2True-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
574648752102601952214.70384569352.989205273921.73950.0038437920.87390.0053096420.92940.0033069220.08260.0050973720.51990.0020180219.70480.0034389420.31210.0042361119.49820.0064448320.18380.0084331419.31770.01185130.07.314640.025895816.23420.0793911False15.42490.04698133.64950.157979False22.49160.041804447.65010.150926False27.23670.10626757.6370.342128False30.65230.23808268.06640.742976FalseFalse0False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
674648464339789209215.29874092652.345830748522.00060.0054411622.06760.0057840520.7980.0041528220.82720.0044102919.8110.0022430119.79630.0026409719.21270.001841319.2440.0019441818.98530.0028528519.02250.002935130.05.751090.02882155.407030.0288049False17.41070.066594116.94860.0688454False43.2110.089269343.80040.106541False74.97250.12714672.84250.130436False92.44080.24289589.33190.241496FalseFalse2False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
774643928854322229213.3429865352.408492132121.62350.0036951120.35120.0033824620.93380.0038341319.67420.0038868420.48180.002367619.24940.0025356520.25040.0042529419.04070.0047582320.02530.0068681518.83970.008553730.08.139470.027701226.27260.0818486False15.36360.054254449.01430.175467False23.29680.050802172.48360.16928False28.82880.11292587.84870.384996False35.47090.224382105.710.832815FalseTrue0False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
874649018390570083213.97489187652.532945821823.34810.012038122.65260.013121921.69240.0055127421.12730.0069970820.78560.0024445120.31130.0034864220.38830.0041759819.95470.0059246720.20750.0080084719.74460.01125920.01.662550.01843353.154730.0381273False7.639040.038786612.85510.0828455False17.60930.039646927.25770.0875277False25.39050.097657437.8530.206557False29.99110.22121745.93840.476386FalseFalse0True-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0
974648468634762458215.35264162852.655293920621.53830.0028752220.80480.0034264921.03680.0034422220.25220.0043728220.78310.0025001219.99240.0034076220.71450.0056253919.92510.0074133120.66570.012594919.86080.01605960.08.804350.023315517.30150.0546019False13.97310.044300328.78110.115916False17.65040.040643536.56180.11475False18.80150.097413738.90010.265606False19.66640.22813641.27570.610527FalseFalse0False-1nannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalseFalse0-1nannannannannannannannanFalsenannannannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannannannannannannannanFalsenannanFalsenannanFalsenannanFalsenannanFalsenannannannannannannannannannanFalse0-1nannannannannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannanFalsenannannannannannanFalsenannannannannannanFalsenannannannannannanFalseFalse0-1nannannannannannannannannannannannannannannanFalsenannannannanFalsenannannannanFalsenannanFalse0-1nannannannannannannanFalsenannanFalse0

III - Merging flags and stellarity

Each pristine catalogue contains a flag indicating if the source was associated to a another nearby source that was removed during the cleaning process. We merge these flags in a single one.

In [30]:
flag_cleaned_columns = [column for column in master_catalogue.colnames
                        if 'flag_cleaned' in column]

flag_column = np.zeros(len(master_catalogue), dtype=bool)
for column in flag_cleaned_columns:
    flag_column |= master_catalogue[column]
    
master_catalogue.add_column(Column(data=flag_column, name="flag_cleaned"))
master_catalogue.remove_columns(flag_cleaned_columns)

Each pristine catalogue contains a flag indicating the probability of a source being a Gaia object (0: not a Gaia object, 1: possibly, 2: probably, 3: definitely). We merge these flags taking the highest value.

In [31]:
flag_gaia_columns = [column for column in master_catalogue.colnames
                     if 'flag_gaia' in column]

master_catalogue.add_column(Column(
    data=np.max([master_catalogue[column] for column in flag_gaia_columns], axis=0),
    name="flag_gaia"
))
master_catalogue.remove_columns(flag_gaia_columns)

Each prisitine catalogue may contain one or several stellarity columns indicating the probability (0 to 1) of each source being a star. We merge these columns taking the highest value. We keep trace of the origin of the stellarity.

In [32]:
stellarity_columns = [column for column in master_catalogue.colnames
                      if 'stellarity' in column]

print(", ".join(stellarity_columns))
hsc_stellarity, candels-egs_stellarity, cfhtls-wide_stellarity, cfhtls-deep_stellarity, cfhtlens_stellarity, legacy_stellarity, uhs_stellarity
In [33]:
# We create an masked array with all the stellarities and get the maximum value, as well as its
# origin.  Some sources may not have an associated stellarity.
stellarity_array = np.array([master_catalogue[column] for column in stellarity_columns])
stellarity_array = np.ma.masked_array(stellarity_array, np.isnan(stellarity_array))

max_stellarity = np.max(stellarity_array, axis=0)
max_stellarity.fill_value = np.nan

no_stellarity_mask = max_stellarity.mask

master_catalogue.add_column(Column(data=max_stellarity.filled(), name="stellarity"))

stellarity_origin = np.full(len(master_catalogue), "NO_INFORMATION", dtype="S20")
stellarity_origin[~no_stellarity_mask] = np.array(stellarity_columns)[np.argmax(stellarity_array, axis=0)[~no_stellarity_mask]]

master_catalogue.add_column(Column(data=stellarity_origin, name="stellarity_origin"))

master_catalogue.remove_columns(stellarity_columns)

IV - Adding E(B-V) column

In [34]:
master_catalogue.add_column(
    ebv(master_catalogue['ra'], master_catalogue['dec'])
)

V - Adding HELP unique identifiers and field columns

In [35]:
master_catalogue.add_column(Column(gen_help_id(master_catalogue['ra'], master_catalogue['dec']),
                                   name="help_id"))
master_catalogue.add_column(Column(np.full(len(master_catalogue), "EGS", dtype='<U18'),
                                   name="field"))
In [36]:
# Check that the HELP Ids are unique
if len(master_catalogue) != len(np.unique(master_catalogue['help_id'])):
    print("The HELP IDs are not unique!!!")
else:
    print("OK!")
OK!

VI - Cross-matching with spec-z catalogue

In [37]:
specz =  Table.read("../../dmu23/dmu23_EGS/data/EGS-specz-v2.1.csv")
for col in specz.colnames:
    specz[col].name = specz[col].name.lower()

specz['objid'].name = 'specz_id'
In [38]:
nb_merge_dist_plot(
    SkyCoord(master_catalogue['ra'], master_catalogue['dec']),
    SkyCoord(specz['ra'] * u.deg, specz['dec'] * u.deg)
)
In [39]:
master_catalogue = specz_merge(master_catalogue, specz, radius=1. * u.arcsec)

VII - Choosing between multiple values for the same filter

There are many different bands to choose between here.

CFHT Megacam

CFHT-WIRDS is the only survey that has J, H and Ks so we take them directly. After that we need to select ugriz bands from between CFHTLS, CFHT-WIRDS and CFHTLenS. We take these in order of depth.

Survey Bands Notes
CFHTLS-DEEP u, g, r, i, z
CFHTLS-WIDE u, g, r, i, z
CFHT-WIRDS u, g, r, i, z Ks selected so may have unique objects
CFHTLenS u, g, r, i, z Reprocessing of CFHTLS-WIDE so not used
CANDELS-EGS u, g, r, i, z Priors from very deep data so may have unique objects
In [40]:
megacam_origin = Table()
megacam_origin.add_column(master_catalogue['help_id'])
In [41]:
megacam_stats = Table()
megacam_stats.add_column(Column(data=['u','g','r','i','z'], name="Band"))
for col in ["CFHTLS-DEEP", "CFHTLS-WIDE", "CFHT-WIRDS", "CFHTLenS", "CANDELS"]:
    megacam_stats.add_column(Column(data=np.full(5, 0), name="{}".format(col)))
    megacam_stats.add_column(Column(data=np.full(5, 0), name="use {}".format(col)))
    megacam_stats.add_column(Column(data=np.full(5, 0), name="{} ap".format(col)))
    megacam_stats.add_column(Column(data=np.full(5, 0), name="use {} ap".format(col)))
/opt/anaconda3/envs/herschelhelp_internal/lib/python3.6/site-packages/numpy/core/numeric.py:301: FutureWarning: in the future, full(5, 0) will return an array of dtype('int64')
  format(shape, fill_value, array(fill_value).dtype), FutureWarning)
In [42]:
megacam_bands = ['u','g','r','i','z'] 
for band in megacam_bands:

    # Megacam total flux 
    has_cfhtls_deep = ~np.isnan(master_catalogue['f_cfhtls-deep_' + band])
    has_cfhtls_wide = ~np.isnan(master_catalogue['f_cfhtls-wide_' + band])
    has_wirds = ~np.isnan(master_catalogue['f_wirds_' + band])
    has_cfhtlens = ~np.isnan(master_catalogue['f_cfhtlens_' + band])
    has_candels = ~np.isnan(master_catalogue['f_candels-megacam_' + band])
    

    use_cfhtls_deep = has_cfhtls_deep 
    use_cfhtls_wide = has_cfhtls_wide & ~has_cfhtls_deep 
    use_wirds =       has_wirds       & ~has_cfhtls_deep & ~has_cfhtls_wide  
    use_cfhtlens =    np.zeros(len(master_catalogue), dtype=bool) #We still merge CFHTLenS to keep ids in cross id
    use_candels =     has_candels     & ~has_cfhtls_deep & ~has_cfhtls_wide & ~has_wirds & ~has_cfhtlens 

    f_megacam = np.full(len(master_catalogue), np.nan)
    f_megacam[use_cfhtls_deep] = master_catalogue['f_cfhtls-deep_' + band][use_cfhtls_deep]
    f_megacam[use_cfhtls_wide] = master_catalogue['f_cfhtls-wide_' + band][use_cfhtls_wide]
    f_megacam[use_wirds] = master_catalogue['f_wirds_' + band][use_wirds]
    f_megacam[use_cfhtlens] = master_catalogue['f_cfhtlens_' + band][use_cfhtlens]
    f_megacam[use_candels] = master_catalogue['f_candels-megacam_' + band][use_candels]

    ferr_megacam = np.full(len(master_catalogue), np.nan)
    ferr_megacam[use_cfhtls_deep] = master_catalogue['ferr_cfhtls-deep_' + band][use_cfhtls_deep]
    ferr_megacam[use_cfhtls_wide] = master_catalogue['ferr_cfhtls-wide_' + band][use_cfhtls_wide]
    ferr_megacam[use_wirds] = master_catalogue['ferr_wirds_' + band][use_wirds]
    ferr_megacam[use_cfhtlens] = master_catalogue['ferr_cfhtlens_' + band][use_cfhtlens]
    ferr_megacam[use_candels] = master_catalogue['ferr_candels-megacam_' + band][use_candels]
    
    m_megacam = np.full(len(master_catalogue), np.nan)
    m_megacam[use_cfhtls_deep] = master_catalogue['m_cfhtls-deep_' + band][use_cfhtls_deep]
    m_megacam[use_cfhtls_wide] = master_catalogue['m_cfhtls-wide_' + band][use_cfhtls_wide]
    m_megacam[use_wirds] = master_catalogue['m_wirds_' + band][use_wirds]
    m_megacam[use_cfhtlens] = master_catalogue['m_cfhtlens_' + band][use_cfhtlens]
    m_megacam[use_candels] = master_catalogue['m_candels-megacam_' + band][use_candels]

    merr_megacam = np.full(len(master_catalogue), np.nan)
    merr_megacam[use_cfhtls_deep] = master_catalogue['merr_cfhtls-deep_' + band][use_cfhtls_deep]
    merr_megacam[use_cfhtls_wide] = master_catalogue['merr_cfhtls-wide_' + band][use_cfhtls_wide]
    merr_megacam[use_wirds] = master_catalogue['merr_wirds_' + band][use_wirds]
    merr_megacam[use_cfhtlens] = master_catalogue['merr_cfhtlens_' + band][use_cfhtlens]
    merr_megacam[use_candels] = master_catalogue['merr_candels-megacam_' + band][use_candels]

    flag_megacam = np.full(len(master_catalogue), False, dtype=bool)
    flag_megacam[use_cfhtls_deep] = master_catalogue['flag_cfhtls-deep_' + band][use_cfhtls_deep]
    flag_megacam[use_cfhtls_wide] = master_catalogue['flag_cfhtls-wide_' + band][use_cfhtls_wide]
    flag_megacam[use_wirds] = master_catalogue['flag_wirds_' + band][use_wirds]
    flag_megacam[use_cfhtlens] = master_catalogue['flag_cfhtlens_' + band][use_cfhtlens]
    flag_megacam[use_candels] = master_catalogue['flag_candels-megacam_' + band][use_candels]

    master_catalogue.add_column(Column(data=f_megacam, name="f_megacam_" + band))
    master_catalogue.add_column(Column(data=ferr_megacam, name="ferr_megacam_" + band))
    master_catalogue.add_column(Column(data=m_megacam, name="m_megacam_" + band))
    master_catalogue.add_column(Column(data=merr_megacam, name="merr_megacam_" + band))
    master_catalogue.add_column(Column(data=flag_megacam, name="flag_megacam_" + band))

    old_columns = ['f_cfhtls-deep_' + band,
                    'ferr_cfhtls-deep_' + band,
                    'm_cfhtls-deep_' + band, 
                    'merr_cfhtls-deep_' + band,
                    'flag_cfhtls-deep_' + band,
                   'f_cfhtls-wide_' + band,
                    'ferr_cfhtls-wide_' + band,
                    'm_cfhtls-wide_' + band, 
                    'merr_cfhtls-wide_' + band,
                    'flag_cfhtls-wide_' + band,
                  'f_wirds_' + band,
                    'ferr_wirds_' + band,
                    'm_wirds_' + band, 
                    'merr_wirds_' + band,
                    'flag_wirds_' + band,
                  'f_cfhtlens_' + band,
                    'ferr_cfhtlens_' + band,
                    'm_cfhtlens_' + band, 
                    'merr_cfhtlens_' + band,
                    'flag_cfhtlens_' + band,
                  'f_candels-megacam_' + band,
                    'ferr_candels-megacam_' + band,
                    'm_candels-megacam_' + band, 
                    'merr_candels-megacam_' + band,
                    'flag_candels-megacam_' + band,]

    
    master_catalogue.remove_columns(old_columns)

    origin = np.full(len(master_catalogue), '     ', dtype='<U5')
    origin[use_cfhtls_deep] = "CFHTLS-DEEP"
    origin[use_cfhtls_wide] = "CFHTLS-WIDE"
    origin[use_wirds] = "CFHT-WIRDS"
    origin[use_cfhtlens] = "CFHTLenS"
    origin[use_candels] = "CANDELS"
    
    megacam_origin.add_column(Column(data=origin, name= 'f_megacam_' + band ))
    
    # Megacam aperture flux 
    has_ap_cfhtls_deep = ~np.isnan(master_catalogue['f_ap_cfhtls-deep_' + band])
    has_ap_cfhtls_wide = ~np.isnan(master_catalogue['f_ap_cfhtls-wide_' + band])
    has_ap_wirds = ~np.isnan(master_catalogue['f_ap_wirds_' + band])
    has_ap_cfhtlens = ~np.isnan(master_catalogue['f_ap_cfhtlens_' + band])
    has_ap_candels = ~np.isnan(master_catalogue['f_ap_candels-megacam_' + band])
    
    use_ap_cfhtls_deep = has_ap_cfhtls_deep
    use_ap_cfhtls_wide = has_ap_cfhtls_wide & ~has_ap_cfhtls_deep
    use_ap_wirds       = has_ap_wirds       & ~has_ap_cfhtls_deep & ~has_ap_cfhtls_wide
    use_ap_cfhtlens    = has_ap_cfhtlens    & ~has_ap_cfhtls_deep & ~has_ap_cfhtls_wide & ~has_ap_wirds   
    use_ap_candels     = has_ap_candels     & ~has_ap_cfhtls_deep & ~has_ap_cfhtls_wide & ~has_ap_wirds & ~has_ap_cfhtlens   

    f_ap_megacam = np.full(len(master_catalogue), np.nan)
    f_ap_megacam[use_ap_cfhtls_deep] = master_catalogue['f_ap_cfhtls-deep_' + band][use_ap_cfhtls_deep]
    f_ap_megacam[use_ap_cfhtls_wide] = master_catalogue['f_ap_cfhtls-wide_' + band][use_ap_cfhtls_wide]
    f_ap_megacam[use_ap_wirds] = master_catalogue['f_ap_wirds_' + band][use_ap_wirds]
    f_ap_megacam[use_ap_cfhtlens] = master_catalogue['f_ap_cfhtlens_' + band][use_ap_cfhtlens]
    f_ap_megacam[use_ap_candels] = master_catalogue['f_ap_candels-megacam_' + band][use_ap_candels]

    ferr_ap_megacam = np.full(len(master_catalogue), np.nan)
    ferr_ap_megacam[use_ap_cfhtls_deep] = master_catalogue['ferr_ap_cfhtls-deep_' + band][use_ap_cfhtls_deep]
    ferr_ap_megacam[use_ap_cfhtls_wide] = master_catalogue['ferr_ap_cfhtls-wide_' + band][use_ap_cfhtls_wide]
    ferr_ap_megacam[use_ap_wirds] = master_catalogue['ferr_ap_wirds_' + band][use_ap_wirds]
    ferr_ap_megacam[use_ap_cfhtlens] = master_catalogue['ferr_ap_cfhtlens_' + band][use_ap_cfhtlens]
    ferr_ap_megacam[use_ap_candels] = master_catalogue['ferr_ap_candels-megacam_' + band][use_ap_candels]
    
    m_ap_megacam = np.full(len(master_catalogue), np.nan)
    m_ap_megacam[use_ap_cfhtls_deep] = master_catalogue['m_ap_cfhtls-deep_' + band][use_ap_cfhtls_deep]
    m_ap_megacam[use_ap_cfhtls_wide] = master_catalogue['m_ap_cfhtls-wide_' + band][use_ap_cfhtls_wide]
    m_ap_megacam[use_ap_wirds] = master_catalogue['m_ap_wirds_' + band][use_ap_wirds]
    m_ap_megacam[use_ap_cfhtlens] = master_catalogue['m_ap_cfhtlens_' + band][use_ap_cfhtlens]
    m_ap_megacam[use_ap_candels] = master_catalogue['m_ap_candels-megacam_' + band][use_ap_candels]

    merr_ap_megacam = np.full(len(master_catalogue), np.nan)
    merr_ap_megacam[use_ap_cfhtls_deep] = master_catalogue['merr_ap_cfhtls-deep_' + band][use_ap_cfhtls_deep]
    merr_ap_megacam[use_ap_cfhtls_wide] = master_catalogue['merr_ap_cfhtls-wide_' + band][use_ap_cfhtls_wide]
    merr_ap_megacam[use_ap_wirds] = master_catalogue['merr_ap_wirds_' + band][use_ap_wirds]
    merr_ap_megacam[use_ap_cfhtlens] = master_catalogue['merr_ap_cfhtlens_' + band][use_ap_cfhtlens]
    merr_ap_megacam[use_ap_candels] = master_catalogue['merr_ap_candels-megacam_' + band][use_ap_candels]

    master_catalogue.add_column(Column(data=f_ap_megacam, name="f_ap_megacam_" + band))
    master_catalogue.add_column(Column(data=ferr_ap_megacam, name="ferr_ap_megacam_" + band))
    master_catalogue.add_column(Column(data=m_ap_megacam, name="m_ap_megacam_" + band))
    master_catalogue.add_column(Column(data=merr_ap_megacam, name="merr_ap_megacam_" + band))


    old_ap_columns = ['f_ap_cfhtls-deep_' + band,
                    'ferr_ap_cfhtls-deep_' + band,
                    'm_ap_cfhtls-deep_' + band, 
                    'merr_ap_cfhtls-deep_' + band,
                  'f_ap_cfhtls-wide_' + band,
                    'ferr_ap_cfhtls-wide_' + band,
                    'm_ap_cfhtls-wide_' + band, 
                    'merr_ap_cfhtls-wide_' + band,
                  'f_ap_wirds_' + band,
                    'ferr_ap_wirds_' + band,
                    'm_ap_wirds_' + band, 
                    'merr_ap_wirds_' + band,
                  'f_ap_cfhtlens_' + band,
                    'ferr_ap_cfhtlens_' + band,
                    'm_ap_cfhtlens_' + band, 
                    'merr_ap_cfhtlens_' + band,
                  'f_ap_candels-megacam_' + band,
                    'ferr_ap_candels-megacam_' + band,
                    'm_ap_candels-megacam_' + band, 
                    'merr_ap_candels-megacam_' + band]

    
    master_catalogue.remove_columns(old_ap_columns)

    origin_ap = np.full(len(master_catalogue), '     ', dtype='<U5')
    origin_ap[use_ap_cfhtls_deep] = "CFHTLS-DEEP"
    origin_ap[use_ap_cfhtls_wide] = "CFHTLS-WIDE"
    origin_ap[use_ap_wirds] = "CFHT-WIRDS"
    origin_ap[use_ap_cfhtlens] = "CFHTLenS"
    origin_ap[use_ap_candels] = "CANDELS"
    
    megacam_origin.add_column(Column(data=origin_ap, name= 'f_ap_megacam_' + band ))
    

   
    megacam_stats['CFHTLS-DEEP'][megacam_stats['Band'] == band] = np.sum(has_cfhtls_deep)
    megacam_stats['CFHTLS-WIDE'][megacam_stats['Band'] == band] = np.sum(has_cfhtls_wide)
    megacam_stats['CFHT-WIRDS'][megacam_stats['Band'] == band] = np.sum(has_wirds)
    megacam_stats['CFHTLenS'][megacam_stats['Band'] == band] = np.sum(has_cfhtlens)
    megacam_stats['CANDELS'][megacam_stats['Band'] == band] = np.sum(has_candels)
    megacam_stats['use CFHTLS-DEEP'][megacam_stats['Band'] == band] = np.sum(use_cfhtls_deep)
    megacam_stats['use CFHTLS-WIDE'][megacam_stats['Band'] == band] = np.sum(use_cfhtls_wide)
    megacam_stats['use CFHT-WIRDS'][megacam_stats['Band'] == band] = np.sum(use_wirds)
    megacam_stats['use CFHTLenS'][megacam_stats['Band'] == band] = np.sum(use_cfhtlens)
    megacam_stats['use CANDELS'][megacam_stats['Band'] == band] = np.sum(use_candels)    
    megacam_stats['CFHTLS-DEEP ap'][megacam_stats['Band'] == band] = np.sum(has_ap_cfhtls_deep)
    megacam_stats['CFHTLS-WIDE ap'][megacam_stats['Band'] == band] = np.sum(has_ap_cfhtls_wide)
    megacam_stats['CFHT-WIRDS ap'][megacam_stats['Band'] == band] = np.sum(has_ap_wirds)
    megacam_stats['CFHTLenS ap'][megacam_stats['Band'] == band] = np.sum(has_ap_cfhtlens)
    megacam_stats['CANDELS ap'][megacam_stats['Band'] == band] = np.sum(has_ap_candels)
    megacam_stats['use CFHTLS-DEEP ap'][megacam_stats['Band'] == band] = np.sum(use_ap_cfhtls_deep)
    megacam_stats['use CFHTLS-WIDE ap'][megacam_stats['Band'] == band] = np.sum(use_ap_cfhtls_wide)
    megacam_stats['use CFHT-WIRDS ap'][megacam_stats['Band'] == band] = np.sum(use_ap_wirds)
    megacam_stats['use CFHTLenS ap'][megacam_stats['Band'] == band] = np.sum(use_ap_cfhtlens)
    megacam_stats['use CANDELS ap'][megacam_stats['Band'] == band] = np.sum(use_ap_candels)
In [43]:
megacam_stats.show_in_notebook()
Out[43]:
<Table length=5>
idxBandCFHTLS-DEEPuse CFHTLS-DEEPCFHTLS-DEEP apuse CFHTLS-DEEP apCFHTLS-WIDEuse CFHTLS-WIDECFHTLS-WIDE apuse CFHTLS-WIDE apCFHT-WIRDSuse CFHT-WIRDSCFHT-WIRDS apuse CFHT-WIRDS apCFHTLenSuse CFHTLenSCFHTLenS apuse CFHTLenS apCANDELSuse CANDELSCANDELS apuse CANDELS ap
0u462710.0462710.0466773.0466773.0672644.0515912.0686140.0526685.085406.015360.085652.015000.0321530.00.00.00.041449.014235.00.00.0
1g531957.0531957.0534321.0534321.0740867.0568617.0744387.0571585.091050.016093.090419.015292.0408054.00.00.00.041449.011609.00.00.0
2r543141.0543141.0546308.0546308.0735227.0565264.0742023.0570390.091750.016283.091056.015446.0402653.00.00.00.041449.011139.00.00.0
3i537151.0537151.0540837.0540837.0721821.0553803.0732290.0562106.091903.016356.091175.015495.0388011.00.00.00.041449.011235.00.00.0
4z475863.0475863.0482568.0482568.0650450.0500464.0673315.0517921.089997.015702.089876.015082.0350143.00.00.00.041449.013686.00.00.0
In [44]:
megacam_origin.write("{}/egs_megacam_fluxes_origins{}.fits".format(OUT_DIR, SUFFIX), overwrite=True)

CFHT WIRCAM

We have WIRCAM J,H, and Ks from both CFHT-WIRDS (Ks prior and blind) and CANDELS-EGS. Since the CANDELS will have very deep priors the WIRCAM fluxes are worth keepting to constrain photo-z. We therefor take the CFHT-WIRDS fluxes if they are there but keep all the CANDELS fluxes for sources that only have those.

In [45]:
wircam_origin = Table()
wircam_origin.add_column(master_catalogue['help_id'])
In [46]:
wircam_stats = Table()
wircam_stats.add_column(Column(data=['j', 'h', 'k'], name="Band"))
for col in ["CFHT-WIRDS", "CANDELS"]:
    wircam_stats.add_column(Column(data=np.full(3, 0), name="{}".format(col)))
    wircam_stats.add_column(Column(data=np.full(3, 0), name="use {}".format(col)))
    wircam_stats.add_column(Column(data=np.full(3, 0), name="{} ap".format(col)))
    wircam_stats.add_column(Column(data=np.full(3, 0), name="use {} ap".format(col)))
/opt/anaconda3/envs/herschelhelp_internal/lib/python3.6/site-packages/numpy/core/numeric.py:301: FutureWarning: in the future, full(3, 0) will return an array of dtype('int64')
  format(shape, fill_value, array(fill_value).dtype), FutureWarning)
In [47]:
wircam_bands = ['j', 'h', 'k'] 
for band in wircam_bands:

    # wircam total flux 
    has_wirds = ~np.isnan(master_catalogue['f_wirds_' + band])
    has_candels = ~np.isnan(master_catalogue['f_candels-wircam_' + band])
    
    use_wirds =       has_wirds        
    use_candels =     has_candels & ~has_wirds 

    f_wircam = np.full(len(master_catalogue), np.nan)
    f_wircam[use_wirds] = master_catalogue['f_wirds_' + band][use_wirds]
    f_wircam[use_candels] = master_catalogue['f_candels-wircam_' + band][use_candels]

    ferr_wircam = np.full(len(master_catalogue), np.nan)
    ferr_wircam[use_wirds] = master_catalogue['ferr_wirds_' + band][use_wirds]
    ferr_wircam[use_candels] = master_catalogue['ferr_candels-wircam_' + band][use_candels]
    
    m_wircam = np.full(len(master_catalogue), np.nan)
    m_wircam[use_wirds] = master_catalogue['m_wirds_' + band][use_wirds]
    m_wircam[use_candels] = master_catalogue['m_candels-wircam_' + band][use_candels]

    merr_wircam = np.full(len(master_catalogue), np.nan)
    merr_wircam[use_wirds] = master_catalogue['merr_wirds_' + band][use_wirds]
    merr_wircam[use_candels] = master_catalogue['merr_candels-wircam_' + band][use_candels]

    flag_wircam = np.full(len(master_catalogue), False, dtype=bool)
    flag_wircam[use_wirds] = master_catalogue['flag_wirds_' + band][use_wirds]
    flag_wircam[use_candels] = master_catalogue['flag_candels-wircam_' + band][use_candels]

    master_catalogue.add_column(Column(data=f_wircam, name="f_wircam_" + band))
    master_catalogue.add_column(Column(data=ferr_wircam, name="ferr_wircam_" + band))
    master_catalogue.add_column(Column(data=m_wircam, name="m_wircam_" + band))
    master_catalogue.add_column(Column(data=merr_wircam, name="merr_wircam_" + band))
    master_catalogue.add_column(Column(data=flag_wircam, name="flag_wircam_" + band))

    old_columns = ['f_wirds_' + band,
                    'ferr_wirds_' + band,
                    'm_wirds_' + band, 
                    'merr_wirds_' + band,
                    'flag_wirds_' + band,
                  'f_candels-wircam_' + band,
                    'ferr_candels-wircam_' + band,
                    'm_candels-wircam_' + band, 
                    'merr_candels-wircam_' + band,
                    'flag_candels-wircam_' + band,]

    
    master_catalogue.remove_columns(old_columns)

    origin = np.full(len(master_catalogue), '     ', dtype='<U5')
    origin[use_wirds] = "CFHT-WIRDS"
    origin[use_candels] = "CANDELS"
    
    wircam_origin.add_column(Column(data=origin, name= 'f_wircam_' + band ))
    
    # wircam aperture flux 
    has_ap_wirds = ~np.isnan(master_catalogue['f_ap_wirds_' + band])
    has_ap_candels = ~np.isnan(master_catalogue['f_ap_candels-wircam_' + band])
    
    use_ap_wirds       = has_ap_wirds      
    use_ap_candels     = has_ap_candels     & ~has_ap_wirds  

    f_ap_wircam = np.full(len(master_catalogue), np.nan)
    f_ap_wircam[use_ap_wirds] = master_catalogue['f_ap_wirds_' + band][use_ap_wirds]
    f_ap_wircam[use_ap_candels] = master_catalogue['f_ap_candels-wircam_' + band][use_ap_candels]

    ferr_ap_wircam = np.full(len(master_catalogue), np.nan)
    ferr_ap_wircam[use_ap_wirds] = master_catalogue['ferr_ap_wirds_' + band][use_ap_wirds]
    ferr_ap_wircam[use_ap_candels] = master_catalogue['ferr_ap_candels-wircam_' + band][use_ap_candels]
    
    m_ap_wircam = np.full(len(master_catalogue), np.nan)
    m_ap_wircam[use_ap_wirds] = master_catalogue['m_ap_wirds_' + band][use_ap_wirds]
    m_ap_wircam[use_ap_candels] = master_catalogue['m_ap_candels-wircam_' + band][use_ap_candels]

    merr_ap_wircam = np.full(len(master_catalogue), np.nan)
    merr_ap_wircam[use_ap_wirds] = master_catalogue['merr_ap_wirds_' + band][use_ap_wirds]
    merr_ap_wircam[use_ap_candels] = master_catalogue['merr_ap_candels-wircam_' + band][use_ap_candels]

    master_catalogue.add_column(Column(data=f_ap_wircam, name="f_ap_wircam_" + band))
    master_catalogue.add_column(Column(data=ferr_ap_wircam, name="ferr_ap_wircam_" + band))
    master_catalogue.add_column(Column(data=m_ap_wircam, name="m_ap_wircam_" + band))
    master_catalogue.add_column(Column(data=merr_ap_wircam, name="merr_ap_wircam_" + band))


    old_ap_columns = ['f_ap_wirds_' + band,
                    'ferr_ap_wirds_' + band,
                    'm_ap_wirds_' + band, 
                    'merr_ap_wirds_' + band,
                  'f_ap_candels-wircam_' + band,
                    'ferr_ap_candels-wircam_' + band,
                    'm_ap_candels-wircam_' + band, 
                    'merr_ap_candels-wircam_' + band]

    
    master_catalogue.remove_columns(old_ap_columns)

    origin_ap = np.full(len(master_catalogue), '     ', dtype='<U5')
    origin_ap[use_ap_wirds] = "CFHT-WIRDS"
    origin_ap[use_ap_candels] = "CANDELS"
    
    wircam_origin.add_column(Column(data=origin_ap, name= 'f_ap_wircam_' + band ))
    

   

    wircam_stats['CFHT-WIRDS'][wircam_stats['Band'] == band] = np.sum(has_wirds)
    wircam_stats['CANDELS'][wircam_stats['Band'] == band] = np.sum(has_candels)
    wircam_stats['use CFHT-WIRDS'][wircam_stats['Band'] == band] = np.sum(use_wirds)
    wircam_stats['use CANDELS'][wircam_stats['Band'] == band] = np.sum(use_candels)    
    wircam_stats['CFHT-WIRDS ap'][wircam_stats['Band'] == band] = np.sum(has_ap_wirds)
    wircam_stats['CANDELS ap'][wircam_stats['Band'] == band] = np.sum(has_ap_candels)
    wircam_stats['use CFHT-WIRDS ap'][wircam_stats['Band'] == band] = np.sum(use_ap_wirds)
    wircam_stats['use CANDELS ap'][wircam_stats['Band'] == band] = np.sum(use_ap_candels)
In [48]:
wircam_stats.show_in_notebook()
Out[48]:
<Table length=3>
idxBandCFHT-WIRDSuse CFHT-WIRDSCFHT-WIRDS apuse CFHT-WIRDS apCANDELSuse CANDELSCANDELS apuse CANDELS ap
0j88730.088730.089464.089464.041449.031013.00.00.0
1h88563.088563.089226.089226.041449.030803.00.00.0
2k98224.098224.099097.099097.041449.030560.00.00.0
In [49]:
wircam_origin.write("{}/egs_wircam_fluxes_origins{}.fits".format(OUT_DIR, SUFFIX), overwrite=True)

VIII.a Wavelength domain coverage

We add a binary flag_optnir_obs indicating that a source was observed in a given wavelength domain:

  • 1 for observation in optical;
  • 2 for observation in near-infrared;
  • 4 for observation in mid-infrared (IRAC).

It's an integer binary flag, so a source observed both in optical and near-infrared by not in mid-infrared would have this flag at 1 + 2 = 3.

Note 1: The observation flag is based on the creation of multi-order coverage maps from the catalogues, this may not be accurate, especially on the edges of the coverage.

Note 2: Being on the observation coverage does not mean having fluxes in that wavelength domain. For sources observed in one domain but having no flux in it, one must take into consideration de different depths in the catalogue we are using.

In [50]:
aegis_moc =  MOC(filename="../../dmu0/dmu0_AEGIS/data/EGS_Palomar_20160804_MOC.fits")
candels_moc =  MOC(filename="../../dmu0/dmu0_CANDELS-EGS/data/hlsp_candels_hst_wfc3_egs-tot-multiband_f160w_v1_MOC.fits")
wirds_moc =  MOC(filename="../../dmu0/dmu0_CFHT-WIRDS/data/EGS_Ks-priors_MOC.fits")
cfhtls_deep_moc =  MOC(filename="../../dmu0/dmu0_CFHTLS/data/CFHTLS-DEEP_EGS_MOC.fits")
cfhtls_wide_moc =  MOC(filename="../../dmu0/dmu0_CFHTLS/data/CFHTLS-WIDE_EGS_MOC.fits")
cfhtlens_moc =  MOC(filename="../../dmu0/dmu0_CFHTLenS/data/CFHTLenS_EGS_MOC.fits")
deep_moc =  MOC(filename="../../dmu0/dmu0_DEEP2/data/DEEP2_EGS_MOC.fits")
irac_moc =  MOC(filename="../../dmu0/dmu0_IRAC-EGS/data/IRAC_EGS_MOC.fits")
hsc_moc =  MOC(filename="../../dmu0/dmu0_HSC/data/HSC-PDR1_wide_EGS_MOC.fits")
ps1_moc =  MOC(filename="../../dmu0/dmu0_PanSTARRS1-3SS/data/PanSTARRS1-3SS_EGS_MOC.fits")
legacy_moc =  MOC(filename="../../dmu0/dmu0_LegacySurvey/data/LegacySurvey-dr4_EGS_MOC.fits")
uhs_moc =  MOC(filename="../../dmu0/dmu0_UHS/data/UHS-DR1_EGS_MOC.fits")
In [51]:
was_observed_optical = inMoc(
    master_catalogue['ra'], master_catalogue['dec'],
    aegis_moc + candels_moc + cfhtls_deep_moc + cfhtls_wide_moc + cfhtlens_moc + deep_moc + hsc_moc + ps1_moc + legacy_moc) 

was_observed_nir = inMoc(
    master_catalogue['ra'], master_catalogue['dec'],
    wirds_moc + uhs_moc 
)

was_observed_mir = inMoc(
    master_catalogue['ra'], master_catalogue['dec'],
    irac_moc
)
In [52]:
master_catalogue.add_column(
    Column(
        1 * was_observed_optical + 2 * was_observed_nir + 4 * was_observed_mir,
        name="flag_optnir_obs")
)

VIII.b Wavelength domain detection

We add a binary flag_optnir_det indicating that a source was detected in a given wavelength domain:

  • 1 for detection in optical;
  • 2 for detection in near-infrared;
  • 4 for detection in mid-infrared (IRAC).

It's an integer binary flag, so a source detected both in optical and near-infrared by not in mid-infrared would have this flag at 1 + 2 = 3.

Note 1: We use the total flux columns to know if the source has flux, in some catalogues, we may have aperture flux and no total flux.

To get rid of artefacts (chip edges, star flares, etc.) we consider that a source is detected in one wavelength domain when it has a flux value in at least two bands. That means that good sources will be excluded from this flag when they are on the coverage of only one band.

In [53]:
# SpARCS is a catalogue of sources detected in r (with fluxes measured at 
# this prior position in the other bands).  Thus, we are only using the r
# CFHT band.
# Check to use catalogue flags from HSC and PanSTARRS.
nb_optical_flux = (
#HSC
    1 * ~np.isnan(master_catalogue['f_suprime_g']) +
    1 * ~np.isnan(master_catalogue['f_suprime_r']) +
    1 * ~np.isnan(master_catalogue['f_suprime_i']) +
    1 * ~np.isnan(master_catalogue['f_suprime_z']) +
    1 * ~np.isnan(master_catalogue['f_suprime_y']) +
#PS1
    1 * ~np.isnan(master_catalogue['f_gpc1_g']) +
    1 * ~np.isnan(master_catalogue['f_gpc1_r']) +
    1 * ~np.isnan(master_catalogue['f_gpc1_i']) +
    1 * ~np.isnan(master_catalogue['f_gpc1_z']) +
    1 * ~np.isnan(master_catalogue['f_gpc1_y']) +
#CFHT
    1 * ~np.isnan(master_catalogue['f_megacam_u']) +
    1 * ~np.isnan(master_catalogue['f_megacam_g']) +
    1 * ~np.isnan(master_catalogue['f_megacam_r']) +
    1 * ~np.isnan(master_catalogue['f_megacam_i']) +
    1 * ~np.isnan(master_catalogue['f_megacam_z']) 

)

nb_nir_flux = (
    1 * ~np.isnan(master_catalogue['f_uhs_j']) +
    1 * ~np.isnan(master_catalogue['f_wircam_j']) +
    1 * ~np.isnan(master_catalogue['f_wircam_h']) +
    1 * ~np.isnan(master_catalogue['f_wircam_k']) 
    
)

nb_mir_flux = (
    1 * ~np.isnan(master_catalogue['f_irac-egs_i1']) +
    1 * ~np.isnan(master_catalogue['f_irac-egs_i2']) +
    1 * ~np.isnan(master_catalogue['f_irac-egs_i3']) +
    1 * ~np.isnan(master_catalogue['f_irac-egs_i4'])
)
In [54]:
has_optical_flux = nb_optical_flux >= 2
has_nir_flux = nb_nir_flux >= 2
has_mir_flux = nb_mir_flux >= 2

master_catalogue.add_column(
    Column(
        1 * has_optical_flux + 2 * has_nir_flux + 4 * has_mir_flux,
        name="flag_optnir_det")
)

IX - Cross-identification table

We are producing a table associating to each HELP identifier, the identifiers of the sources in the pristine catalogues. This can be used to easily get additional information from them.

For convenience, we also cross-match the master list with the SDSS catalogue and add the objID associated with each source, if any. TODO: should we correct the astrometry with respect to Gaia positions?

In [55]:
#
# Addind SDSS ids
#
sdss = Table.read("../../dmu0/dmu0_SDSS-DR13/data/SDSS-DR13_EGS.fits")['objID', 'ra', 'dec']
sdss_coords = SkyCoord(sdss['ra'] * u.deg, sdss['dec'] * u.deg)
idx_ml, d2d, _ = sdss_coords.match_to_catalog_sky(SkyCoord(master_catalogue['ra'], master_catalogue['dec']))
idx_sdss = np.arange(len(sdss))

# Limit the cross-match to 1 arcsec
mask = d2d <= 1. * u.arcsec
idx_ml = idx_ml[mask]
idx_sdss = idx_sdss[mask]
d2d = d2d[mask]
nb_orig_matches = len(idx_ml)

# In case of multiple associations of one master list object to an SDSS object, we keep only the
# association to the nearest one.
sort_idx = np.argsort(d2d)
idx_ml = idx_ml[sort_idx]
idx_sdss = idx_sdss[sort_idx]
_, unique_idx = np.unique(idx_ml, return_index=True)
idx_ml = idx_ml[unique_idx]
idx_sdss = idx_sdss[unique_idx]
print("{} master list rows had multiple associations.".format(nb_orig_matches - len(idx_ml)))

# Adding the ObjID to the master list
master_catalogue.add_column(Column(data=np.full(len(master_catalogue), -1, dtype='>i8'), name="sdss_id"))
master_catalogue['sdss_id'][idx_ml] = sdss['objID'][idx_sdss]
30 master list rows had multiple associations.
In [56]:
id_names = []
for col in master_catalogue.colnames:
    if '_id' in col:
        id_names += [col]
    if '_intid' in col:
        id_names += [col]
        
print(id_names)
['hsc_id', 'ps1_id', 'aegis_id', 'candels-egs_id', 'wirds_id', 'cfhtls-wide_id', 'cfhtls-deep_id', 'cfhtlens_id', 'deep2_id', 'irac-egs_id', 'legacy_id', 'uhs_id', 'help_id', 'specz_id', 'sdss_id']
In [57]:
master_catalogue[id_names].write(
    "{}/master_list_cross_ident_egs{}.fits".format(OUT_DIR, SUFFIX), overwrite=True)
id_names.remove('help_id')
master_catalogue.remove_columns(id_names)

X - Adding HEALPix index

We are adding a column with a HEALPix index at order 13 associated with each source.

In [58]:
master_catalogue.add_column(Column(
    data=coords_to_hpidx(master_catalogue['ra'], master_catalogue['dec'], order=13),
    name="hp_idx"
))

XI - Saving the catalogue

In [59]:
columns = ["help_id", "field", "ra", "dec", "hp_idx"]

bands = [column[5:] for column in master_catalogue.colnames if 'f_ap' in column]
for band in bands:
    columns += ["f_ap_{}".format(band), "ferr_ap_{}".format(band),
                "m_ap_{}".format(band), "merr_ap_{}".format(band),
                "f_{}".format(band), "ferr_{}".format(band),
                "m_{}".format(band), "merr_{}".format(band),
                "flag_{}".format(band)]    
    
columns += ["stellarity", "stellarity_origin", "flag_cleaned", "flag_merged", "flag_gaia", "flag_optnir_obs", 
            "flag_optnir_det", "zspec", "zspec_qual", "zspec_association_flag", "ebv"]
In [60]:
# We check for columns in the master catalogue that we will not save to disk.
print("Missing columns: {}".format(set(master_catalogue.colnames) - set(columns)))
Missing columns: set()
In [61]:
master_catalogue[columns].write("{}/master_catalogue_egs{}.fits".format(OUT_DIR, SUFFIX))