Compare the LR results before and after correcting the Gaussian code


In [2]:
import numpy as np
from astropy.table import Table, join
import os
from matplotlib import pyplot as plt

Load data


In [4]:
old = Table.read("../lofar_pw_pdf.fits")

In [5]:
new = Table.read("../lofar_pw_corSigma.fits")

In [6]:
len(old)


Out[6]:
318769

In [7]:
len(new)


Out[7]:
325694

In [8]:
old.colnames


Out[8]:
['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 [9]:
pwl = join(old, new, 
           join_type='left', 
           keys='Source_Name', 
           uniq_col_name='{col_name}{table_name}', 
           table_names=['_old', '_new'])

In [10]:
A = pwl["lr_new"]-pwl["lr_old"]
plt.hist(A[~np.isnan(A)], bins=50)


Out[10]:
(array([1.00000e+00, 0.00000e+00, 0.00000e+00, 1.00000e+00, 0.00000e+00,
        1.00000e+00, 2.00000e+00, 5.00000e+00, 2.00000e+00, 1.30000e+01,
        6.00000e+00, 7.00000e+00, 1.80000e+01, 3.70000e+01, 5.70000e+01,
        8.90000e+01, 1.35000e+02, 2.16000e+02, 3.89000e+02, 7.63000e+02,
        1.32600e+03, 2.74000e+03, 6.54800e+03, 1.66990e+04, 5.02190e+04,
        1.87843e+05, 1.12860e+04, 5.62400e+03, 3.65700e+03, 2.55500e+03,
        1.78100e+03, 1.24700e+03, 9.87000e+02, 6.21000e+02, 4.85000e+02,
        3.42000e+02, 3.08000e+02, 2.37000e+02, 2.07000e+02, 1.57000e+02,
        9.60000e+01, 9.30000e+01, 7.60000e+01, 8.00000e+01, 6.50000e+01,
        3.90000e+01, 2.20000e+01, 1.90000e+01, 1.20000e+01, 6.00000e+00]),
 array([-3736.78453907, -3590.04282495, -3443.30111083, -3296.5593967 ,
        -3149.81768258, -3003.07596845, -2856.33425433, -2709.5925402 ,
        -2562.85082608, -2416.10911196, -2269.36739783, -2122.62568371,
        -1975.88396958, -1829.14225546, -1682.40054134, -1535.65882721,
        -1388.91711309, -1242.17539896, -1095.43368484,  -948.69197071,
         -801.95025659,  -655.20854247,  -508.46682834,  -361.72511422,
         -214.98340009,   -68.24168597,    78.50002815,   225.24174228,
          371.9834564 ,   518.72517053,   665.46688465,   812.20859878,
          958.9503129 ,  1105.69202702,  1252.43374115,  1399.17545527,
         1545.9171694 ,  1692.65888352,  1839.40059764,  1986.14231177,
         2132.88402589,  2279.62574002,  2426.36745414,  2573.10916827,
         2719.85088239,  2866.59259651,  3013.33431064,  3160.07602476,
         3306.81773889,  3453.55945301,  3600.30116713]),
 <a list of 50 Patch objects>)

In [11]:
cond = (pwl['ra_old'] == pwl['ra_new']) & (pwl['dec_old'] == pwl['dec_new'])

In [12]:
# Galaxies with the same id (or lack of id)
np.sum(cond)


Out[12]:
304332

In [13]:
len(pwl) - np.sum(cond)


Out[13]:
14439

In [14]:
pwl[cond & np.isnan(pwl["lr_new"])]


Out[14]:
<Table masked=True length=12679>
Source_NameRA_oldE_RA_oldDEC_oldE_DEC_oldPeak_flux_oldE_Peak_flux_oldTotal_flux_oldE_Total_flux_oldMaj_oldE_Maj_oldMin_oldE_Min_oldPA_oldE_PA_oldIsl_rms_oldS_Code_oldMosaic_ID_oldAllWISE_oldobjID_oldra_olddec_oldraErr_olddecErr_oldW1mag_oldW1magErr_oldi_oldiErr_oldcolour_oldcategory_oldlr_oldlr_dist_oldRA_newE_RA_newDEC_newE_DEC_newPeak_flux_newE_Peak_flux_newTotal_flux_newE_Total_flux_newMaj_newE_Maj_newMin_newE_Min_newPA_newE_PA_newIsl_rms_newS_Code_newMosaic_ID_newAllWISE_newobjID_newra_newdec_newraErr_newdecErr_newW1mag_newW1magErr_newi_newiErr_newcolour_newcategory_newlr_newlr_dist_new
degarcsecdegarcsecmJy / beammJy / beammJymJyarcsecarcsecarcsecarcsecdegdegmJy / beam
str22float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str1str11str19int64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64str1str8str19int64float64float64float64float64float64float64float64float64float64float64float64float64
ILTJ104358.55+513354.6160.993961703101920.380475173295004351.565171188709720.355193955238840450.75043585433748620.110030577606489590.72388216444314070.19298651801234496.0521434962511710.91125004677539475.7412640732403940.8197450714237257112.23586180232195114.359021382292920.11110970808658749SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan160.993961703101920.380475173295004351.565171188709720.355193955238840450.75043585433748620.110030577606489590.72388216444314070.19298651801234496.0521434962511710.91125004677539475.7412640732403940.8197450714237257112.23586180232195114.359021382292920.11110970808658749SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104406.52+513113.1161.027162950739380.401185745468503151.520308929601410.29567576487415860.72701739238475740.102141510369162750.60741195489758490.19096364484406536.2681129226774531.01789001140024454.8013433771561470.583597743040184260.5750575225256721.4431861102386560.10890992416534573SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.027162950739380.401185745468503151.520308929601410.29567576487415860.72701739238475740.102141510369162750.60741195489758490.19096364484406536.2681129226774531.01789001140024454.8013433771561470.583597743040184260.5750575225256721.4431861102386560.10890992416534573SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104418.69+522635.8161.077880170075870.139244307973780352.443280242645520.153651610172547911.88036032697428860.109454993109908241.82449812259221740.19161733313723656.0838870817018090.364751494680829855.7445061256616840.324657750274528313.25036427952534439.64293506983050.11037105286959559SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.077880170075870.139244307973780352.443280242645520.153651610172547911.88036032697428860.109454993109908241.82449812259221740.19161733313723656.0838870817018090.364751494680829855.7445061256616840.324657750274528313.25036427952534439.64293506983050.11037105286959559SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104435.58+523504.2161.14826311714910.0856821361033169252.584503413548880.08304296099083793.2081508782872840.108624722077658253.0652758656059740.191052892512504965.9146842712506550.20189662896690945.8184995904082090.1954165313479836279.733679238111884.644575481228740.10991691669914871SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.14826311714910.0856821361033169252.584503413548880.08304296099083793.2081508782872840.108624722077658253.0652758656059740.191052892512504965.9146842712506550.20189662896690945.8184995904082090.1954165313479836279.733679238111884.644575481228740.10991691669914871SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104436.25+524735.2161.151033854054671.219961772933623652.793126781662110.86441338720237490.35400979489424070.110114544947077560.56775682965862940.165989529164021968.6616635624964472.97975874272104326.6694171012657271.8757150060463206107.5388185886273553.671632321158980.10323095921194181SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.151033854054671.219961772933623652.793126781662110.86441338720237490.35400979489424070.110114544947077560.56775682965862940.165989529164021968.6616635624964472.97975874272104326.6694171012657271.8757150060463206107.5388185886273553.671632321158980.10323095921194181SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104444.07+511936.1161.183609384772040.2400920273529681451.3267070667762940.279646597732730151.24908192846704850.114637947139956681.49631738452052070.187783947443520957.0479895752369180.68937809703599816.1224311320963820.5272378282351275150.4644688654095726.187144033517910.11065466242143884SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.183609384772040.2400920273529681451.3267070667762940.279646597732730151.24908192846704850.114637947139956681.49631738452052070.187783947443520957.0479895752369180.68937809703599816.1224311320963820.5272378282351275150.4644688654095726.187144033517910.11065466242143884SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104459.26+522548.7161.246915769519350.1531982111004708852.430195084311130.123707725868060642.0788053730915840.110036203454288222.16317421316790840.18845115959953596.4681466528997220.361158522587704875.79434611249810950.290756868398558692.456114587751118.40876895393210.10922510409727693SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.246915769519350.1531982111004708852.430195084311130.123707725868060642.0788053730915840.110036203454288222.16317421316790840.18845115959953596.4681466528997220.361158522587704875.79434611249810950.290756868398558692.456114587751118.40876895393210.10922510409727693SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104505.08+530140.3161.271181465895841.60120913861736753.02786993298332.42427167058610940.36743524185915350.064486187616416437.1174354527683740.06773581332541503nannannannannannan0.10877009481191635SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.271181465895841.60120913861736753.02786993298332.42427167058610940.36743524185915350.064486187616416437.1174354527683740.0677358133254150331.9525613975232155.71713099110900921.836634548888693.7591099883091310.75230104347284523.928506606221910.10877009481191635SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ104509.34+514531.1161.288908997463350.321500424459251451.758650005585830.30878221599470330.70993555459379090.092713052690347230.59818377954886660.171325088117185836.0010536844424450.85993600276806335.0570166461409410.601865778949374346.1678090810189331.058285986010220.09783437417354435SP4Hetdex16N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan161.288908997463350.321500424459251451.758650005585830.30878221599470330.70993555459379090.092713052690347230.59818377954886660.171325088117185836.0010536844424450.85993600276806335.0570166461409410.601865778949374346.1678090810189331.058285986010220.09783437417354435SP4HetdexN/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
.............................................................................................................................................................................................
ILTJ152029.96+495917.8230.124848214034670.0372215120214977449.988296069723820.065060722737376168.6823169293076230.1205475055030547115.1491938005458610.287636339932718378.7491068246144950.157956776617589145.9650374822906830.0787676405783676.00011729270612.0010769034562910.12054750550305471MP227+50N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.124848214034670.0372215120214977449.988296069723820.065060722737376168.6823169293076230.1205475055030547115.1491938005458610.287636339932718378.7491068246144950.157956776617589145.9650374822906830.0787676405783676.00011729270612.0010769034562910.12054750550305471MP227+50N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152053.26+534624.4230.221912253185850.614521174432370553.7734537427271350.47881753143755891.36028236025433280.23975976297665411.85830782923663530.378679801063138377.911803611122631.54408284313147686.2197590326795130.990085945399112764.997931787543535.764869823966240.22824716870673SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.221912253185850.614521174432370553.7734537427271350.47881753143755891.36028236025433280.23975976297665411.85830782923663530.378679801063138377.911803611122631.54408284313147686.2197590326795130.990085945399112764.997931787543535.764869823966240.22824716870673SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152129.05+515755.4230.371050399871540.02564708772463751.965397958336280.0428801487182805617.3358214536118530.2118786360369995221.187417864970230.480455519883968067.08271769477003850.100998309694321915.4485436968167090.06035534345087726590.581489998384812.20133240174555360.21187863603699952MP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.371050399871540.02564708772463751.965397958336280.0428801487182805617.3358214536118530.2118786360369995221.187417864970230.480455519883968067.08271769477003850.100998309694321915.4485436968167090.06035534345087726590.581489998384812.20133240174555360.21187863603699952MP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152138.26+520831.4230.409427720722160.287656175572425652.142077370346420.190035512274812581.70001595607970520.164782885897942181.48254240523044810.30221805117161436.29222820813689050.68990830137353934.9916579020928780.42773632024198793106.1067382037390720.896226094140010.17283174383919686SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.409427720722160.287656175572425652.142077370346420.190035512274812581.70001595607970520.164782885897942181.48254240523044810.30221805117161436.29222820813689050.68990830137353934.9916579020928780.42773632024198793106.1067382037390720.896226094140010.17283174383919686SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152143.21+520106.4230.430040534296380.536896015691134552.018464265710620.46139457140893745.1437506608092470.91234876458322315.6545684897399021.54524126179004687.1074302041516741.41596819203565535.57073559582869750.8796980166224263127.2360853829723835.33401757420530.9024523315019906SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.430040534296380.536896015691134552.018464265710620.46139457140893745.1437506608092470.91234876458322315.6545684897399021.54524126179004687.1074302041516741.41596819203565535.57073559582869750.8796980166224263127.2360853829723835.33401757420530.9024523315019906SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152154.98+511925.1230.47907804741880.1959336217945920651.323661657299390.230635087241469332.3495386818729240.180720556023707042.76213241786258970.29731117884753736.7908059454678520.54345318049986396.2363941049785540.461044235402060633.420613979239259440.3483361728480.1746469351928681SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.47907804741880.1959336217945920651.323661657299390.230635087241469332.3495386818729240.180720556023707042.76213241786258970.29731117884753736.7908059454678520.54345318049986396.2363941049785540.461044235402060633.420613979239259440.3483361728480.1746469351928681SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152157.74+524715.2230.490588458208750.64320707753858952.7875702662936060.85880626769259680.71240781616917680.18151580558643090.93300668337323120.28934760677040437.4225248988298712.02382775220846246.35482372729721941.51304969507615251.29150968329520374.349042719201530.17277093138545752SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.490588458208750.64320707753858952.7875702662936060.85880626769259680.71240781616917680.18151580558643090.93300668337323120.28934760677040437.4225248988298712.02382775220846246.35482372729721941.51304969507615251.29150968329520374.349042719201530.17277093138545752SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152240.73+525728.8230.669709486341081.700668133789242952.9580010464178340.96104946540187840.73245452211210650.180033313377888362.2898198153900470.2330863826287686314.866819358519824.3205456530009437.57415419867647351.5745556939920569116.1308246758882325.128241287076110.1816209842218086SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.669709486341081.700668133789242952.9580010464178340.96104946540187840.73245452211210650.180033313377888362.2898198153900470.2330863826287686314.866819358519824.3205456530009437.57415419867647351.5745556939920569116.1308246758882325.128241287076110.1816209842218086SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152337.32+523922.7230.905502694445540.1737090603334675352.6563071969517650.156381770044155023.2221093647600010.202995778069300553.38910845860572960.34597294850493876.3462378654240890.41164541736546345.97016019367696950.3653192568938889106.8162097263524746.030688760412950.20068121375516057SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan230.905502694445540.1737090603334675352.6563071969517650.156381770044155023.2221093647600010.202995778069300553.38910845860572960.34597294850493876.3462378654240890.41164541736546345.97016019367696950.3653192568938889106.8162097263524746.030688760412950.20068121375516057SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan
ILTJ152419.22+523536.1231.08006641878880.1406754536608092552.593367743149810.119383432162872754.4612453067523760.215715394249387074.9169504542292680.36236428332632766.6042123516245550.3336712678579456.0117865616467780.2781991812644125779.9351053112189824.682909779901220.2112516958732158SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan231.08006641878880.1406754536608092552.593367743149810.119383432162872754.4612453067523760.215715394249387074.9169504542292680.36236428332632766.6042123516245550.3336712678579456.0117865616467780.2781991812644125779.9351053112189824.682909779901220.2112516958732158SP227+53N/A9999991e+201e+201e+201e+201e+201e+201e+201e+201e+201e+20nannan

In [ ]: