ML match for LOFAR and the combined PanSTARRS WISE catalogue: Generic matching code applied to sources

In this notebook the maximum likelihood cross-match between the LOFAR HETDEX catalogue and the combined PansSTARRS WISE catalogue is computed.

Configuration

Load libraries and setup


In [1]:
import numpy as np
from astropy.table import Table, join
from astropy import units as u
from astropy.coordinates import SkyCoord, search_around_sky
from IPython.display import clear_output
import pickle
import os

In [2]:
import sys

In [3]:
sys.path.append("..")

In [54]:
from mltier1 import (get_center, Field, MultiMLEstimator, MultiMLEstimatorOld, 
                       parallel_process, get_sigma_all, get_sigma_all_old, describe)

In [5]:
%load_ext autoreload

In [53]:
%autoreload

In [7]:
from IPython.display import clear_output

In [8]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

General configuration


In [9]:
save_intermediate = True
plot_intermediate = True

In [10]:
idp = "../idata/final_pdf_v0.9"

In [11]:
if not os.path.isdir(idp):
    os.makedirs(idp)

Area limits


In [12]:
# Busy week Edinburgh 2017
ra_down = 172.09
ra_up = 187.5833
dec_down = 46.106
dec_up = 56.1611

In [13]:
# Busy week Hatfield 2017
ra_down = 170.
ra_up = 190.
dec_down = 46.8
dec_up = 55.9

In [14]:
# Full field July 2017
ra_down = 160.
ra_up = 232.
dec_down = 42.
dec_up = 62.

In [15]:
field = Field(170.0, 190.0, 46.8, 55.9)

In [16]:
field_full = Field(160.0, 232.0, 42.0, 62.0)

Load data


In [17]:
combined_all = Table.read("../pw.fits")

In [18]:
lofar_all = Table.read("../data/LOFAR_HBA_T1_DR1_catalog_v0.9.srl.fixed.fits")
#lofar_all = Table.read("data/LOFAR_HBA_T1_DR1_merge_ID_optical_v0.8.fits")

In [19]:
np.array(combined_all.colnames)


Out[19]:
array(['AllWISE', 'objID', 'ra', 'dec', 'raErr', 'decErr', 'W1mag',
       'W1magErr', 'i', 'iErr'], dtype='<U8')

In [20]:
np.array(lofar_all.colnames)


Out[20]:
array(['Source_Name', 'RA', 'E_RA', 'E_RA_tot', 'DEC', 'E_DEC',
       'E_DEC_tot', 'Peak_flux', 'E_Peak_flux', 'E_Peak_flux_tot',
       'Total_flux', 'E_Total_flux', 'E_Total_flux_tot', 'Maj', 'E_Maj',
       'Min', 'E_Min', 'PA', 'E_PA', 'Isl_rms', 'S_Code', 'Mosaic_ID',
       'Isl_id'], dtype='<U16')

Filter catalogues

The following line has been corrected in the latest versions to use all the sources, including the extended. Hence the running of the "-extended" version of this notebook is no longer necessary.


In [21]:
lofar = field_full.filter_catalogue(lofar_all, colnames=("RA", "DEC"))

In [22]:
combined = field_full.filter_catalogue(combined_all, 
                               colnames=("ra", "dec"))

Additional data


In [23]:
combined["colour"] = combined["i"] - combined["W1mag"]

In [24]:
combined_aux_index = np.arange(len(combined))

Sky coordinates


In [25]:
coords_combined = SkyCoord(combined['ra'], 
                           combined['dec'], 
                           unit=(u.deg, u.deg), 
                           frame='icrs')

In [26]:
coords_lofar = SkyCoord(lofar['RA'], 
                       lofar['DEC'], 
                       unit=(u.deg, u.deg), 
                       frame='icrs')

Class of sources in the combined catalogue

The sources are grouped depending on the available photometric data.


In [27]:
combined_matched = (~np.isnan(combined["i"]) & ~np.isnan(combined["W1mag"])) # Matched i-W1 sources

In [28]:
combined_panstarrs = (~np.isnan(combined["i"]) & np.isnan(combined["W1mag"])) # Sources with only i-band

In [29]:
combined_wise =(np.isnan(combined["i"]) & ~np.isnan(combined["W1mag"])) # Sources with only W1-band

In [30]:
combined_i = combined_matched | combined_panstarrs
combined_w1 = combined_matched | combined_wise
#combined_only_i = combined_panstarrs & ~combined_matched
#combined_only_w1 = combined_wise & ~combined_matched

In [31]:
print("Total    - ", len(combined))
print("i and W1 - ", np.sum(combined_matched))
print("Only i   - ", np.sum(combined_panstarrs))
print("With i   - ", np.sum(combined_i))
print("Only W1  - ", np.sum(combined_wise))
print("With W1  - ", np.sum(combined_w1))


Total    -  26674548
i and W1 -  8196213
Only i   -  13454849
With i   -  21651062
Only W1  -  5023475
With W1  -  13219688

Colour categories

The colour categories will be used after the first ML match


In [32]:
colour_limits = [0.0, 0.5, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.5, 4.0]

In [33]:
# Start with the W1-only, i-only and "less than lower colour" bins
colour_bin_def = [{"name":"only W1", "condition": combined_wise},
                  {"name":"only i", "condition": combined_panstarrs},
                  {"name":"-inf to {}".format(colour_limits[0]), 
                   "condition": (combined["colour"] < colour_limits[0])}]

# Get the colour bins
for i in range(len(colour_limits)-1):
    name = "{} to {}".format(colour_limits[i], colour_limits[i+1])
    condition = ((combined["colour"] >= colour_limits[i]) & 
                 (combined["colour"] < colour_limits[i+1]))
    colour_bin_def.append({"name":name, "condition":condition})

# Add the "more than higher colour" bin
colour_bin_def.append({"name":"{} to inf".format(colour_limits[-1]), 
                       "condition": (combined["colour"] >= colour_limits[-1])})


/home/jsm/programs/soft/anaconda3/lib/python3.6/site-packages/astropy/table/column.py:965: RuntimeWarning: invalid value encountered in less
  return getattr(self.data, op)(other)
/home/jsm/programs/soft/anaconda3/lib/python3.6/site-packages/astropy/table/column.py:965: RuntimeWarning: invalid value encountered in greater_equal
  return getattr(self.data, op)(other)

In [34]:
combined["category"] = np.nan
for i in range(len(colour_bin_def)):
    combined["category"][colour_bin_def[i]["condition"]] = i

In [35]:
np.sum(np.isnan(combined["category"]))


Out[35]:
11

We get the number of sources of the combined catalogue in each colour category. It will be used at a later stage to compute the $Q_0$ values


In [36]:
numbers_combined_bins = np.array([np.sum(a["condition"]) for a in colour_bin_def])

In [37]:
numbers_combined_bins


Out[37]:
array([ 5023475, 13454849,  1048864,   679553,   911508,   654963,
         774322,   830266,   804997,   713558,   580621,   438821,
         309428,   319368,    95816,    34128])

Maximum Likelihood


In [40]:
bin_list, centers, Q_0_colour, n_m, q_m = pickle.load(open("../lofar_params.pckl", "rb"))

In [41]:
likelihood_ratio_function = MultiMLEstimator(Q_0_colour, n_m, q_m, centers)

In [45]:
likelihood_ratio_function_old = MultiMLEstimatorOld(Q_0_colour, n_m, q_m, centers)

ML match


In [42]:
radius = 15

In [43]:
selection = ~np.isnan(combined["category"]) # Avoid the dreaded sources with no actual data
catalogue = combined[selection]

In [44]:
def apply_ml(i, likelihood_ratio_function):
    idx_0 = idx_i[idx_lofar == i]
    d2d_0 = d2d[idx_lofar == i]
    
    category = catalogue["category"][idx_0].astype(int)
    mag = catalogue["i"][idx_0]
    mag[category == 0] = catalogue["W1mag"][idx_0][category == 0]
    
    lofar_ra = lofar[i]["RA"]
    lofar_dec = lofar[i]["DEC"]
    lofar_pa = lofar[i]["PA"]
    lofar_maj_err = lofar[i]["E_Maj"]
    lofar_min_err = lofar[i]["E_Min"]
    c_ra = catalogue["ra"][idx_0]
    c_dec = catalogue["dec"][idx_0]
    c_ra_err = catalogue["raErr"][idx_0]
    c_dec_err = catalogue["decErr"][idx_0]
    
    sigma, sigma_maj, sigma_min = get_sigma_all(lofar_maj_err, lofar_min_err, lofar_pa, 
                      lofar_ra, lofar_dec, 
                      c_ra, c_dec, c_ra_err, c_dec_err)

    lr_0 = likelihood_ratio_function(mag, d2d_0.arcsec, sigma, sigma_maj, sigma_min, category)
    
    chosen_index = np.argmax(lr_0)
    result = [combined_aux_index[selection][idx_0[chosen_index]], # Index
              (d2d_0.arcsec)[chosen_index],                        # distance
              lr_0[chosen_index]]                                  # LR
    return result

In [50]:
from mltier1 import fr_u, fr_u_old

In [69]:
def check_ml(i, likelihood_ratio_function, likelihood_ratio_function_old, verbose=True):
    idx_0 = idx_i[idx_lofar == i]
    d2d_0 = d2d[idx_lofar == i]
    
    category = catalogue["category"][idx_0].astype(int)
    mag = catalogue["i"][idx_0]
    mag[category == 0] = catalogue["W1mag"][idx_0][category == 0]
    
    lofar_ra = lofar[i]["RA"]
    lofar_dec = lofar[i]["DEC"]
    lofar_pa = lofar[i]["PA"]
    lofar_maj_err = lofar[i]["E_Maj"]
    lofar_min_err = lofar[i]["E_Min"]
    c_ra = catalogue["ra"][idx_0]
    c_dec = catalogue["dec"][idx_0]
    c_ra_err = catalogue["raErr"][idx_0]
    c_dec_err = catalogue["decErr"][idx_0]
    
    sigma, sigma_maj, sigma_min = get_sigma_all_old(lofar_maj_err, lofar_min_err, lofar_pa, 
                      lofar_ra, lofar_dec, 
                      c_ra, c_dec, c_ra_err, c_dec_err)
    sigma_0_0, det_sigma = get_sigma_all(lofar_maj_err, lofar_min_err, lofar_pa, 
                      lofar_ra, lofar_dec, 
                      c_ra, c_dec, c_ra_err, c_dec_err)
    fr = fr_u(d2d_0.arcsec, sigma_0_0, det_sigma)
    fr_old = np.array(fr_u_old(d2d_0.arcsec, sigma, sigma_maj, sigma_min))
    if verbose:
        print("NEW - s00: {}; sdet: {}; fr: {}".format(sigma_0_0, det_sigma, fr))
        print("OLD - s: {}; smin: {}; smaj: {}; fr: {}".format(
            np.array(sigma), np.array(sigma_maj), np.array(sigma_min), fr_old))
    lr_0 = likelihood_ratio_function(mag, d2d_0.arcsec, sigma_0_0, det_sigma, category)
    lr_0_old = likelihood_ratio_function_old(mag, d2d_0.arcsec, sigma, sigma_maj, sigma_min, category)
    
    chosen_index = np.argmax(lr_0)
    chosen_index_old = np.argmax(lr_0_old)
    ix, dist, lr = (combined_aux_index[selection][idx_0[chosen_index]], # Index
                  (d2d_0.arcsec)[chosen_index],                       # distance
                  lr_0[chosen_index])
    ix_old, dist_old, lr_old = (combined_aux_index[selection][idx_0[chosen_index_old]], # Index
                  (d2d_0.arcsec)[chosen_index_old],                       # distance
                  lr_0[chosen_index_old]   )    
    if verbose:
        print("NEW res - Ix: {}; dist: {}; LR: {}".format(ix, dist, lr))                                # LR
        print("OLD res - Ix: {}; dist: {}; LR: {}".format(ix_old, dist_old, lr_old))
    return (sigma_0_0, det_sigma, fr, np.array(sigma), np.array(sigma_maj), np.array(sigma_min), 
        fr_old, ix, dist, lr, ix_old, dist_old, lr_old, (lofar_maj_err, lofar_min_err, lofar_pa, 
        lofar_ra, lofar_dec, c_ra, c_dec, c_ra_err, c_dec_err))

Run the cross-match


In [47]:
idx_lofar, idx_i, d2d, d3d = search_around_sky(
    coords_lofar, coords_combined[selection], radius*u.arcsec)

In [48]:
idx_lofar_unique = np.unique(idx_lofar)

Run the ML matching


In [ ]:
list_i = [141, 235, 396, 412, 418, 711, 858, 887, 932, 965, 1039, 1389, 1680, 1699, 
          1787, 1927, 2168, 2267, 2339, 2410, 2548, 2838, 2969, 3136, 3163, 3265, 
          3348, 3353, 3401]
for i in range(100000):
    s00, det_s, fr, s, s_maj, s_min, fr_o, ix, dist, lr, ix_o, dist_o, lr_o, p = check_ml(idx_lofar_unique[i], 
        likelihood_ratio_function, likelihood_ratio_function_old, verbose=False)
    if (ix != ix_o) and ((lr > 6) or (lr_o > 6)):
        print(i)
        #print(ix, dist, lr)
        #print(ix_o, dist_o, lr_o)
        #print(s00, det_s, fr, s, s_maj, s_min, fr_o)
        #print(p)


5514
6079
7338

In [70]:
list_i = [141, 235, 396, 412, 418, 711, 858, 887, 932, 965, 1039, 1389, 1680, 1699, 
          1787, 1927, 2168, 2267, 2339, 2410, 2548, 2838, 2969, 3136, 3163, 3265, 
          3348, 3353, 3401, 3654, 3687, 4022, 4074, 4083, 4164, 4263]
for i in list_i:
    s00, det_s, fr, s, s_maj, s_min, fr_o, ix, dist, lr, ix_o, dist_o, lr_o, p = check_ml(idx_lofar_unique[i], 
        likelihood_ratio_function, likelihood_ratio_function_old, verbose=False)
    if ix != ix_o:
        print(i)
        print(ix, dist, lr)
        print(ix_o, dist_o, lr_o)
        print(s00, det_s, fr, s, s_maj, s_min, fr_o)
        print(p)


141
10619585 8.146669821114509 6.205941702040493e-07
10619584 11.165577527224745 6.333711104675491e-11
[2.09247864 2.12776272 2.09805469] [0.88298441 0.96200201 0.88976522] [2.08069841e-14 2.78922734e-08 1.14443646e-16] [1.44815998 0.80857455 0.67887615] [1.38456969 0.64243816 0.46820454] [0.42442206 0.49098473 0.49158655] [3.34175321e-14 4.56806505e-23 4.69443288e-70]
(2.1946708811720677, 0.4100846697008271, 50.06371279231633, 185.15272884697757, 50.50747173493889, <MaskedColumn name='ra' dtype='float64' length=3>
185.14894305
185.15581771
185.14997539, <MaskedColumn name='dec' dtype='float64' length=3>
50.50551663
50.50634841
50.51034594, <MaskedColumn name='raErr' dtype='float64' length=3>
0.01865999959409237
 0.1769299954175949
0.04323999956250191, <MaskedColumn name='decErr' dtype='float64' length=3>
0.017410000786185265
  0.1769299954175949
 0.05682000145316124)
235
10312031 5.593230437541127 0.0003512682365998988
10310467 5.669957813533886 0.00016081787004357335
[1.35177593 1.38608732 1.34990626] [0.67803864 0.74378612 0.67449038] [1.60802160e-06 9.17725942e-27 2.18994429e-06] [1.16266403 0.90012359 0.70679573] [1.08247116 0.71821489 0.42446278] [0.42431572 0.54257704 0.56514737] [2.37402664e-06 1.63457865e-44 1.67220939e-14]
(1.6571828820006895, 0.6215214887324083, 98.05149945608375, 185.00194874977328, 49.628069618223584, <MaskedColumn name='ra' dtype='float64' length=3>
185.00435723
184.99825343
185.00225377, <MaskedColumn name='dec' dtype='float64' length=3>
49.62785349
49.62546875
49.62961068, <MaskedColumn name='raErr' dtype='float64' length=3>
 0.03568999841809273
 0.19186000525951385
0.007369999773800373, <MaskedColumn name='decErr' dtype='float64' length=3>
0.047609999775886536
 0.19186000525951385
0.009610000066459179)
396
10336596 9.879419570977952 5.1967027196477796e-46
10336836 9.73909085648407 4.759492250125879e-46
[0.43642841 0.43772721] [0.17778685 0.17840703] [2.44946456e-49 7.89545032e-48] [0.64540683 0.66112969] [0.45164593 0.50652646] [0.46104872 0.42488047] [1.00676427e-51 5.59228971e-48]
(0.45962430993813097, 0.3607080531617051, 140.47341537491053, 184.85546905836188, 49.54251366113696, <MaskedColumn name='ra' dtype='float64' length=2>
184.85427779
184.85796538, <MaskedColumn name='dec' dtype='float64' length=2>
 49.5398805
49.54034693, <MaskedColumn name='raErr' dtype='float64' length=2>
 0.01558000035583973
0.039159998297691345, <MaskedColumn name='decErr' dtype='float64' length=2>
0.020800000056624413
0.025459999218583107)
412
10152717 13.188165255365615 1.3822459891836425e-53
10152914 13.585828548047521 5.102840170822594e-55
[0.6902087  0.7246175  0.69472498] [0.35844022 0.40081683 0.36355639] [8.46909267e-56 1.93677313e-56 5.75424635e-61] [0.75028689 0.80014409 0.74532308] [0.5145911  0.61773941 0.49564987] [0.54600953 0.50855539 0.55663067] [4.58695336e-68 1.26588131e-63 7.45850681e-76]
(0.9570181481224376, 0.6635510711100426, 127.80701678645303, 184.83412498301772, 49.19867902296121, <MaskedColumn name='ra' dtype='float64' length=3>
184.82891851
184.83986042
 184.8393909, <MaskedColumn name='dec' dtype='float64' length=3>
49.19732046
49.19912214
49.20039444, <MaskedColumn name='raErr' dtype='float64' length=3>
0.010180000215768814
  0.1852400004863739
 0.06674999743700027, <MaskedColumn name='decErr' dtype='float64' length=3>
0.018540000542998314
  0.1852400004863739
 0.06674999743700027)
418
10539179 10.068994961771079 4.2707810163500983e-26
10568047 11.018792396084294 3.385288470824365e-30
[0.87358645 0.86452498] [0.4401261  0.42794042] [2.27548846e-26 1.18659903e-31] [0.74207297 0.80486817] [0.49995481 0.62197226] [0.54837713 0.51084566] [6.09088065e-41 1.00411580e-41]
(1.1754585436045837, 0.5955101643619439, 109.54942359368383, 184.86661254557475, 50.29978319287523, <MaskedColumn name='ra' dtype='float64' length=2>
184.86377242
 184.8649372, <MaskedColumn name='dec' dtype='float64' length=2>
50.29765447
 50.3026508, <MaskedColumn name='raErr' dtype='float64' length=2>
0.12515999376773834
0.08223000168800354, <MaskedColumn name='decErr' dtype='float64' length=2>
0.12515999376773834
0.08223000168800354)
711
10575814 9.198128381150243 1.976215887358178e-12
10576088 9.602961542412128 2.1842259111464892e-13
[1.3635413  1.36104773 1.37647667 1.37661606 1.3716576 ] [1.13102742 1.12491553 1.16205801 1.17321432 1.1922468 ] [2.09477102e-25 4.49132802e-15 3.88009143e-16 3.91206439e-34
 6.19532531e-29] [0.96464322 1.06189697 1.15577877 0.97553067 0.97191404] [0.6092525  0.86283594 1.04902714 0.6169039  0.59379451] [0.74789566 0.61898248 0.48514597 0.75570474 0.7694316 ] [4.25110273e-36 1.51944575e-17 3.19661458e-16 2.90220390e-48
 7.10878056e-41]
(1.6638487112465514, 1.134346982048634, 24.647978343408152, 184.58210249377092, 50.26915039989426, <MaskedColumn name='ra' dtype='float64' length=5>
184.57871699
 184.5857549
184.58149495
184.57815286
184.57833895, <MaskedColumn name='dec' dtype='float64' length=5>
50.27176999
50.27018876
50.26651133
50.27223982
50.27189554, <MaskedColumn name='raErr' dtype='float64' length=5>
0.07252000272274017
0.05144000053405762
0.13898999989032745
0.13534000515937805
0.11547999829053879, <MaskedColumn name='decErr' dtype='float64' length=5>
 0.07252000272274017
0.048590000718832016
 0.13898999989032745
  0.1674399971961975
  0.2121499925851822)
858
10533461 8.320021975196168 0.0158209874465675
10533763 5.822392268109992 0.014626402325627891
[4.0029206  4.04350541 4.03291837 4.03054352] [3.40884444 3.50520308 3.55037319 3.53770124] [1.56833729e-06 8.70274197e-06 2.90639507e-04 6.70978406e-04] [1.18781153 0.94820183 1.83680113 1.99857475] [0.91123452 0.4830303  1.75002851 1.94389826] [0.76193693 0.81594635 0.55788764 0.46428503] [4.65067673e-14 7.71819453e-18 3.94978241e-04 2.53162657e-03]
(3.1764678868539, 1.161221996392003, 173.93084849704942, 184.42221529494728, 50.37368720632146, <MaskedColumn name='ra' dtype='float64' length=4>
184.42595848
184.41863345
184.42121382
184.42275226, <MaskedColumn name='dec' dtype='float64' length=4>
50.37287232
  50.373337
 50.3720356
50.37210655, <MaskedColumn name='raErr' dtype='float64' length=4>
0.07056999951601028
0.21593999862670898
 0.1842699944972992
0.17712999880313873, <MaskedColumn name='decErr' dtype='float64' length=4>
0.07056999951601028
0.14148999750614166
 0.1842699944972992
0.17712999880313873)
887
26316182 6.037501662982756 1.406444180015502e-05
10039634 5.854956783978991 3.372122046583055e-06
[1.03214798 1.03229678 1.04845846 1.0370224  1.0485054  1.06290408
 1.04009031] [0.46092053 0.46077726 0.48567448 0.46780613 0.48783375 0.51332332
 0.47346841] [4.92482811e-14 2.12472116e-08 8.12593543e-12 8.46792660e-25
 3.28676099e-24 4.21001340e-46 8.24705679e-09] [0.74465691 1.00772907 0.69154687 0.92768678 0.77475664 1.0187986
 0.89452921] [0.55134672 0.91271122 0.44532952 0.80801728 0.58350026 0.92266317
 0.76195372] [0.50053043 0.42717223 0.52907343 0.45575304 0.50968156 0.43202228
 0.46862464] [7.08513238e-25 1.90858893e-08 3.78908370e-24 1.55949836e-29
 3.61404339e-41 4.52343799e-47 5.71695652e-11]
(1.3652608280318173, 0.4890704123884776, 86.42997958845498, 184.35789181248015, 48.76795677212723, <MaskedColumn name='ra' dtype='float64' length=7>
184.35911806
184.36029303
184.35722096
184.36147229
 184.3602677
 184.3518855
 184.3597404, <MaskedColumn name='dec' dtype='float64' length=7>
48.76997125
48.76833132
48.76989473
48.76972562
 48.7654838
 48.7668284
 48.7691092, <MaskedColumn name='raErr' dtype='float64' length=7>
0.01006999984383583
0.00535999983549118
 0.1293099969625473
 0.0693499967455864
             0.1282
             0.1793
             0.0889, <MaskedColumn name='decErr' dtype='float64' length=7>
0.014030000194907188
0.009460000321269035
  0.1293099969625473
  0.0693499967455864
              0.1375
              0.1897
              0.0944)
932
10619443 8.424038875107664 5.805550478005639e-15
10619713 8.574561206656458 8.147139042950289e-17
[0.9231456  0.94135518 0.92521022] [0.55891863 0.58716951 0.56164177] [5.77881741e-18 8.35446174e-46 1.57201712e-18] [0.81307477 0.84502048 0.95730174] [0.52815508 0.58980878 0.85410045] [0.61817699 0.60513239 0.43236449] [2.38993375e-24 9.32344735e-60 1.63367780e-18]
(1.2499787213944116, 0.8245134957847339, 97.57122999773986, 184.36999002870246, 50.50505848248421, <MaskedColumn name='ra' dtype='float64' length=3>
184.36890191
184.36610563
184.37356858, <MaskedColumn name='dec' dtype='float64' length=3>
50.50729382
50.50209452
50.50435645, <MaskedColumn name='raErr' dtype='float64' length=3>
0.0010000000474974513
  0.13514000177383423
  0.04098000004887581, <MaskedColumn name='decErr' dtype='float64' length=3>
0.0010000000474974513
  0.13514000177383423
  0.04297000169754028)
965
10076821 11.792260793014812 1.625116094544276e-32
10076133 11.81253318610704 2.1099408010605666e-33
[0.90375371 0.90406489] [0.50169282 0.50173258] [9.43454783e-35 1.26230300e-34] [0.85183744 0.75513085] [0.66787735 0.45173644] [0.52874083 0.60510891] [7.89051153e-43 6.46338049e-54]
(1.2285052905928, 0.7348414614121704, 91.16504671858277, 184.30344948704666, 48.91223468545749, <MaskedColumn name='ra' dtype='float64' length=2>
 184.3000322
184.30230276, <MaskedColumn name='dec' dtype='float64' length=2>
48.91462694
48.90904694, <MaskedColumn name='raErr' dtype='float64' length=2>
0.0010000000474974513
 0.008080000057816505, <MaskedColumn name='decErr' dtype='float64' length=2>
0.0010000000474974513
0.0023499999660998583)
1039
10053241 7.3025917455734355 9.989102588923134e-07
10031572 8.301106036346678 8.195974701671413e-08
[1.86357707 1.87258237 1.86526247 1.8877374 ] [1.84340318 1.87201818 1.84339044 1.91585033] [8.07007720e-10 1.08611366e-26 5.34520171e-08 1.90218729e-27] [1.29738099 1.36253722 1.1563301  1.17724344] [1.17161391 1.28580251 0.88248465 0.91250812] [0.55724167 0.45079885 0.74720823 0.74379503] [3.14201785e-10 2.13542947e-26 5.27395916e-10 2.79000010e-36]
(2.0430505934523113, 1.3197094044016677, 2.419897945801926, 184.2356579978587, 48.65800708247041, <MaskedColumn name='ra' dtype='float64' length=4>
184.23711654
184.23449569
184.23812088
 184.2402409, <MaskedColumn name='dec' dtype='float64' length=4>
48.65591215
48.65401025
48.65921877
 48.6551726, <MaskedColumn name='raErr' dtype='float64' length=4>
 0.002460000105202198
  0.09999000281095505
0.0010000000474974513
               0.1538, <MaskedColumn name='decErr' dtype='float64' length=4>
0.0022700000554323196
  0.09999000281095505
0.0010000000474974513
               0.1612)
1389
10347392 3.661709229159755 2.448110124529473e-07
10376199 12.587567112463667 1.506442556116048e-13
[3.77551302e-01 3.62943863e-01 3.64652908e-01 3.68912342e-01
 3.96710428e-01 3.63311858e-01 1.17685308e+07 3.64412895e-01
 3.69218914e-01] [1.41926537e-01 1.31129415e-01 1.32316240e-01 1.36977533e-01
 1.56724756e-01 1.31532474e-01 3.70253402e+13 1.31944437e-01
 1.36075104e-01] [1.37406206e-085 1.15377643e-008 1.51262939e-041 2.40830871e-106
 1.45867651e-092 4.68701720e-127 4.29851206e-015 7.23413729e-039
 5.87800693e-070] [6.13452076e-01 6.01802106e-01 6.02559785e-01 6.08474009e-01
 6.29324328e-01 6.02880719e-01 2.59808250e+03 6.02943564e-01
 6.08266347e-01] [4.41982605e-01 4.26094265e-01 4.25543896e-01 4.27295580e-01
 4.27698255e-01 4.27265810e-01 2.21804048e+03 4.27335801e-01
 4.27477457e-01] [4.25411361e-01 4.24981708e-01 4.26603665e-01 4.33196385e-01
 4.61652806e-01 4.25334091e-01 1.35289655e+03 4.25352858e-01
 4.32725054e-01] [5.48036071e-086 8.02991903e-009 7.32820825e-042 4.26676895e-106
 8.13365650e-093 3.83548005e-127 5.30372472e-008 4.25190425e-039
 6.02453957e-070]
(0.09037308338923389, 0.05980684098991325, 28.614657785428932, 183.95619526169227, 49.6897400662944, <MaskedColumn name='ra' dtype='float64' length=9>
183.95098007
183.95659589
 183.9586458
183.95954704
183.95722702
183.95696992
183.95270262
183.95668388
 183.9568874, <MaskedColumn name='dec' dtype='float64' length=9>
49.68964657
 49.6887565
49.68807083
49.68671487
49.68620437
49.69374861
49.69240856
49.69194221
 49.6927219, <MaskedColumn name='raErr' dtype='float64' length=9>
  0.12088999897241592
0.0010000000474974513
  0.04134000092744827
  0.07724999636411667
  0.18376000225543976
 0.019130000844597816
    3432.510009765625
  0.03830999881029129
               0.0792, <MaskedColumn name='decErr' dtype='float64' length=9>
  0.12088999897241592
0.0010000000474974513
  0.03954000025987625
  0.10005000233650208
  0.18376000225543976
 0.027340000495314598
      1772.7099609375
 0.027990000322461128
               0.0852)
1680
10297780 10.340979045595722 1.7302699179275163e-16
24587529 12.825006465586924 9.413236478838411e-24
[1.34267575 1.42745259] [0.64452551 0.82476664] [1.25354712e-18 1.83784036e-26] [0.78073711 1.05262809] [0.57231279 0.92904651] [0.53104474 0.49487217] [4.20780222e-39 2.01785250e-33]
(1.6500250487244554, 0.5739174499515987, 100.6491108357174, 183.7466272484465, 49.6046469010604, <MaskedColumn name='ra' dtype='float64' length=2>
183.74756041
 183.7417332, <MaskedColumn name='dec' dtype='float64' length=2>
49.60183879
 49.6030246, <MaskedColumn name='raErr' dtype='float64' length=2>
0.032760001718997955
              0.2951, <MaskedColumn name='decErr' dtype='float64' length=2>
0.03319999948143959
             0.3136)
1699
10160918 7.282250451569526 2.416608619296551e-07
10186490 8.957435225435288 1.678271686032769e-11
[1.48415028 1.48190501] [1.14905491 1.14867643] [2.41237738e-09 2.42377824e-13] [0.91047218 1.21097398] [0.51672804 1.12958405] [0.7496344  0.43646061] [5.27365393e-15 4.24602579e-13]
(1.7653852784275903, 1.070838105830682, 134.6488276775193, 183.72719631659717, 49.05869612538708, <MaskedColumn name='ra' dtype='float64' length=2>
183.72572315
183.72410614, <MaskedColumn name='dec' dtype='float64' length=2>
49.05691849
49.06014206, <MaskedColumn name='raErr' dtype='float64' length=2>
0.020959999412298203
0.013770000077784061, <MaskedColumn name='decErr' dtype='float64' length=2>
0.021150000393390656
0.017960000783205032)
1787
10801294 4.650656868769397 0.013696693691391657
26031970 6.725939789987166 0.0008731201622726474
[2.03876732 2.07674158 2.06424606 2.19427622] [1.45048986 1.56071586 1.52686817 1.96554518] [9.14674411e-09 3.46078943e-15 5.53106557e-04 2.70099605e-06] [0.9452067  0.87425286 0.98169737 1.42130343] [0.64355789 0.45559836 0.69900349 1.28675717] [0.69227808 0.74615562 0.68929228 0.60362194] [2.50405035e-17 1.18219179e-37 4.42167423e-06 2.81031986e-06]
(2.1522253137735357, 0.9764863312488866, 55.49229642391294, 183.67990670676014, 51.115238284294506, <MaskedColumn name='ra' dtype='float64' length=4>
183.67691021
183.68232473
183.67814636
 183.6782855, <MaskedColumn name='dec' dtype='float64' length=4>
51.11649927
51.11247507
 51.1159074
 51.1136715, <MaskedColumn name='raErr' dtype='float64' length=4>
0.09818000346422195
0.21726000308990479
0.18758000433444977
             0.4082, <MaskedColumn name='decErr' dtype='float64' length=4>
0.08370000123977661
0.21726000308990479
0.18758000433444977
             0.4366)
1927
10400941 5.639170418429591 6.114071409903084e-09
10399317 6.110920772961257 2.8022953320324855e-11
[0.6878873  0.715754   0.68251616] [0.3318267  0.36779577 0.3275567 ] [7.80965453e-13 8.12385226e-46 3.70737192e-11] [0.8217134  0.84618681 0.70078762] [0.69822541 0.7314453  0.44498557] [0.43323687 0.42546434 0.54137892] [5.14689055e-13 9.99301103e-46 5.74264560e-15]
(0.9458829326375549, 0.5761422194252441, 78.68072315864814, 183.5638753252363, 50.017528004389504, <MaskedColumn name='ra' dtype='float64' length=3>
183.56625946
183.55869024
183.56284568, <MaskedColumn name='dec' dtype='float64' length=3>
 50.0182592
50.01700345
50.01894787, <MaskedColumn name='raErr' dtype='float64' length=3>
 0.07209999859333038
  0.1835400015115738
0.005059999879449606, <MaskedColumn name='decErr' dtype='float64' length=3>
0.051580000668764114
  0.1835400015115738
0.007809999864548445)
2168
10110913 8.829262620643702 5.22598092390512e-10
10192336 14.136720237594359 1.2177141584701192e-28
[1.43436064 1.43536418 1.47069685 1.43473554] [0.7661043  0.76692961 0.83616518 0.77480772] [3.27963335e-13 1.21195669e-31 7.00698878e-26 5.68327801e-30] [0.73810172 1.19544628 1.11048263 1.02058846] [0.44040374 1.11677634 0.98812769 0.88671842] [0.59231638 0.42650019 0.50673003 0.50530313] [5.16779265e-32 1.43767295e-31 2.30103215e-30 1.63571308e-40]
(1.7259053851325532, 0.6907686588764538, 127.45423886390941, 183.3675839441133, 49.10645881473682, <MaskedColumn name='ra' dtype='float64' length=4>
183.37018321
183.37264057
183.36959949
183.36176934, <MaskedColumn name='dec' dtype='float64' length=4>
49.10822508
49.10434661
49.10313799
49.10619555, <MaskedColumn name='raErr' dtype='float64' length=4>
0.024240000173449516
0.031769998371601105
  0.1908400058746338
  0.0443900004029274, <MaskedColumn name='decErr' dtype='float64' length=4>
0.042330000549554825
 0.04701000079512596
  0.1908400058746338
 0.08566000312566757)
2267
10126826 13.476486908228084 2.8683751738106953e-57
10150057 13.890775096186246 1.9615088102089095e-60
[0.67478365 0.6852959  0.66867045] [0.38083747 0.39373641 0.37322447] [1.50192158e-59 5.46419896e-71 9.31460917e-64] [0.78811658 0.8273694  0.80800202] [0.58219014 0.70548725 0.66681087] [0.53120842 0.43223589 0.45632283] [1.65331298e-64 5.90720926e-71 3.47621067e-65]
(0.9247038731785848, 0.7402849681590633, 60.02420948391734, 183.29653049792455, 49.083630917616034, <MaskedColumn name='ra' dtype='float64' length=3>
183.29497288
183.30170738
183.30236768, <MaskedColumn name='dec' dtype='float64' length=3>
49.08002915
49.08597997
49.08415288, <MaskedColumn name='raErr' dtype='float64' length=3>
0.08105000108480453
 0.1299699991941452
0.01648000068962574, <MaskedColumn name='decErr' dtype='float64' length=3>
0.08105000108480453
 0.1299699991941452
0.02230999991297722)
2339
10139327 8.274488312109492 1.7834199541365948e-06
10141298 8.755118257606377 4.1359175201901244e-07
[2.41298955 2.39354866 2.40870333 2.42171453 2.39002445] [1.50963702 1.45040562 1.49382588 1.53088458 1.43667943] [7.38360880e-19 6.74312604e-08 2.82937455e-12 2.68029364e-15
 1.20277328e-08] [0.85900043 0.80900734 0.87694404 1.4914119  1.20016949] [0.55486513 0.4860882  0.59092147 1.41731622 1.06425581] [0.65574875 0.64669245 0.64795268 0.46424584 0.55476696] [3.48652205e-57 9.73679685e-24 3.11810900e-34 3.88085961e-16
 7.49972413e-13]
(2.3723051146026215, 0.8160171556071002, 77.30518944272801, 183.24477758376608, 48.802253214143384, <MaskedColumn name='ra' dtype='float64' length=5>
183.24459062
183.24345826
183.24510264
183.24917588
 183.2478359, <MaskedColumn name='dec' dtype='float64' length=5>
48.79841998
48.80438109
48.80525422
48.80407014
48.80089063, <MaskedColumn name='raErr' dtype='float64' length=5>
  0.1580899953842163
 0.07336000353097916
 0.14065000414848328
 0.17879000306129456
0.024010000750422478, <MaskedColumn name='decErr' dtype='float64' length=5>
  0.1580899953842163
 0.07336000353097916
 0.14065000414848328
 0.17879000306129456
0.029270000755786896)
2410
10665079 8.14849534383629 3.917871197834888e-05
10664800 7.0233936682653715 2.3421963262162006e-05
[2.15215199 2.17088111 2.17417785 2.139579  ] [1.73653814 1.79334979 1.79826803 1.6970511 ] [3.36734066e-16 2.54617429e-09 1.04784727e-06 1.71140232e-08] [0.93297567 1.03398665 1.47431917 1.05785919] [0.52170522 0.73099948 1.40280734 0.7816223 ] [0.77347738 0.73127844 0.45359517 0.71283423] [8.05586450e-37 1.44256364e-16 2.95266907e-06 3.73038915e-14]
(2.2215427043247638, 1.0956119443199501, 151.06618290492912, 183.2016462010732, 50.6161386568669, <MaskedColumn name='ra' dtype='float64' length=4>
183.20556629
183.19785296
183.20318832
 183.2052133, <MaskedColumn name='dec' dtype='float64' length=4>
50.61834145
50.61598032
50.61445085
50.61611734, <MaskedColumn name='raErr' dtype='float64' length=4>
 0.11597999930381775
  0.1803400069475174
 0.18482999503612518
0.004579999949783087, <MaskedColumn name='decErr' dtype='float64' length=4>
 0.11597999930381775
  0.1803400069475174
 0.18482999503612518
0.007780000101774931)
2548
10042275 8.168778253241584 0.00011883810137810923
10042052 7.277289335390782 8.930107723337258e-06
[2.42915386 2.4247403  2.43178488 2.43075519 2.53557113] [1.7072363  1.70751486 1.71043993 1.70734419 2.11427601] [1.17732472e-13 1.68548924e-06 4.30358990e-17 1.01949871e-07
 1.04847953e-11] [1.28426213 1.35130195 0.88787982 0.84742381 1.46239536] [1.14660136 1.23542469 0.53153074 0.44655317 1.3694068 ] [0.57847605 0.54748772 0.71120014 0.72022037 0.51315224] [7.17236606e-19 1.18530604e-07 2.09108398e-48 3.28843044e-21
 4.67127752e-13]
(2.396809198079196, 0.9734181557560929, 128.28368394355962, 183.09873289463354, 48.699424368379226, <MaskedColumn name='ra' dtype='float64' length=5>
183.09388903
183.09567195
183.10110295
183.10059231
 183.0942781, <MaskedColumn name='dec' dtype='float64' length=5>
48.69920143
48.69949456
48.70271134
48.70133298
 48.6999096, <MaskedColumn name='raErr' dtype='float64' length=5>
0.015399999916553497
 0.01672999933362007
0.039009999483823776
0.016119999811053276
              0.3325, <MaskedColumn name='decErr' dtype='float64' length=5>
0.013330000452697277
 0.01672999933362007
 0.03351999819278717
0.014680000022053719
              0.3603)
2838
10044720 8.167017541187153 0.0017210226773532716
10044595 8.612554343058342 9.42855385169965e-06
[2.64073395 2.64172632 2.67638563 2.64102272] [1.27035725 1.27415683 1.38224382 1.27059233] [1.93148117e-16 9.98613027e-08 1.04941191e-06 4.10833692e-07] [1.11008034 1.62353821 1.2562679  1.32004044] [0.98662177 1.56653064 1.14820104 1.22968117] [0.50877879 0.4264482  0.50974838 0.47999058] [5.74751429e-33 1.84621788e-07 7.70789580e-10 1.31452917e-09]
(2.5149526815081176, 0.5788154199557554, 1.4964702197403679, 182.88190362841948, 48.62590217888518, <MaskedColumn name='ra' dtype='float64' length=4>
182.87743681
182.88220187
  182.879603
182.88418534, <MaskedColumn name='dec' dtype='float64' length=4>
48.62817865
48.62828642
48.62747733
48.62759693, <MaskedColumn name='raErr' dtype='float64' length=4>
0.0076500000432133675
 0.021700000390410423
  0.18852999806404114
 0.009449999779462814, <MaskedColumn name='decErr' dtype='float64' length=4>
0.010990000329911709
 0.03852999955415726
 0.18852999806404114
0.014290000312030315)
2969
26639098 3.9049363507042174 1.7466239470300886
10149938 1.152524088381197 1.4395650923951095
[2.77398629 2.76719153 2.8234842  3.1402534  2.90950556] [1.76387033 1.74695603 1.96591748 3.38832881 2.32188129] [7.10188156e-02 2.53680464e-11 9.69889065e-17 4.65814917e-13
 4.98799104e-03] [1.65885343 0.80961737 1.67963677 1.42471719 1.20885189] [1.5981403  0.46843782 1.60436366 1.30382507 1.05387173] [0.44468224 0.66033801 0.49718902 0.57433375 0.5921801 ] [1.75928765e-01 2.35896291e-41 2.32420342e-16 2.01449442e-18
 1.38262068e-03]
(2.573956195107152, 0.83491671868211, 147.7426511071099, 182.79252347730616, 49.091315564733655, <MaskedColumn name='ra' dtype='float64' length=5>
182.79282517
182.79619114
 182.7953139
 182.7872763
 182.7941785, <MaskedColumn name='dec' dtype='float64' length=5>
49.09106365
49.09322008
 49.0879051
 49.0920022
 49.0912713, <MaskedColumn name='raErr' dtype='float64' length=5>
0.15633000433444977
0.13954000174999237
             0.2719
              0.633
             0.4007, <MaskedColumn name='decErr' dtype='float64' length=5>
0.15633000433444977
0.13954000174999237
             0.2913
             0.6813
             0.4318)
3136
10157946 5.500579032462925 8.613706325720702e-06
10160053 13.363192671528463 1.6007937681400142e-07
[8.31293582e-01 4.61550596e+03] [4.77622494e-01 2.66067162e+07] [4.16184051e-09 5.86715256e-09] [ 0.78657998 75.2197251 ] [ 0.51118382 20.75293079] [ 0.59782871 72.30022758] [1.25205617e-11 1.04411311e-04]
(1.143355124862182, 0.7705984309583721, 55.38292448126788, 182.6583568658408, 48.878090907787104, <MaskedColumn name='ra' dtype='float64' length=2>
182.65876354
182.66008077, <MaskedColumn name='dec' dtype='float64' length=2>
48.87658656
 48.8745563, <MaskedColumn name='raErr' dtype='float64' length=2>
0.010579999536275864
   67.92729949951172, <MaskedColumn name='decErr' dtype='float64' length=2>
0.012690000236034393
    75.9260025024414)
3163
10049644 7.773047095453124 1.681172030094499e-11
10049940 8.18219839297072 3.2736375476522527e-13
[1.06057979 1.09621012] [0.5642605  0.62386775] [1.20132547e-13 1.39632742e-14] [0.7617338  1.00800442] [0.49401049 0.89706469] [0.57982068 0.45972585] [1.35904368e-23 1.90024549e-15]
(1.3939479711799156, 0.6903507612608855, 91.59626198829704, 182.63179224438338, 48.89740729101362, <MaskedColumn name='ra' dtype='float64' length=2>
 182.6326975
182.62857542, <MaskedColumn name='dec' dtype='float64' length=2>
48.89533175
48.89657456, <MaskedColumn name='raErr' dtype='float64' length=2>
0.0038900000508874655
  0.19130000472068787, <MaskedColumn name='decErr' dtype='float64' length=2>
0.0031300000846385956
  0.19130000472068787)
3265
10138305 12.901938432164593 9.97511326064781e-19
10136478 13.080945021351898 2.0288921287081786e-19
[1.88470335 1.88219269] [1.61081977 1.60907852] [1.90590512e-21 6.17829347e-21] [1.30640318 1.26322698] [1.20054842 1.13022895] [0.51514344 0.56420293] [4.36039933e-23 5.56524316e-24]
(2.0557428720429143, 1.170247635256306, 110.77637425395883, 182.5487646838092, 48.83296151827646, <MaskedColumn name='ra' dtype='float64' length=2>
182.55427266
 182.5454673, <MaskedColumn name='dec' dtype='float64' length=2>
48.83320165
 48.8358134, <MaskedColumn name='raErr' dtype='float64' length=2>
0.022919999435544014
0.007149999961256981, <MaskedColumn name='decErr' dtype='float64' length=2>
 0.026820000261068344
0.0032099999953061342)
3348
10530582 5.969529383042287 0.00025860126613719004
10530890 6.93575801209668 4.703233024486459e-06
[1.73211725 1.7707799  1.73791871] [1.0358621  1.11739885 1.03555087] [5.23713455e-06 1.79730910e-07 3.78581543e-13] [0.80200087 1.27192605 0.77871156] [0.49043765 1.17088376 0.44292384] [0.63456782 0.49681695 0.64047652] [4.76679610e-13 9.55637606e-08 3.01339251e-34]
(1.9529672475099549, 0.8024993491284448, 173.5265774271794, 182.46772017175704, 50.25257283301108, <MaskedColumn name='ra' dtype='float64' length=3>
182.46513779
182.46850906
182.47181508, <MaskedColumn name='dec' dtype='float64' length=3>
50.25272524
50.25443223
50.25313262, <MaskedColumn name='raErr' dtype='float64' length=3>
0.05950000137090683
 0.1944199949502945
0.05700000002980232, <MaskedColumn name='decErr' dtype='float64' length=3>
0.05768999829888344
 0.1944199949502945
0.05700000002980232)
3353
10176313 8.068727895309499 2.4680735681436265e-11
10176848 8.734049990022491 9.475564676501899e-12
[1.23097537 1.22783626 1.54237512] [0.80698721 0.80383671 1.57712608] [6.46210747e-13 6.39174233e-15 4.16211256e-17] [0.81601738 1.05145522 1.1032058 ] [0.44274145 0.92866001 0.78544522] [0.68546653 0.49310108 0.77468628] [3.08261104e-22 3.61280068e-16 8.33174969e-21]
(1.5519201272441967, 0.9023613422658444, 90.80382047854076, 182.47575160866054, 49.20671264176248, <MaskedColumn name='ra' dtype='float64' length=3>
182.47523902
182.47243725
 182.4730872, <MaskedColumn name='dec' dtype='float64' length=3>
49.20449649
49.20561851
 49.2090368, <MaskedColumn name='raErr' dtype='float64' length=3>
 0.05310000106692314
0.020190000534057617
              0.5608, <MaskedColumn name='decErr' dtype='float64' length=3>
 0.04018000140786171
0.018360000103712082
              0.6069)
3401
10429619 11.078737298503116 7.344301376841543e-39
22410606 12.107737220188927 5.610034657020659e-42
[0.68182474 0.73180841 0.81570998] [0.33950016 0.41017594 0.53453244] [3.81331325e-40 1.22881692e-44 1.53606410e-49] [0.70604873 0.83115146 0.80925136] [0.43327407 0.69715883 0.50452122] [0.55747501 0.4525288  0.6327291 ] [2.26117282e-54 4.18840860e-47 3.56644192e-61]
(0.9018027090711638, 0.5502423072077454, 115.3763620749499, 182.43127884937937, 50.062174202198925, <MaskedColumn name='ra' dtype='float64' length=3>
182.4335908
182.4260466
182.4348496, <MaskedColumn name='dec' dtype='float64' length=3>
50.06487011
 50.0620026
 50.0651309, <MaskedColumn name='raErr' dtype='float64' length=3>
0.1692200005054474
            0.2808
            0.4031, <MaskedColumn name='decErr' dtype='float64' length=3>
0.1692200005054474
            0.3017
            0.4313)
3654
26333602 6.48846016246543 5.503119194605945e-07
26083937 6.491278138117951 4.588531859636372e-07
[1.04190053 1.07987895 1.10201702] [0.53831096 0.60900862 0.65396737] [1.33674040e-17 8.79323181e-10 1.23207018e-09] [1.01805159 1.01609389 0.90802774] [0.90893394 0.88929092 0.70215148] [0.45855004 0.49153684 0.57575834] [1.41538469e-17 4.99928066e-10 3.21738164e-12]
(1.3438516241843852, 0.5913216360668675, 160.9361874349222, 182.2479336879026, 48.9743453167838, <MaskedColumn name='ra' dtype='float64' length=3>
182.24878975
 182.2496111
 182.2492624, <MaskedColumn name='dec' dtype='float64' length=3>
48.97195043
 48.9729174
 48.9759226, <MaskedColumn name='raErr' dtype='float64' length=3>
0.1747799962759018
            0.2618
            0.3025, <MaskedColumn name='decErr' dtype='float64' length=3>
0.1747799962759018
             0.279
            0.3269)
3687
10394564 13.603819726771711 9.404590230387573e-27
10372133 13.790334760630653 1.0209741718610393e-27
[1.48310733 1.50909955] [1.23432845 1.29192072] [1.84674509e-29 2.89322120e-28] [1.17943922 0.92528709] [1.06789715 0.4580903 ] [0.50067211 0.80393375] [6.13283148e-31 4.98672067e-48]
(1.7616603448804946, 1.1361511181562096, 9.06121804506148, 182.20097161081264, 49.933160241796664, <MaskedColumn name='ra' dtype='float64' length=2>
182.19787811
182.19519674, <MaskedColumn name='dec' dtype='float64' length=2>
49.92988784
49.93384027, <MaskedColumn name='raErr' dtype='float64' length=2>
0.07908999919891357
 0.1739100068807602, <MaskedColumn name='decErr' dtype='float64' length=2>
0.07277999818325043
 0.1739100068807602)
4022
10435667 9.682000845681808 2.6370511460862803e-13
10435731 9.351171403098215 1.7410596499098666e-13
[1.38858558 1.38905237 1.39086767 1.390437  ] [0.90126173 0.90253568 0.90204923 0.90063816] [3.87002943e-16 3.77033915e-15 4.37984138e-17 1.01292787e-33] [1.16350781 1.17235491 0.82713044 0.90344564] [1.07670052 1.08983528 0.47939086 0.64334771] [0.44098345 0.43205915 0.67403944 0.63428522] [3.08198911e-16 5.16853508e-15 9.27217502e-33 4.64216336e-56]
(1.6904250954524926, 0.8927541172446013, 103.0638042806872, 181.86264173642456, 49.792882296416934, <MaskedColumn name='ra' dtype='float64' length=4>
181.85847563
181.85890326
181.86451064
181.86673954, <MaskedColumn name='dec' dtype='float64' length=4>
  49.792887
  49.793843
49.79538369
  49.795871, <MaskedColumn name='raErr' dtype='float64' length=4>
0.022630000486969948
 0.02085000090301037
 0.02531999908387661
0.007720000110566616, <MaskedColumn name='decErr' dtype='float64' length=4>
0.019819999113678932
 0.03666999936103821
0.029980000108480453
 0.01245999988168478)
4074
10169833 2.009828784751523 0.7893122079127761
10170248 3.9801158575633746 0.5846346358108253
[1.43758696 1.41949006 1.40052795 1.41096452 1.40516085 1.40021921] [1.12116923 1.08114893 1.04124635 1.08233651 1.04825332 1.03906159] [3.48334567e-02 3.47111800e-08 3.07245526e-14 5.04017592e-30
 5.41136905e-04 1.43956294e-07] [0.89769674 0.87382811 1.00035954 0.98417505 1.1848525  0.88962183] [0.50639522 0.44487741 0.76644083 0.71180188 1.10464061 0.50818739] [0.74123095 0.75210349 0.64287453 0.67966066 0.42853771 0.73018668] [3.45871928e-02 2.27414277e-13 5.49285844e-19 1.12736359e-42
 1.19212530e-03 9.31715734e-12]
(1.698536773295176, 1.0289943249498263, 27.29969742608501, 181.8244768618883, 49.245873341460154, <MaskedColumn name='ra' dtype='float64' length=6>
181.82365386
181.82688694
181.82604132
181.82726287
181.82530897
181.82254366, <MaskedColumn name='dec' dtype='float64' length=6>
49.24602509
49.24494197
49.24357648
49.24256224
49.24683628
49.24705911, <MaskedColumn name='raErr' dtype='float64' length=6>
   0.1940699964761734
   0.1395300030708313
  0.03141000121831894
  0.10650999844074249
  0.06787999719381332
0.0010000000474974513, <MaskedColumn name='decErr' dtype='float64' length=6>
   0.1940699964761734
   0.1395300030708313
  0.03221999853849411
  0.15714000165462494
  0.06411000341176987
0.0010000000474974513)
4083
10559980 9.500726088288733 2.3306183344300844e-13
10561843 13.992864906064668 8.631996455866298e-31
[1.3559725  1.35635991] [0.53015194 0.52872451] [1.05306529e-15 1.35466223e-32] [0.7352101  1.16083551] [0.57880118 1.08038576] [0.45334654 0.42462418] [3.32220009e-37 9.73385556e-33]
(1.6619844129144477, 0.28678079981147614, 113.49938507106039, 181.7846759933613, 50.34667597354045, <MaskedColumn name='ra' dtype='float64' length=2>
181.78166654
181.79000398, <MaskedColumn name='dec' dtype='float64' length=2>
50.34486586
50.34479248, <MaskedColumn name='raErr' dtype='float64' length=2>
0.029510000720620155
0.010599999688565731, <MaskedColumn name='decErr' dtype='float64' length=2>
 0.03133000060915947
0.012149999849498272)
4164
10349718 10.188204683239734 2.5756809920643315e-10
10352981 11.468419936496504 6.461126227217366e-12
[2.22723074 2.2139461 ] [0.92874528 0.89310459] [1.29966771e-11 2.24273061e-14] [1.18427085 1.48555222] [1.09077284 1.42360334] [0.46120717 0.42452201] [2.68545150e-17 3.01300785e-14]
(2.2671583379606126, 0.3463703185022907, 124.72061073300016, 181.72178744231863, 49.805734530880756, <MaskedColumn name='ra' dtype='float64' length=2>
181.72276061
181.72566052, <MaskedColumn name='dec' dtype='float64' length=2>
49.80297505
49.80375964, <MaskedColumn name='raErr' dtype='float64' length=2>
 0.11691000312566757
0.009089999832212925, <MaskedColumn name='decErr' dtype='float64' length=2>
0.11691000312566757
0.01131999958306551)
4263
10147266 3.8853285299552276 0.03534795711095447
10099632 5.989868416447785 0.000790763778605448
[1.31779428 1.32077122] [0.80588277 0.81023692] [2.41799389e-07 6.47619499e-04] [1.14886043 0.80414216] [1.06760058 0.47524861] [0.42439286 0.64867817] [4.39434366e-07 4.40164364e-06]
(1.6313121129789803, 0.8331527126372018, 129.61056315030868, 181.63557649118113, 49.02391401629749, <MaskedColumn name='ra' dtype='float64' length=2>
181.63363841
 181.6348287, <MaskedColumn name='dec' dtype='float64' length=2>
49.02498793
49.02295259, <MaskedColumn name='raErr' dtype='float64' length=2>
0.009669999592006207
 0.03669000044465065, <MaskedColumn name='decErr' dtype='float64' length=2>
0.014109999872744083
 0.05400000140070915)

In [43]:
import multiprocessing
n_cpus_total = multiprocessing.cpu_count()
n_cpus = max(1, n_cpus_total-1)

In [ ]:
def ml(i):
    return apply_ml(i, likelihood_ratio_function)

In [ ]:
res = parallel_process(idx_lofar_unique, ml, n_jobs=n_cpus)


  1%|          | 3.54K/306K [00:57<2:39:17, 31.6it/s]

In [46]:
lofar["lr"] = np.nan                   # Likelihood ratio
lofar["lr_dist"] = np.nan              # Distance to the selected source
lofar["lr_index"] = np.nan             # Index of the PanSTARRS source in combined

In [47]:
(lofar["lr_index"][idx_lofar_unique], 
 lofar["lr_dist"][idx_lofar_unique], 
 lofar["lr"][idx_lofar_unique]) = list(map(list, zip(*res)))


/disk2/jsm/prog/anaconda/envs/py36/lib/python3.6/site-packages/numpy/ma/core.py:3399: UserWarning: Warning: converting a masked element to nan.
  _data[indx] = dval

In [48]:
total_sources = len(idx_lofar_unique)
combined_aux_index = np.arange(len(combined))

Threshold and selection


In [49]:
lofar["lrt"] = lofar["lr"]
lofar["lrt"][np.isnan(lofar["lr"])] = 0

In [50]:
q0 = np.sum(Q_0_colour)

In [51]:
def completeness(lr, threshold, q0):
    n = len(lr)
    lrt = lr[lr < threshold]
    return 1. - np.sum((q0 * lrt)/(q0 * lrt + (1 - q0)))/float(n)/q0

def reliability(lr, threshold, q0):
    n = len(lr)
    lrt = lr[lr > threshold]
    return 1. - np.sum((1. - q0)/(q0 * lrt + (1 - q0)))/float(n)/q0

completeness_v = np.vectorize(completeness, excluded=[0])
reliability_v = np.vectorize(reliability, excluded=[0])

In [52]:
n_test = 100
threshold_mean = np.percentile(lofar["lrt"], 100*(1 - q0))

In [53]:
thresholds = np.arange(0., 10., 0.01)
thresholds_fine = np.arange(0.1, 1., 0.001)

In [54]:
completeness_t = completeness_v(lofar["lrt"], thresholds, q0)
reliability_t = reliability_v(lofar["lrt"], thresholds, q0)
average_t = (completeness_t + reliability_t)/2


/disk2/jsm/prog/anaconda/envs/py36/lib/python3.6/site-packages/numpy/lib/function_base.py:2813: UserWarning: Warning: converting a masked element to nan.
  res = array(outputs, copy=False, subok=True, dtype=otypes[0])

In [55]:
completeness_t_fine = completeness_v(lofar["lrt"], thresholds_fine, q0)
reliability_t_fine = reliability_v(lofar["lrt"], thresholds_fine, q0)
average_t_fine = (completeness_t_fine + reliability_t_fine)/2

In [56]:
threshold_sel = thresholds_fine[np.argmax(average_t_fine)]

In [57]:
plt.rcParams["figure.figsize"] = (15,6)
subplot(1,2,1)
plot(thresholds, completeness_t, "r-")
plot(thresholds, reliability_t, "g-")
plot(thresholds, average_t, "k-")
vlines(threshold_sel, 0.9, 1., "k", linestyles="dashed")
vlines(threshold_mean, 0.9, 1., "y", linestyles="dashed")
ylim([0.9, 1.])
xlabel("Threshold")
ylabel("Completeness/Reliability")
subplot(1,2,2)
plot(thresholds_fine, completeness_t_fine, "r-")
plot(thresholds_fine, reliability_t_fine, "g-")
plot(thresholds_fine, average_t_fine, "k-")
vlines(threshold_sel, 0.9, 1., "k", linestyles="dashed")
#vlines(threshold_mean, 0.9, 1., "y", linestyles="dashed")
ylim([0.97, 1.])
xlabel("Threshold")
ylabel("Completeness/Reliability")


Out[57]:
<matplotlib.text.Text at 0x7f2203609c88>

In [58]:
print(threshold_sel)


0.358

In [59]:
plt.rcParams["figure.figsize"] = (15,6)
subplot(1,2,1)
hist(lofar[lofar["lrt"] != 0]["lrt"], bins=200)
vlines([threshold_sel], 0, 5000)
ylim([0,5000])
subplot(1,2,2)
hist(np.log10(lofar[lofar["lrt"] != 0]["lrt"]+1), bins=200)
vlines(np.log10(threshold_sel+1), 0, 5000)
ticks, _ = xticks()
xticks(ticks, ["{:.1f}".format(10**t-1) for t in ticks])
ylim([0,5000]);



In [60]:
lofar["lr_index_sel"] = lofar["lr_index"]
lofar["lr_index_sel"][lofar["lrt"] < threshold_sel] = np.nan

Save combined catalogue


In [61]:
combined["lr_index_sel"] = combined_aux_index.astype(float)

In [62]:
pwl = join(lofar, combined, 
           join_type='left', 
           keys='lr_index_sel', 
           uniq_col_name='{col_name}{table_name}', 
           table_names=['_input', ''])

In [63]:
pwl_columns = pwl.colnames

In [64]:
for col in pwl_columns:
    fv = pwl[col].fill_value
    if (isinstance(fv, np.float64) and (fv != 1e+20)):
        print(col, fv)
        pwl[col].fill_value = 1e+20


lr 1.0
lrt 1.0
dec 1.0
W1mag 1.0
i 1.0
colour 1.0
category 1.0

In [65]:
columns_save = ['Source_Name', 'RA', 'E_RA', 'DEC', 'E_DEC', 
 'Peak_flux', 'E_Peak_flux', 'Total_flux', 'E_Total_flux', 
 'Maj', 'E_Maj', 'Min', 'E_Min', 'PA', 'E_PA', 'Isl_rms', 'S_Code', 'Mosaic_ID',
 'AllWISE', 'objID', 'ra', 'dec', 'raErr', 'decErr',
 'W1mag', 'W1magErr', 'i', 'iErr', 'colour', 'category',
 'lr', 'lr_dist']

In [66]:
pwl[columns_save].filled().write('lofar_pw_pdf.fits', format="fits")

In [ ]: