Find in data intersection between dispersions $\sigma$ and gas profiles $\Sigma(R)$


In [1]:
import requests
import time
from IPython.display import HTML
from IPython.display import Image
import pylab as plt
%pylab inline


Populating the interactive namespace from numpy and matplotlib
C:\Anaconda\lib\site-packages\IPython\core\magics\pylab.py:161: UserWarning: pylab import has clobbered these variables: ['plt']
`%matplotlib` prevents importing * from pylab and numpy
  "\n`%matplotlib` prevents importing * from pylab and numpy"

In [2]:
def get_ngc_page(number):
    url = 'http://leda.univ-lyon1.fr/G.cgi?n=9&c=o&o=n%s&a=html&ob=ra' % number
    response = requests.get(url)
    time.sleep(3)
    if response.ok:
        return response.content
#     else:
#         raise
        
#     try:
#         r = requests.get(url, params={'s': thing})
#     except requests.exceptions.RequestException as e:    # This is the correct syntax
#         print e
#         sys.exit(1)

In [3]:
HTML(get_ngc_page(3898))


Out[3]:
Kinematical profiles
   objname   |L|RA (B1950) Dec |  Ref  |  F  |angp |  x  |  y   |      vel      |    sig     |

NGC3898       L 114636.2+562141 HSM99   S OR  107.0   0.0    2.8    -38.0 ± 15.0 226.0 ± 20.0
HSM99 S OR 107.0 0.0 -1.8 17.0 ± 16.0 219.0 ± 19.0
HSM99 S OR 107.0 0.0 0.5 0.0 ± 14.0 226.0 ± 18.0
HSM99 S OR 107.0 0.0 -0.7 2.0 ± 18.0 219.0 ± 18.0
HSM99 S OR 107.0 0.0 6.2 -82.0 ± 16.0 194.0 ± 16.0
HSM99 S OR 107.0 0.0 -3.0 66.0 ± 17.0 224.0 ± 22.0
HSM99 S OR 107.0 0.0 -17.9 111.0 ± 18.0 141.0 ± 24.0
HSM99 S OR 107.0 0.0 24.6 -80.0 ± 30.0 235.0 ± 35.0
HSM99 S OR 107.0 0.0 20.0 103.0 ± 21.0 256.0 ± 26.0
HSM99 S OR 107.0 0.0 -13.3 110.0 ± 16.0 153.0 ± 17.0
HSM99 S OR 107.0 0.0 29.2 108.0 ± 34.0 187.0 ± 40.0
HSM99 S OR 107.0 0.0 15.4 116.0 ± 19.0 186.0 ± 21.0
HSM99 S OR 107.0 0.0 10.8 111.0 ± 15.0 166.0 ± 17.0
HSM99 S OR 107.0 0.0 -27.1 105.0 ± 21.0 146.0 ± 29.0
HSM99 S OR 107.0 0.0 -22.5 93.0 ± 23.0 169.0 ± 24.0
HSM99 S OR 107.0 0.0 1.6 -26.0 ± 17.0 217.0 ± 19.0


In [4]:
jobs = jobs_manager()

In [5]:
d1,d2,d3,d4 = [],[],[],[]

In [6]:
# %job [d1.append((x, get_ngc_page(x))) for x in log_progress(range(1, 2000))]
# %job [d2.append((x, get_ngc_page(x))) for x in log_progress(range(2000, 4000))]
# %job [d3.append((x, get_ngc_page(x))) for x in log_progress(range(4000, 6000))]
# %job [d4.append((x, get_ngc_page(x))) for x in log_progress(range(6000, 8000))]

In [7]:
# len(d1),len(d2),len(d3),len(d4)

In [8]:
# len(zip(d1,d2))

In [9]:
# data = []
# data.extend(d1)
# data.extend(d2)
# data.extend(d3)
# data.extend(d4)

In [10]:
# len(data)

In [11]:
# f = open('data.txt', 'a')
# for l in data:
#     f.write(str(l))

In [12]:
lines= None
with open('data.txt', 'r') as f:
    lines = f.readlines()[0]
    indices = []
    for ind, letter in enumerate(lines):
        if letter == '(':
            try:
                sub = lines[ind:]
                number = int(sub[1:sub.index(',')])
                indices.append(ind)
            except ValueError:
                pass

In [13]:
len(indices)


Out[13]:
7999

In [14]:
data = []
sub = None
for ind1, ind2 in zip(indices[:-1], indices[1:]):
    sub = lines[ind1:ind2]
    comma = sub.index(',')
    number = int(sub[1:comma])
    data.append((number, sub[comma:]))

In [15]:
len(data)


Out[15]:
7998

In [16]:
without = 0
for num, html in data:
    if 'Query Help' in html:
        without += 1
print len(data) - without


664

In [17]:
disp = [d for d in data if 'Query Help' not in d[1]]

In [18]:
len(disp)


Out[18]:
664

In [19]:
print disp[100][0]


1351

In [20]:
ddisp = []
for n, html in disp:
    for row in html.split('<br'):
        if row.count('&#177;') > 1: # &#177; == ±
            ddisp.append((n, html))
            break

In [21]:
len(ddisp)


Out[21]:
278

In [22]:
print ['NGC' + str(n) for (n,_) in ddisp]


['NGC80', 'NGC97', 'NGC194', 'NGC383', 'NGC410', 'NGC470', 'NGC499', 'NGC532', 'NGC584', 'NGC680', 'NGC691', 'NGC741', 'NGC742', 'NGC772', 'NGC813', 'NGC821', 'NGC890', 'NGC990', 'NGC1023', 'NGC1024', 'NGC1056', 'NGC1137', 'NGC1169', 'NGC1171', 'NGC1175', 'NGC1186', 'NGC1199', 'NGC1209', 'NGC1210', 'NGC1316', 'NGC1336', 'NGC1339', 'NGC1343', 'NGC1351', 'NGC1373', 'NGC1374', 'NGC1375', 'NGC1379', 'NGC1380', 'NGC1381', 'NGC1399', 'NGC1400', 'NGC1404', 'NGC1407', 'NGC1419', 'NGC1426', 'NGC1427', 'NGC1428', 'NGC1461', 'NGC1485', 'NGC1521', 'NGC1549', 'NGC1553', 'NGC1571', 'NGC1587', 'NGC1588', 'NGC1589', 'NGC1600', 'NGC1653', 'NGC1700', 'NGC1726', 'NGC2217', 'NGC2300', 'NGC2310', 'NGC2314', 'NGC2325', 'NGC2329', 'NGC2332', 'NGC2336', 'NGC2340', 'NGC2434', 'NGC2476', 'NGC2523', 'NGC2545', 'NGC2549', 'NGC2560', 'NGC2563', 'NGC2633', 'NGC2648', 'NGC2672', 'NGC2673', 'NGC2685', 'NGC2694', 'NGC2695', 'NGC2712', 'NGC2726', 'NGC2732', 'NGC2742', 'NGC2768', 'NGC2778', 'NGC2784', 'NGC2798', 'NGC2816', 'NGC2841', 'NGC2865', 'NGC2872', 'NGC2894', 'NGC2903', 'NGC2905', 'NGC2916', 'NGC2945', 'NGC2964', 'NGC2974', 'NGC2983', 'NGC2985', 'NGC2986', 'NGC3021', 'NGC3031', 'NGC3041', 'NGC3046', 'NGC3051', 'NGC3067', 'NGC3115', 'NGC3156', 'NGC3158', 'NGC3169', 'NGC3190', 'NGC3193', 'NGC3226', 'NGC3245', 'NGC3254', 'NGC3271', 'NGC3289', 'NGC3294', 'NGC3338', 'NGC3368', 'NGC3371', 'NGC3377', 'NGC3379', 'NGC3384', 'NGC3412', 'NGC3437', 'NGC3585', 'NGC3607', 'NGC3610', 'NGC3613', 'NGC3627', 'NGC3640', 'NGC3641', 'NGC3675', 'NGC3718', 'NGC3726', 'NGC3810', 'NGC3818', 'NGC3853', 'NGC3898', 'NGC3921', 'NGC3941', 'NGC3998', 'NGC4026', 'NGC4036', 'NGC4105', 'NGC4106', 'NGC4111', 'NGC4125', 'NGC4168', 'NGC4237', 'NGC4251', 'NGC4258', 'NGC4261', 'NGC4267', 'NGC4270', 'NGC4278', 'NGC4291', 'NGC4303', 'NGC4318', 'NGC4339', 'NGC4340', 'NGC4350', 'NGC4365', 'NGC4371', 'NGC4380', 'NGC4382', 'NGC4406', 'NGC4429', 'NGC4434', 'NGC4435', 'NGC4442', 'NGC4458', 'NGC4461', 'NGC4464', 'NGC4467', 'NGC4468', 'NGC4472', 'NGC4473', 'NGC4476', 'NGC4478', 'NGC4479', 'NGC4486', 'NGC4494', 'NGC4501', 'NGC4515', 'NGC4546', 'NGC4552', 'NGC4564', 'NGC4579', 'NGC4589', 'NGC4596', 'NGC4621', 'NGC4636', 'NGC4638', 'NGC4643', 'NGC4649', 'NGC4660', 'NGC4667', 'NGC4684', 'NGC4697', 'NGC4698', 'NGC4725', 'NGC4754', 'NGC4762', 'NGC4826', 'NGC4874', 'NGC4946', 'NGC5018', 'NGC5033', 'NGC5055', 'NGC5077', 'NGC5129', 'NGC5296', 'NGC5297', 'NGC5322', 'NGC5353', 'NGC5480', 'NGC5490', 'NGC5557', 'NGC5576', 'NGC5782', 'NGC5812', 'NGC5846', 'NGC5854', 'NGC5864', 'NGC5866', 'NGC5903', 'NGC5909', 'NGC5912', 'NGC5928', 'NGC5953', 'NGC5954', 'NGC5966', 'NGC6146', 'NGC6411', 'NGC6684', 'NGC6702', 'NGC6703', 'NGC6721', 'NGC6734', 'NGC6736', 'NGC6744', 'NGC6758', 'NGC6776', 'NGC6849', 'NGC6958', 'NGC6962', 'NGC6964', 'NGC7079', 'NGC7135', 'NGC7177', 'NGC7284', 'NGC7285', 'NGC7331', 'NGC7332', 'NGC7391', 'NGC7448', 'NGC7454', 'NGC7457', 'NGC7507', 'NGC7562', 'NGC7606', 'NGC7619', 'NGC7626', 'NGC7660', 'NGC7678', 'NGC7727', 'NGC7768', 'NGC7778', 'NGC7785', 'NGC7796']

In [23]:
ddisp[0][1]


Out[23]:
', \'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\\n<html>\\n <head>\\n <title>Kinematical profiles</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />\\n <link rel="stylesheet" type="text/css" href="common.css" />\\n <base target="_top" />\\n <script>var pleinpot_version=\\\'8.12.2\\\'; var table_description=\\\'Kinematical profiles\\\';var table_name=\\\'a009\\\'</script>\\n </head>\\n <body>\\n<PRE><br /><a href="G.cgi?c=m&f=f&o=search&p=[cat.ident=NGC0080]">NGC0080</a>       <a href="javascript:L(\\\'NGC0080\\\')">L</a> <a href="javascript:D(\\\'001834.7+220448\\\')">001834.7+220448</a> <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   -4.4    -13.0 &#177; 42.0 212.0 &#177; 22.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   -9.0    -11.0 &#177; 37.0 249.0 &#177; 42.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0    8.2      7.0 &#177; 49.0 223.0 &#177; 24.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   -1.0    -13.0 &#177; 17.0 220.0 &#177; 41.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0    1.3      0.0 &#177; 23.0 234.0 &#177; 17.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0    0.2      5.0 &#177; 22.0 221.0 &#177; 16.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0    3.6     14.0 &#177; 18.0 234.0 &#177; 17.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0  -18.2      1.0 &#177; 51.0 141.0 &#177; 77.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0  -13.6    -32.0 &#177; 45.0 231.0 &#177; 53.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   -2.2     -9.0 &#177; 20.0 231.0 &#177; 21.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   17.4     -5.0 &#177; 82.0 155.0 &#177; 70.0<br />                                <a href="B.cgi?n=9&b=SP98" target="kin02">SP98</a>    S OR  180.0   0.0   12.8    -20.0 &#177; 56.0 236.0 &#177; 66.0</PRE><hr class="frsep"/>\\n<h2>Further options on this selection</h2>\\n<ul>\\n<a href="fG.cgi?n=9&c=o&o=n80&a=html&z=d|r&ob=ra&d=$objname,$b1950,$link[dataset],param,angp,x,y,$field[vel],$field[sig]&z=s">Statistics</a><br><form name="f" action="./" onsubmit=return false>Search in a box of <input name="r" value="10" size="8" type="text">arcmin around <tt>n80</tt> <input type="button" value="submit" onclick=top.location="fG.cgi?n=9&c=o&p=n80&f="+document.f.r.value></form></ul>\\n<hr class="frsep"/>\\n<table width="100%">\\n<tr>\\n<td align="left">\\nKinematical profiles\\n</td>\\n<td align="right">Pleinpot: 8.12.2</td></tr>\\n<tr><td align="left" >Remember to <a href="acknowledge.html">acknowledge HyperLeda</a></td>\\n<td align="right"><i>Questions: <a href="mailto:leda@univ-lyon1.fr">leda@univ-lyon1.fr</a>\\n</i></td>\\n</tr>\\n</body>\\n</html>\\n\')'

In [24]:
troubled = []
for n, html in ddisp:
    good = True
    for r in html.split('<br'):
        if '</a>' in r and '&#177;' in r:
            row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
            if row.strip():
                if len(row.split(' ')) != 9:
                    good = False
#                     print len(row.split(' '))
#                     print row
    if not good:
        troubled.append(n)
        print 'NGC'+str(n)


NGC1461
NGC2336
NGC2648
NGC2672
NGC2673
NGC2742
NGC2816
NGC2964
NGC3169
NGC3294
NGC3437
NGC4237
NGC4303
NGC4380
NGC4435
NGC4501
NGC4579
NGC4698
NGC5480
NGC5782
NGC5866
NGC5909
NGC5912
NGC6962
NGC7448
NGC7606

In [25]:
len(troubled)


Out[25]:
26

In [26]:
html = ddisp[0][1]
xx, rr, sigs, esigs = [],[],[],[]
for r in html.split('<br'):
    if '</a>' in r and '&#177;' in r:
        row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
        if row.strip():
            _,_,_,x,y,vel,evel,sig,esig = row.split(' ')
            rr.append(float(y))
            xx.append(x)
            sigs.append(float(sig))
            esigs.append(float(esig))

In [27]:
dd = zip(rr, sigs, esigs)
dd = sorted(dd)
rr, sigs, esigs = zip(*dd)

In [28]:
plt.errorbar(rr, sigs, yerr=esigs)
plt.title('NGC x={}'.format(str(unique(xx))))
plt.show()



In [29]:
%%time
for n, html in ddisp:
    if n not in troubled:
        xx, rr, sigs, esigs = [],[],[],[]
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip():
                    _,_,_,x,y,vel,evel,sig,esig = row.split(' ')
                    rr.append(float(y))
                    xx.append(x)
                    sigs.append(float(sig))
                    esigs.append(float(esig))
        dd = zip(rr, sigs, esigs)
        dd = sorted(dd)
        rr, sigs, esigs = zip(*dd)
        plt.errorbar(rr, sigs, yerr=esigs)
        plt.title('NGC{} x={}'.format(str(n), str(unique(xx))))
        plt.show()


Wall time: 35.1 s

In [30]:
good = [7332, 7331, 6958, 6703, 5353, 5033, 4762, 4667, 4638, 4621, 4552, 4429, 4350, 4278, 4251, 4111, 4106, 
        4036, 4026, 3998, 3941, 3627, 3412, 3384, 3379, 3371, 3190, 2974, 2945, 2560, 2217, 1404, 1399, 1381, 
        1380, 1374, 1339, 1209, 1175, 1023, 584 ]

In [31]:
len(good)


Out[31]:
41

In [32]:
for n, html in ddisp:
    if n in troubled:
        xx, rr, sigs, esigs = [],[],[],[]
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip() and len(row.split()) == 9:
                    _,_,_,x,y,vel,evel,sig,esig = row.split(' ')
                    rr.append(float(y))
                    xx.append(x)
                    sigs.append(float(sig))
                    esigs.append(float(esig))
        dd = zip(rr, sigs, esigs)
        dd = sorted(dd)
        rr, sigs, esigs = zip(*dd)
        plt.errorbar(rr, sigs, yerr=esigs)
        plt.title('NGC{} x={}'.format(str(n), str(unique(xx))))
        plt.show()



In [33]:
good_troubled = [1461, 2648, 4579, 4501, 4435, 2673]

In [34]:
all_good = good
all_good.extend(good_troubled)
len(all_good)


Out[34]:
47

In [35]:
sources = []
for n, html in ddisp:
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip() and len(row.split()) == 9:
                    sources.append(r[r.index('kin02">')+7:r.rfind('<')])
                    
unique(sources)


Out[35]:
array(['BBB94', 'BBD91', 'BG97', 'BLR96', 'BN90', 'BSG94', 'Bon+95',
       'DBVZ96', 'Don+95', 'F97', 'GCB98', 'HS98', 'HSM99', 'LRB98',
       'Lon+94', 'RRSM95', 'SP97a', 'SP97b', 'SP97c', 'SP98'], 
      dtype='|S6')

In [36]:
sources = []
for n, html in ddisp:
       if n in all_good:     
            for r in html.split('<br'):
                if '</a>' in r and '&#177;' in r:
                    row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                    if row.strip() and len(row.split()) == 9:
                        sources.append(r[r.index('kin02">')+7:r.rfind('<')])
                    
unique(sources)


Out[36]:
array(['BG97', 'BSG94', 'Bon+95', 'Don+95', 'F97', 'GCB98', 'HS98',
       'LRB98', 'Lon+94', 'SP97a', 'SP97b', 'SP97c', 'SP98'], 
      dtype='|S6')

In [37]:
for n, html in ddisp:
    if n in all_good:
        sources = []
        ang,xx, rr, sigs, esigs = [],[],[],[],[]
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip() and len(row.split()) == 9:
                    _,_,a,x,y,vel,evel,sig,esig = row.split(' ')
                    sources.append(r[r.index('kin02">')+7:r.rfind('<')])
                    rr.append(float(y))
                    xx.append(x)
                    sigs.append(float(sig))
                    esigs.append(float(esig))
                    ang.append(a)
        dd = zip(ang, rr, sigs, esigs)
        for a in unique(ang):
            dda = [(d[1],d[2],d[3]) for d in dd if d[0] == a]
            dda = sorted(dda)
            rr, sigs, esigs = zip(*dda)
            plt.errorbar(rr, sigs, yerr=esigs)
        plt.title('NGC{}\n x={} ang={} s={}'.format(str(n), str(unique(xx)), str(unique(ang)), str(unique(sources))))
        plt.show()


UGC


In [38]:
def get_ugc_page(number):
    url = 'http://leda.univ-lyon1.fr/G.cgi?n=9&c=o&o=u%s&a=html&ob=ra' % number
    try:
        response = requests.get(url)
        time.sleep(3)
        if response.ok:
            return response.content
    except requests.ConnectionError:
        return ''

In [39]:
HTML(get_ugc_page(688))


Out[39]:
Kinematical profiles

In [40]:
jobs = jobs_manager()

In [41]:
# u1,u2,u3,u4,u5,u6 = [],[],[],[],[],[]

In [42]:
# start = time.time()
# %job [u1.append((x, get_ugc_page(x))) for x in log_progress(range(1, 2000))]
# %job [u2.append((x, get_ugc_page(x))) for x in log_progress(range(2000, 4000))]
# %job [u3.append((x, get_ugc_page(x))) for x in log_progress(range(4000, 6000))]
# %job [u4.append((x, get_ugc_page(x))) for x in log_progress(range(6000, 8000))]
# %job [u5.append((x, get_ugc_page(x))) for x in log_progress(range(8000, 10000))]
# %job [u6.append((x, get_ugc_page(x))) for x in log_progress(range(10000, 13000))]

In [43]:
# %job [u1.append((x, get_ugc_page(x))) for x in log_progress(range(910, 2000))]
# %job [u2.append((x, get_ugc_page(x))) for x in log_progress(range(2891, 4000))]

In [44]:
# jobs.running

In [45]:
# len(u1),len(u2),len(u3),len(u4),len(u5), len(u6)

In [46]:
# data = []
# data.extend(u1)
# data.extend(u2)
# data.extend(u3)
# data.extend(u4)
# data.extend(u5)
# data.extend(u6)

In [47]:
# data[0]

In [48]:
# f = open('udata.txt', 'a')
# for l in data:
#     f.write(str(l))

In [49]:
lines= None
with open('udata.txt', 'r') as f:
    lines = f.readlines()[0]
    indices = []
    for ind, letter in enumerate(lines):
        if letter == '(':
            try:
                sub = lines[ind:]
                number = int(sub[1:sub.index(',')])
                indices.append(ind)
            except ValueError:
                pass

In [50]:
len(indices)


Out[50]:
14360

In [51]:
udata = []
sub = None
nums = set()
for ind1, ind2 in zip(indices[:-1], indices[1:]):
    sub = lines[ind1:ind2]
    comma = sub.index(',')
    number = int(sub[1:comma])
#     if number in nums:
#         pass
#     else:
#         nums.add(number)
    udata.append((number, sub[comma:]))

In [52]:
len(udata)


Out[52]:
14359

In [53]:
without = 0
for num, html in udata:
    if 'Query Help' in html:
        without += 1
print len(udata) - without


952

In [54]:
disp = [d for d in udata if 'Query Help' not in d[1]]

In [55]:
len(disp)


Out[55]:
952

In [56]:
print disp[100][0]


1697

In [57]:
disp[51]


Out[57]:
(1056, ', ')

In [58]:
uddisp = {}
for index, (n, html) in enumerate(disp):
    if type(html) != tuple:
        for row in html.split('<br'):
            if row.count('&#177;') > 1: # &#177; == ±
                uddisp[n] = html
                break

In [59]:
len(uddisp)


Out[59]:
201

In [60]:
print ['UGC' + str(n) for n in uddisp.keys()]


['UGC7613', 'UGC8709', 'UGC12294', 'UGC4106', 'UGC4619', 'UGC4620', 'UGC12305', 'UGC12306', 'UGC7701', 'UGC4271', 'UGC5663', 'UGC12464', 'UGC7203', 'UGC12806', 'UGC2089', 'UGC3677', 'UGC9778', 'UGC5685', 'UGC6712', 'UGC4666', 'UGC5183', 'UGC9740', 'UGC7760', 'UGC3153', 'UGC11354', 'UGC11356', 'UGC1466', 'UGC2142', 'UGC1631', 'UGC11872', 'UGC10916', 'UGC4708', 'UGC12841', 'UGC2154', 'UGC8813', 'UGC3695', 'UGC3696', 'UGC3699', 'UGC7796', 'UGC7797', 'UGC9847', 'UGC5753', 'UGC6787', 'UGC5253', 'UGC2183', 'UGC3720', 'UGC11628', 'UGC10379', 'UGC4750', 'UGC7315', 'UGC7828', 'UGC8307', 'UGC6297', 'UGC5280', 'UGC12827', 'UGC8423', 'UGC7878', 'UGC6823', 'UGC7338', 'UGC4779', 'UGC6319', 'UGC9904', 'UGC689', 'UGC7858', 'UGC6323', 'UGC5303', 'UGC7353', 'UGC9903', 'UGC4287', 'UGC7360', 'UGC5826', 'UGC9923', 'UGC5318', 'UGC7880', 'UGC6857', 'UGC6346', 'UGC203', 'UGC7373', 'UGC3792', 'UGC4818', 'UGC4821', 'UGC3798', 'UGC7895', 'UGC216', 'UGC4313', 'UGC7386', 'UGC735', 'UGC6368', 'UGC3809', 'UGC6370', 'UGC7397', 'UGC5351', 'UGC4840', 'UGC7914', 'UGC12523', 'UGC7970', 'UGC4337', 'UGC12531', 'UGC3828', 'UGC8949', 'UGC8745', 'UGC5882', 'UGC4347', 'UGC7420', 'UGC1286', 'UGC7118', 'UGC5899', 'UGC5902', 'UGC7951', 'UGC7446', 'UGC5911', 'UGC1305', 'UGC7898', 'UGC1823', 'UGC6946', 'UGC7461', 'UGC6439', 'UGC4905', 'UGC7467', 'UGC7473', 'UGC12594', 'UGC7646', 'UGC6537', 'UGC6973', 'UGC7989', 'UGC5952', 'UGC9026', 'UGC7493', 'UGC2374', 'UGC7619', 'UGC6985', 'UGC8010', 'UGC7376', 'UGC7503', 'UGC8016', 'UGC12113', 'UGC12115', 'UGC7508', 'UGC8334', 'UGC858', 'UGC7005', 'UGC7773', 'UGC9058', 'UGC4966', 'UGC5995', 'UGC7532', 'UGC11629', 'UGC2792', 'UGC2933', 'UGC6524', 'UGC8062', 'UGC5503', 'UGC7488', 'UGC9602', 'UGC1413', 'UGC5511', 'UGC2953', 'UGC7575', 'UGC7568', 'UGC7571', 'UGC5525', 'UGC407', 'UGC5018', 'UGC926', 'UGC7583', 'UGC7585', 'UGC12614', 'UGC8103', 'UGC12211', 'UGC5559', 'UGC5562', 'UGC4541', 'UGC7103', 'UGC5056', 'UGC7610', 'UGC2503', 'UGC9161', 'UGC7628', 'UGC7629', 'UGC2510', 'UGC7631', 'UGC2515', 'UGC7637', 'UGC982', 'UGC5079', 'UGC2521', 'UGC7645', 'UGC4574', 'UGC9183', 'UGC9723', 'UGC7654', 'UGC9706', 'UGC7662', 'UGC5103', 'UGC5617', 'UGC6644', 'UGC3063', 'UGC3064', 'UGC3065', 'UGC7675', 'UGC9726']

In [61]:
whisp_url = 'http://www.astro.rug.nl/~whisp/Database/OverviewCatalog/ListByName/listing_by_name.html'
html = requests.get(whisp_url).content

In [62]:
from BeautifulSoup import BeautifulSoup

In [63]:
soup = BeautifulSoup(html)

In [64]:
# soup.findAll('a', target="_top")

In [65]:
whisp_galaxies = []
for gal in soup.findAll('a', target="_top")[2:]:
    g = str(gal.string)
    whisp_galaxies.append(int(g.replace('/', ' ').replace('(', ' ').replace('\x08', ' ').split(' ')[2]))

In [66]:
len(unique(whisp_galaxies))


Out[66]:
342

In [67]:
print whisp_galaxies


[79, 89, 94, 192, 232, 485, 499, 508, 528, 608, 622, 623, 624, 624, 625, 655, 690, 718, 731, 798, 1013, 1178, 1249, 1256, 1281, 1286, 1305, 1310, 1313, 1317, 1437, 1437, 1501, 1541, 1550, 1633, 1810, 1856, 1886, 1913, 1993, 2023, 2034, 2045, 2053, 2065, 2069, 2080, 2082, 2141, 2141, 2154, 2183, 2193, 2455, 2459, 2459, 2487, 2487, 2487, 2491, 2503, 2800, 2855, 2866, 2916, 2916, 2916, 2941, 2941, 2942, 2953, 3013, 3137, 3205, 3205, 3205, 3205, 3273, 3326, 3334, 3344, 3354, 3371, 3382, 3382, 3384, 3384, 3407, 3407, 3407, 3407, 3422, 3426, 3426, 3546, 3546, 3574, 3580, 3642, 3642, 3660, 3685, 3698, 3698, 3698, 3711, 3734, 3740, 3759, 3817, 3826, 3851, 3909, 3965, 3966, 3992, 3993, 4036, 4165, 4173, 4256, 4273, 4274, 4278, 4284, 4305, 4325, 4458, 4458, 4483, 4499, 4543, 4605, 4637, 4666, 4666, 4701, 4806, 4838, 4862, 5060, 5060, 5079, 5251, 5253, 5272, 5316, 5351, 5414, 5446, 5452, 5459, 5532, 5556, 5557, 5559, 5582, 5538, 5589, 5614, 5685, 5717, 5721, 5786, 5789, 5829, 5840, 5846, 5906, 5909, 5918, 5927, 5935, 5960, 5982, 5986, 5997, 6001, 6016, 6024, 6118, 6126, 6128, 6161, 6225, 6251, 6263, 6283, 6446, 6456, 6537, 6621, 6628, 6713, 6733, 6742, 6778, 6786, 6787, 6787, 6791, 6797, 6813, 6815, 6816, 6817, 6833, 6840, 6856, 6869, 6870, 6880, 6884, 6917, 6921, 6922, 6923, 6930, 6937, 6940, 6944, 6956, 6964, 6969, 7030, 7047, 7075, 7081, 7089, 7090, 7094, 7095, 7125, 7151, 7154, 7166, 7183, 7183, 7199, 7204, 7222, 7232, 7256, 7261, 7278, 7321, 7323, 7329, 7353, 7353, 7387, 7399, 7408, 7483, 7489, 7490, 7506, 7506, 7524, 7559, 7577, 7584, 7592, 7599, 7603, 7608, 7651, 7690, 7704, 7766, 7774, 7774, 7831, 7853, 7861, 7866, 7916, 7917, 7949, 7971, 7989, 7989, 8146, 8188, 8201, 8246, 8254, 8271, 8271, 8271, 8271, 8286, 8303, 8314, 8331, 8396, 8403, 8490, 8508, 8550, 8651, 8683, 8699, 8700, 8709, 8711, 8805, 8837, 8863, 8900, 9018, 9128, 9133, 9211, 9242, 9366, 9431, 9632, 9642, 9644, 9648, 9649, 9753, 9797, 9805, 9858, 9969, 9992, 10227, 10310, 10359, 10445, 10448, 10470, 10497, 10502, 10546, 10564, 10713, 10757, 10769, 10791, 10791, 10791, 10791, 10897, 11124, 11670, 11218, 11269, 11283, 11283, 11300, 11429, 11466, 11496, 11557, 11707, 11852, 11861, 11864, 11891, 11909, 11914, 11951, 11951, 11994, 12043, 12060, 12082, 12212, 12276, 12554, 12632, 12693, 12713, 12732, 12754, 12808, 12815]

Intersection


In [68]:
intersect = set(uddisp.keys()).intersection(unique(whisp_galaxies))

In [69]:
len(intersect)


Out[69]:
17

In [70]:
print list(intersect)


[6537, 6787, 5253, 1286, 2503, 2953, 2154, 2183, 8709, 7353, 7989, 5685, 5079, 1305, 4666, 5559, 5351]

In [71]:
for n in sorted(uddisp.keys()):
    html = uddisp[n]
    if n in list(intersect):
        sources = []
        ang,xx, rr, sigs, esigs = [],[],[],[],[]
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip() and len(row.split()) == 9:
                    _,_,a,x,y,vel,evel,sig,esig = row.split(' ')
                    sources.append(r[r.index('kin02">')+7:r.rfind('<')])
                    rr.append(float(y))
                    xx.append(x)
                    sigs.append(float(sig))
                    esigs.append(float(esig))
                    ang.append(a)
        dd = zip(ang, rr, sigs, esigs)
        for a in unique(ang):
            dda = [(d[1],d[2],d[3]) for d in dd if d[0] == a]
            dda = sorted(dda)
            rr, sigs, esigs = zip(*dda)
            plt.errorbar(rr, sigs, yerr=esigs)
        plt.title('UGC{}\n x={} ang={} s={}'.format(str(n), str(unique(xx)), str(unique(ang)), str(unique(sources))))
        plt.show()


  • UGC 2154 = NGC 1023
  • UGC 4666 = NGC 2685
  • UGC 5559 = NGC 3190
  • UGC 1286 = NGC 0680
  • UGC 7989 = NGC 4725

In [72]:
kenn_2001 = [628, 925, 2403, 2841, 2903, 3031, 4178, 4254, 4321, 4394, 4402, 4501, 4535, 4548, 4569, 4571, 4579, 4639, 4647, 
             4651, 4654, 4689, 4698, 4713, 4736, 4826, 5055, 5194, 5236, 5457, 6946, 7331]

Walter 2008 data https://arxiv.org/pdf/0810.2541v1.pdf and https://arxiv.org/pdf/0810.2556v1.pdf (которая на самом деле Bigiel, F.; Leroy, A, ... 2008)


In [73]:
walter_2008 = ['u8024', 'u5139', 'u4305', 'u5666', 'n4114', 'n2976', 'n4449', 'n3077', 'n7793', 'n925', 'n2403', 'n628', 
               'n3198', 'n3184', 'n4736', 'n3351', 'n6946', 'n3627', 'n5194', 'n3521', 'n2841', 'n5055', 'n7331']

In [74]:
katkov = ['i875', 'i1502', 'n16', 'n2350', 'n3098', 'n3248', 'n6615', 'n6654', 'n6798', 'n7351', 'u4551', 'u9519', 
          'i1608', 'i4653', 'n1211', 'n2917', 'n3375', 'n4240', 'n6010', 'n7693', 'u9980',
         'n4111', 'n4710', 'n5422',
         'n1167', 'n4150', 'n6340', 'n2273', 'n338', 'n3245', 'n5440']

In [75]:
warmels_1988 = ['n4116', 'n4152', 'n4178', 'n4189', 'n4192', 'n4206', 'n4216', 'n4222', 'n4254', 'n4294', 'n4299', 'n4303',
               'n4321', 'i3258', 'n4351', 'n4388', 'n4394', 'n4402', 'n4413', 'n4498', 'n4501', 'n4519', 'n4535', 'n4548',
               'n4561', 'n4569', 'n4571', '4579', 'n4639', 'n4647', 'n4651', ' n4654', 'n4689', 'n4698', 'n4713', 'n4900']

Get NGC and UGC number from NED


In [76]:
ned_url = 'http://ned.ipac.caltech.edu/cgi-bin/objsearch?objname=%s&extend=no&hconst=73&omegam=0.27&omegav=0.73&corr_z=1&\
ut_csys=Equatorial&out_equinox=J2000.0&obj_sort=RA+or+Longitude&of=pre_text&zv_breaker=30000.0&list_limit=5&img_stamp=YES'

In [77]:
ned_url


Out[77]:
'http://ned.ipac.caltech.edu/cgi-bin/objsearch?objname=%s&extend=no&hconst=73&omegam=0.27&omegav=0.73&corr_z=1&ut_csys=Equatorial&out_equinox=J2000.0&obj_sort=RA+or+Longitude&of=pre_text&zv_breaker=30000.0&list_limit=5&img_stamp=YES'

In [78]:
def get_ugc_number(objname):
    html = requests.get(ned_url % objname).content
    soup = BeautifulSoup(html)
    a_tag = soup.find('a', href = '/cgi-bin/catdef?prefix=UGC')
    if a_tag:
        return int(a_tag.parent.text.split(' ')[0][3:])
    return None

In [79]:
get_ugc_number('n338')


Out[79]:
624

In [80]:
print get_ugc_number('i1608')


None

In [81]:
def get_ngc_number(objname):
    html = requests.get(ned_url % objname).content
    soup = BeautifulSoup(html)
    a_tag = soup.find('a', href = '/cgi-bin/catdef?prefix=NGC')
    if a_tag:
        return int(a_tag.parent.text[3:])
    return None

In [82]:
get_ngc_number('u624')


Out[82]:
338

Global intersection

NGC vs WHISP


In [83]:
start = time.time()
ngc_to_ugc = [get_ugc_number('n'+str(d)) for (d,_) in ddisp]
print time.time()-start


512.526000023

In [84]:
intersect = set(ngc_to_ugc).intersection(unique(whisp_galaxies))

In [85]:
len(intersect)


Out[85]:
16

In [86]:
print sorted(list(intersect))


[1286, 1305, 2154, 2183, 2503, 4666, 5079, 5253, 5351, 5559, 5685, 6537, 6787, 7353, 7989, 8709]

was [6537, 6787, 5253, 1286, 2503, 2953, 2154, 2183, 8709, 7353, 7989, 5685, 5079, 1305, 4666, 5559, 5351]

Test that every good in NGC exist in UGC


In [87]:
ugc_to_ngc = [get_ngc_number('u'+str(d)) for d in uddisp.keys()]

In [88]:
missed = []
for u, d in zip(ngc_to_ugc, ddisp):
    if u not in uddisp.keys():
        missed.append('n' + str(d))
        print u, d[0]
missed.append('u4674')


None 584
None 813
None 1199
None 1209
None 1210
None 1316
None 1336
None 1339
None 1351
None 1373
None 1374
None 1375
None 1379
None 1380
None 1381
None 1399
None 1400
None 1404
None 1407
None 1419
None 1426
None 1427
None 1428
None 1461
None 1521
None 1549
None 1553
None 1571
None 1600
None 1700
None 1726
None 2217
None 2310
None 2325
None 2434
4674 2694
None 2695
None 2784
None 2865
None 2945
None 2974
None 2983
None 2986
None 3046
None 3051
None 3115
None 3271
None 3289
None 3585
None 3818
None 4105
None 4106
None 4467
None 4546
None 4697
None 4946
None 5018
None 5077
None 5296
None 5812
None 5903
None 5912
None 6684
None 6721
None 6734
None 6736
None 6744
None 6758
None 6776
None 6849
None 6958
None 7079
None 7135
None 7284
None 7285
None 7507
None 7606
None 7727
None 7796

In [89]:
len(missed)


Out[89]:
80

In [90]:
joindis = uddisp.keys()
joindis.extend(missed)
print len(joindis)


281

NGC/UGC vs Walter


In [91]:
ngc_to_ugc_walter = [get_ugc_number(d) for d in walter_2008]

In [92]:
print zip(ngc_to_ugc_walter, walter_2008)


[(8024, 'u8024'), (5139, 'u5139'), (4305, 'u4305'), (5666, 'u5666'), (None, 'n4114'), (5221, 'n2976'), (7592, 'n4449'), (5398, 'n3077'), (None, 'n7793'), (1913, 'n925'), (3918, 'n2403'), (1149, 'n628'), (5572, 'n3198'), (5557, 'n3184'), (7996, 'n4736'), (5850, 'n3351'), (11597, 'n6946'), (6346, 'n3627'), (8493, 'n5194'), (6150, 'n3521'), (4966, 'n2841'), (8334, 'n5055'), (12113, 'n7331')]

In [93]:
walter_2008_u = ['u'+str(d[0]) if d[0] else d[1] for d in zip(ngc_to_ugc_walter, walter_2008)]
print walter_2008_u


['u8024', 'u5139', 'u4305', 'u5666', 'n4114', 'u5221', 'u7592', 'u5398', 'n7793', 'u1913', 'u3918', 'u1149', 'u5572', 'u5557', 'u7996', 'u5850', 'u11597', 'u6346', 'u8493', 'u6150', 'u4966', 'u8334', 'u12113']

In [94]:
intersect = set(joindis).intersection(unique(walter_2008_u))

In [95]:
len(intersect)


Out[95]:
0

In [96]:
print list(intersect)


[]

NGC/UGC vs Kennicutt


In [97]:
kenn_u = [get_ugc_number('n'+str(d)) for d in kenn_2001]

In [98]:
print zip(kenn_u, kenn_2001)


[(1149, 628), (1913, 925), (3918, 2403), (4966, 2841), (5079, 2903), (5318, 3031), (7215, 4178), (7345, 4254), (7450, 4321), (7523, 4394), (7528, 4402), (7675, 4501), (7727, 4535), (7753, 4548), (7786, 4569), (7788, 4571), (7796, 4579), (7884, 4639), (7896, 4647), (7901, 4651), (7902, 4654), (7965, 4689), (7970, 4698), (7985, 4713), (7996, 4736), (8062, 4826), (8334, 5055), (8493, 5194), (None, 5236), (8981, 5457), (11597, 6946), (12113, 7331)]

In [99]:
kenn_2001_u = ['u'+str(d[0]) if d[0] else 'n'+str(d[1]) for d in zip(kenn_u, kenn_2001)]
print kenn_2001_u


['u1149', 'u1913', 'u3918', 'u4966', 'u5079', 'u5318', 'u7215', 'u7345', 'u7450', 'u7523', 'u7528', 'u7675', 'u7727', 'u7753', 'u7786', 'u7788', 'u7796', 'u7884', 'u7896', 'u7901', 'u7902', 'u7965', 'u7970', 'u7985', 'u7996', 'u8062', 'u8334', 'u8493', 'n5236', 'u8981', 'u11597', 'u12113']

In [100]:
intersect = set(joindis).intersection(kenn_2001_u)

In [101]:
len(intersect)


Out[101]:
0

NGC/UGC vs Warmels


In [102]:
ngc_to_ugc_warmels = [get_ugc_number(d) for d in warmels_1988]

In [103]:
print zip(ngc_to_ugc_warmels, warmels_1988)


[(7111, 'n4116'), (7169, 'n4152'), (7215, 'n4178'), (7235, 'n4189'), (7231, 'n4192'), (7260, 'n4206'), (7284, 'n4216'), (7291, 'n4222'), (7345, 'n4254'), (7407, 'n4294'), (7414, 'n4299'), (7420, 'n4303'), (7450, 'n4321'), (7470, 'i3258'), (7476, 'n4351'), (7520, 'n4388'), (7523, 'n4394'), (7528, 'n4402'), (7538, 'n4413'), (7669, 'n4498'), (7675, 'n4501'), (7709, 'n4519'), (7727, 'n4535'), (7753, 'n4548'), (7768, 'n4561'), (7786, 'n4569'), (7788, 'n4571'), (None, '4579'), (7884, 'n4639'), (7896, 'n4647'), (7901, 'n4651'), (7902, ' n4654'), (7965, 'n4689'), (7970, 'n4698'), (7985, 'n4713'), (8116, 'n4900')]

In [104]:
warmels_1988_u = ['u'+str(d[0]) if d[0] else d[1] for d in zip(ngc_to_ugc_warmels, warmels_1988)]
print warmels_1988_u


['u7111', 'u7169', 'u7215', 'u7235', 'u7231', 'u7260', 'u7284', 'u7291', 'u7345', 'u7407', 'u7414', 'u7420', 'u7450', 'u7470', 'u7476', 'u7520', 'u7523', 'u7528', 'u7538', 'u7669', 'u7675', 'u7709', 'u7727', 'u7753', 'u7768', 'u7786', 'u7788', '4579', 'u7884', 'u7896', 'u7901', 'u7902', 'u7965', 'u7970', 'u7985', 'u8116']

In [105]:
intersect = set(joindis).intersection(warmels_1988_u)

In [106]:
len(intersect)


Out[106]:
0

Katkov vs WHISP


In [107]:
ngc_to_ugc_k = [get_ugc_number(d) for d in katkov]

In [108]:
print zip(ngc_to_ugc_k, katkov)


[(8355, 'i875'), (12105, 'i1502'), (80, 'n16'), (3747, 'n2350'), (5397, 'n3098'), (5669, 'n3248'), (11196, 'n6615'), (11238, 'n6654'), (11434, 'n6798'), (None, 'n7351'), (4551, 'u4551'), (9519, 'u9519'), (None, 'i1608'), (None, 'i4653'), (2545, 'n1211'), (5098, 'n2917'), (None, 'n3375'), (None, 'n4240'), (10081, 'n6010'), (None, 'n7693'), (9980, 'u9980'), (7103, 'n4111'), (7980, 'n4710'), (8935, 'n5422'), (2487, 'n1167'), (7165, 'n4150'), (10762, 'n6340'), (3546, 'n2273'), (624, 'n338'), (5663, 'n3245'), (8963, 'n5440')]

In [109]:
katkov_u = ['u'+str(d[0]) if d[0] else d[1] for d in zip(ngc_to_ugc_k, katkov)]
print katkov_u


['u8355', 'u12105', 'u80', 'u3747', 'u5397', 'u5669', 'u11196', 'u11238', 'u11434', 'n7351', 'u4551', 'u9519', 'i1608', 'i4653', 'u2545', 'u5098', 'n3375', 'n4240', 'u10081', 'n7693', 'u9980', 'u7103', 'u7980', 'u8935', 'u2487', 'u7165', 'u10762', 'u3546', 'u624', 'u5663', 'u8963']

In [110]:
intersect = set(katkov_u).intersection(unique(['u'+str(d) for d in whisp_galaxies]))

In [111]:
len(intersect)


Out[111]:
3

In [112]:
print list(intersect)


['u2487', 'u624', 'u3546']

= n1167, n338, n2273

Katkov vs Walter


In [113]:
intersect = set(katkov_u).intersection(unique(walter_2008_u))

In [114]:
len(intersect)


Out[114]:
0

In [115]:
print list(intersect)


[]

Katkov vs Warmels


In [116]:
intersect = set(katkov_u).intersection(warmels_1988_u)

In [117]:
len(intersect)


Out[117]:
0

In [118]:
print list(intersect)


[]

Katkov vs Kennicutt


In [119]:
intersect = set(katkov_u).intersection(kenn_2001_u)

In [120]:
len(intersect)


Out[120]:
0

Star Formation and Gas Accretion in Nearby Galaxies**

Kijeong Yim and J. M. van der Hulst

https://arxiv.org/pdf/1608.06735v1.pdf


In [121]:
hulst2016 = ['u1913', 'u2455', 'u3334', 'u3851', 'u4165', 'u4274', 'u4305', 'u4862', 'u5079', 'u5532', 'u5557', 'u5789', 'u5840', 'u6537', 'u6856', 'u6869', 'u7030', 'u7166', 'u7256', 'u7278', 'u7323', 'u7353', 'u7524', 'u7651', 'u7766', 'u7831', 'u7853', 'u7989', 'u12754']

vs Katkov:


In [122]:
intersect = set(katkov_u).intersection(hulst2016)

In [123]:
len(intersect)


Out[123]:
0

vs HYPERLEDA:


In [124]:
intersect = set(['u'+str(l) for l in joindis]).intersection(hulst2016)

In [125]:
len(intersect)


Out[125]:
4

In [126]:
print intersect


set(['u6537', 'u7353', 'u5079', 'u7989'])

In [127]:
for obj in intersect:
    print obj, '= n'+str(get_ngc_number(obj))


u6537 = n3726
u7353 = n4258
u5079 = n2903
u7989 = n4725

In [128]:
disp_data_for_hulst = []

for n in sorted(uddisp.keys()):
    html = uddisp[n]
    if n in [int(l[1:]) for l in intersect]:
        sources = []
        ang,xx, rr, sigs, esigs = [],[],[],[],[]
        for r in html.split('<br'):
            if '</a>' in r and '&#177;' in r:
                row = ' '.join(r[r.rfind('>')+1:].replace('&#177;', ' ').split())
                if row.strip() and len(row.split()) == 9:
                    _,_,a,x,y,vel,evel,sig,esig = row.split(' ')
                    sources.append(r[r.index('kin02">')+7:r.rfind('<')])
                    rr.append(float(y))
                    xx.append(x)
                    sigs.append(float(sig))
                    esigs.append(float(esig))
                    ang.append(a)
        dd = zip(ang, rr, sigs, esigs)
        for a in unique(ang):
            dda = [(d[1],d[2],d[3]) for d in dd if d[0] == a]
            dda = sorted(dda)
            rr, sigs, esigs = zip(*dda)
            plt.errorbar(rr, sigs, yerr=esigs)
            disp_data_for_hulst.append((n, zip(rr, sigs, esigs)))
        plt.title('UGC{}\n x={} ang={} s={}'.format(str(n), str(unique(xx)), str(unique(ang)), str(unique(sources))))
        plt.show()


Данные по газу из статьи:


In [129]:
from PIL import Image as ImagePIL

%matplotlib inline

for obj in intersect:
    plt.imshow(ImagePIL.open(obj+'_HI.png'))
    plt.gca().axis('off')
    plt.show()



In [130]:
zip(*disp_data_for_hulst)[0]


Out[130]:
(5079, 5079, 6537, 7353, 7989)

Вместе с информацией о масштабах:


In [131]:
# from NED, Scale (Cosmology Corrected)
scales = {'u6537' : 0.072, 'u7353' : 0.043, 'u5079' : 0.056, 'u7989' : 0.098}

In [132]:
dist = {'u6537' : 30, 'u7353' : 40, 'u5079' : 25, 'u7989' : 80}

for ind, (n, sigdata) in enumerate(disp_data_for_hulst):
    rr, sigs, esigs = zip(*sigdata)
    scale = scales['u'+str(n)]
    gas_lenght = dist['u'+str(n)]
    if ind != 1: #добавляем еще ось к 5079
        fig, (ax1, ax2) = plt.subplots(1,2,figsize=[14, 8])
    ax1.errorbar(rr, sigs, yerr=esigs)
#     ax1.plot([-gas_lenght/scale, gas_lenght/scale], [0.0, 0.0], '-', lw=5., color='black')
    ax2.imshow(ImagePIL.open('u' + str(n) +'_HI.png'))
    if ind != 0: #то же самое
        ax1.set_title('UGC '+str(n))
        ax2.set_title('Scale={} kpc/arcsec'.format(scale))
        ax2.axis('off')
        plt.show()


Газ везде гораздо более протяженный, чем звездные данные (как и должно быть).

The inner mass distribution of late-type spiral galaxies from SAURON stellar kinematic maps

Veselina Kalinova, Glenn van de Ven ... https://arxiv.org/pdf/1609.08700.pdf 18 galaxies with dispersions:


In [133]:
sauron_16_ngc = [488, 772, 4102, 5678, 3949, 4030, 2964, 628, 864, 4254, 1042, 3346, 3423, 4487, 2805, 4775, 5585, 5668]

In [134]:
sauron_16_u = ['u' + str(get_ugc_number('n'+str(d))) for d in sauron_16_ngc]

vs WHISP


In [135]:
intersect = set(sauron_16_u).intersection(unique(['u'+str(d) for d in whisp_galaxies]))

In [136]:
print len(intersect), intersect


1 set(['u6869'])

= n3949


In [137]:
Image('n3949_sig.png')


Out[137]:

vs Walter


In [138]:
intersect = set(sauron_16_u).intersection(unique(walter_2008_u))

In [139]:
print len(intersect), intersect


1 set(['u1149'])

= n628


In [140]:
Image('n628_sig.png')


Out[140]:

In [141]:
Image('n628_bigiel2008.png', width=500)


Out[141]:

vs Warmels


In [142]:
intersect = set(sauron_16_u).intersection(warmels_1988_u)

In [143]:
print len(intersect), intersect


1 set(['u7345'])

=n4254


In [144]:
Image('n4254_sig.png')


Out[144]:

vs Kennicutt


In [145]:
intersect = set(sauron_16_u).intersection(kenn_2001_u)

In [146]:
print len(intersect), intersect


2 set(['u1149', 'u7345'])

Обе уже были выше.

vs Hulst


In [147]:
intersect = set(sauron_16_u).intersection(hulst2016)

In [148]:
print len(intersect), intersect


1 set(['u6869'])

=n3949, уже есть выше (кстати есть еще тут дисперсии https://arxiv.org/pdf/astro-ph/0508552v1.pdf)

The Relationship between Gas Content and Star Formation in Molecule-rich Spiral Galaxies

Wong, Tony; Blitz, Leo 2002

https://ui.adsabs.harvard.edu/#abs/2002ApJ...569..157W/abstract

7 галактик с данными по $\rm{HI}$ и $\rm{H_2}$


In [149]:
wong2002 = ['4321', '4414', '4501', '4736', '5033', '5055', '5457']

In [150]:
wong2002_u = ['u' + str(get_ugc_number('n'+str(d))) for d in wong2002]

vs Katkov:


In [151]:
intersect = set(katkov_u).intersection(wong2002)

In [152]:
len(intersect)


Out[152]:
0

vs HYPERLEDA:


In [153]:
intersect = set(['u'+str(l) for l in joindis]).intersection(wong2002)

In [154]:
len(intersect)


Out[154]:
0

vs SAURON 16


In [155]:
intersect = set(sauron_16_u).intersection(wong2002)

In [156]:
len(intersect)


Out[156]:
0

The DiskMass Survey: VI. Gas and stellar kinematics in spiral galaxies from PPak integral-field spectroscopy

Thomas P. K. Martinsson, Marc A. W. Verheijen, Kyle B. Westfall,, Matthew A. Bershady, Andrew Schechtman-Rook, David R. Andersen, and Rob A. Swaters

https://ui.adsabs.harvard.edu/#abs/2013A&A...557A.130M/abstract 30 galaxies with dispersions:


In [157]:
diskmass_u = ['448', '463', '1081' , '1087' , '1529' , '1635' , '1862' , '1908' , '3091' , '3140' , '3701' , '3997' , '4036' , '4107' , '4256' , '4368' , '4380' , '4458' , '4555' , '4622' , '6903' , '6918' , '7244' , '7917' , '8196' , '9177' , '9837' , '9965' , '11318', '12391']

In [159]:
diskmass_u = ['u' + d for d in diskmass_u]

vs WHISP


In [160]:
intersect = set(diskmass_u).intersection(unique(['u'+str(d) for d in whisp_galaxies]))

In [161]:
print len(intersect), intersect


4 set(['u4458', 'u4036', 'u7917', 'u4256'])

= NGC 2599, NGC 2441, NGC 4662, NGC 2532


In [170]:
Image('u4458_disp.png')


Out[170]:

In [171]:
Image('u4036_disp.png')


Out[171]:

In [173]:
Image('u7917_disp.png')


Out[173]:

In [174]:
Image('u4256_disp.png')


Out[174]:

vs Walter


In [162]:
intersect = set(diskmass_u).intersection(unique(walter_2008_u))

In [163]:
print len(intersect), intersect


0 set([])

vs Warmels


In [164]:
intersect = set(diskmass_u).intersection(warmels_1988_u)

In [165]:
print len(intersect), intersect


0 set([])

vs Kennicutt


In [166]:
intersect = set(diskmass_u).intersection(kenn_2001_u)

In [167]:
print len(intersect), intersect


0 set([])

Обе уже были выше.

vs Hulst


In [168]:
intersect = set(diskmass_u).intersection(hulst2016)

In [169]:
print len(intersect), intersect


0 set([])