-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplotcat.py
executable file
·46 lines (38 loc) · 1008 Bytes
/
plotcat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python
# do some plotting using the master catalogue file
from astropy.table import Table
import os.path
import numpy as np
import matplotlib.pyplot as plt
def nanmean(a):
na=np.array(a)
return np.mean(na[np.isfinite(na)])
t=Table.read('master-table.dat',format='ascii.commented_header', header_start=-1)
flist=[]
clist=[]
for i in range(37):
catname='L221266_B%02i_image-20_first_img_masked.restored.corr_conv.fits.catalog' % i
if os.path.isfile(catname):
f=open(catname)
for i in range(3):
line=f.readline()
bits=line.split()
freq=bits[8]
flist.append(freq)
clist.append('%3i' % (float(freq)/1e6))
print flist, clist
f=[]
mf=[]
for r in t:
if r['counterparts']>10:
v=[]
for c in clist:
v.append(r['s'+c])
plt.plot(flist,v)
mf.append(nanmean(v))
f.append(r['Total_flux'])
plt.loglog()
plt.show()
plt.scatter(f,mf)
plt.loglog()
plt.show()