-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskyPlot.py
More file actions
59 lines (50 loc) · 1.7 KB
/
Copy pathskyPlot.py
File metadata and controls
59 lines (50 loc) · 1.7 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
from mpl_toolkits.basemap import Basemap
from matplotlib import pyplot as plt,cm as mpl_cm,lines as mpl_lines,colorbar
np.seterr(under='ignore')
myfig=plt.figure()
plt.clf()
m=Basemap(projection='moll',lon_0=0.0,lat_0=0.0)
file = open('SolidAngles_2.5_2.5.dat')
filedata = file.readlines()
file.close()
ra = []
dec= []
sa = []
per= []
for i in range(1,len(filedata)):
ra.append(float(filedata[i].split()[0]))
dec.append(float(filedata[i].split()[1]))
sa.append(float(filedata[i].split()[2]))
per.append(float(filedata[i].split()[3])/100.)
ra = np.array(ra)
dec= np.array(dec)
ra_reverse = 2*pi - ra*57.296
plx,ply=m(
ra_reverse,
dec*57.296
)
#m.contourf(plx,ply,data,cmap=mpl_cm.jet,alpha=0.8,tri=True)
#ax = subplot(2,1,1)
m.drawmapboundary()
m.drawcoastlines(linewidth=0.5)
m.drawparallels(np.arange(-90.,90.,45.),labels=[1,0,0,0],labelstyle='+/-')
# draw parallels
m.drawmeridians(np.arange(0.,360.,90.),labels=[0,0,0,1],labelstyle='+/-')
m.scatter(plx,ply,s=60,c=log10(sa),alpha=0.8)
# draw meridians
plt.title("Sky Location Uncertainty", fontsize=22) # add a title
test = m.colorbar(location='bottom')
colorbar.ColorbarBase.set_label(test,'$\log_{10}$($\Omega$) $(deg)^2$', fontsize=15)
#ax = subplot(2,1,2)
#m.drawmapboundary()
#m.drawcoastlines(linewidth=0.5)
#m.drawparallels(np.arange(-90.,90.,45.),labels=[1,0,0,0],labelstyle='+/-')
# draw parallels
#m.drawmeridians(np.arange(0.,360.,90.),labels=[0,0,0,1],labelstyle='+/-')
#m.scatter(plx,ply,s=60,c=per,alpha=0.8)
# draw meridians
#plt.title("Circularity", fontsize=22) # add a title
#test2 = m.colorbar(location='bottom')
#colorbar.ColorbarBase.set_label(test2,'Fraction in circularized 1$\sigma$', fontsize=15)
plt.draw()
plt.show()