In [1]:
import sys
sys.path.append('../src/')
from almaDatabaseQuery import *
import matplotlib.pyplot as plt
import numpy as np
import math
from astropy import units as u
from astropy.coordinates import SkyCoord
from mpl_toolkits.basemap import Basemap # need to install basemap and geos
from allskymap import AllSkyMap # need to install pyproj
%matplotlib inline
In [2]:
q = databaseQuery()
report, resume = q.select_object_from_sqldb("calibrators_brighterthan_0.1Jy_20180419.db", \
maxFreqRes=999999999, array='12m', \
excludeCycle0=True, \
selectPol=False, \
minTimeBand={3:60., 6:60., 7:60.}, \
silent=True, nonALMACAL=True)
In [3]:
resume[0]
Out[3]:
In [4]:
ra, dec, glon, glat, nproj = [], [], [], [], []
for i,idata in enumerate(resume):
ra.append(idata[1])
dec.append(idata[2])
glon.append(idata[9])
glat.append(idata[10])
nproj.append(10*np.log(idata[7]))
In [5]:
fig = plt.figure(figsize=(12,6))
main_ax = plt.axes([0.05, .19, .9, .75]) # rect=L,B,W,H
# Set up the projection and draw a grid.
m = AllSkyMap(ax=main_ax, projection='moll')
m.drawmapboundary(fill_color='white')
m.drawparallels(np.arange(-75,76,15), linewidth=1, dashes=[1,2], labels=[1,0,0,0], fontsize=12)
m.drawmeridians(np.arange(-150,151,30), linewidth=1, dashes=[1,2])
x, y = m(ra, dec)
cr_pts = m.scatter(x, y, s=(nproj), c='k', marker='o', linewidths=0.5, edgecolors='none', alpha=0.8)
# Label a subset of meridians.
lons = np.arange(-150,151,30)
m.label_meridians(lons, fontsize=12, vnudge=1, halign='left', hnudge=-1) # nudge<0 shifts to right
plt.show()
In [6]:
fig = plt.figure(figsize=(12,6))
main_ax = plt.axes([0.05, .19, .9, .75]) # rect=L,B,W,H
# Set up the projection and draw a grid.
m = AllSkyMap(ax=main_ax, projection='moll')
m.drawmapboundary(fill_color='white')
m.drawparallels(np.arange(-75,76,15), linewidth=1, dashes=[1,2], labels=[1,0,0,0], fontsize=12)
m.drawmeridians(np.arange(-150,151,30), linewidth=1, dashes=[1,2])
x, y = m(glon, glat)
cr_pts = m.scatter(x, y, s=(nproj), c='k', marker='o', linewidths=0.5, edgecolors='none', alpha=0.8)
# Label a subset of meridians.
lons = np.arange(-150,151,30)
m.label_meridians(lons, fontsize=12, vnudge=1, halign='left', hnudge=-1) # nudge<0 shifts to right
plt.show()
In [ ]: