In [1]:
import sys
sys.path.append('../../src/utils/')
from almaDatabaseQuery import *
import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
In [2]:
q = databaseQuery()
In [4]:
resume_sorted3 = sorted(resume, key=lambda data: data[11])
resume_sorted6 = sorted(resume, key=lambda data: data[12])
resume_sorted7 = sorted(resume, key=lambda data: data[13])
res3 = np.array(resume_sorted3)
res6 = np.array(resume_sorted6)
res7 = np.array(resume_sorted7)
In [5]:
plt.figure(figsize=(15,4))
plt.subplot(131)
plt.plot(np.linspace(1,134,134), np.sqrt(res3[:,11].astype(float)), 'r-', np.linspace(1,134,134), np.sqrt(res3[:,12].astype(float)), 'g-', np.linspace(1,134,134), np.sqrt(res3[:,13].astype(float)), 'b-')
plt.ylabel(r"$\sqrt{t}$")
plt.title("Sorted on B3")
plt.subplot(132)
plt.plot(np.linspace(1,134,134), np.sqrt(res6[:,11].astype(float)), 'r-', np.linspace(1,134,134), np.sqrt(res6[:,12].astype(float)), 'g-', np.linspace(1,134,134), np.sqrt(res6[:,13].astype(float)), 'b-')
plt.ylabel(r"$\sqrt{t}$")
plt.title("Sorted on B6")
plt.subplot(133)
plt.plot(np.linspace(1,134,134), np.sqrt(res7[:,11].astype(float)), 'r-', np.linspace(1,134,134), np.sqrt(res7[:,12].astype(float)), 'g-', np.linspace(1,134,134), np.sqrt(res7[:,13].astype(float)), 'b-')
plt.ylabel(r"$\sqrt{t}$")
plt.title("Sorted on B7")
Out[5]:
In [6]:
resume_sorted = sorted(resume, key=lambda data: data[11]+data[12]+data[13])
In [7]:
res = np.array(resume_sorted)
In [8]:
plt.figure(figsize=(10,5))
plt.plot(np.linspace(1,134,134), np.sqrt(res[:,11].astype(float)), 'r-', np.linspace(1,134,134), np.sqrt(res[:,12].astype(float)), 'g-', np.linspace(1,134,134), np.sqrt(res[:,13].astype(float)), 'b-')
plt.ylabel(r"$\sqrt{t}$")
plt.axvline(x=114, c='black', ls=':')
plt.axvline(x=104, c='magenta', ls=':')
Out[8]:
In [9]:
print("List of primary sample: ")
primary_name = res[:,0][-20:]
print primary_name
In [10]:
print("List of secondary sample: ")
secondary_name = res[:,0][-30:-20]
print(secondary_name)
See the detail of each object in report_8_nonAlmacal.txt
In [11]:
file_listcal = "alma_sourcecat_searchresults_20180419.csv"
In [12]:
listcal = q.read_calibratorlist(file_listcal, fluxrange=[0.1, 999999])
In [13]:
for i, obj in enumerate(primary_name):
for j, cal in enumerate(listcal):
if obj == cal[0]: # same name
print(cal[3])
There are 3C454.3 and 3C279
In [14]:
for i, obj in enumerate(secondary_name):
for j, cal in enumerate(listcal):
if obj == cal[0]: # same name
print(cal[3])
In [15]:
# List of nonalmacal sample (primary and secondary)
nonalmacal_priority = ['J0541-0211', 'J1733-3722', 'J1610-3958', 'J1743-0350', 'J2253+1608',
'J1851+0035', 'J0541-0541', 'J0601-7036', 'J1130-1449', 'J1305-4928',
'J0336+3218', 'J0006-0623', 'J1717-3342', 'J1833-210B', 'J0237+2848',
'J0750+1231', 'J1751+0939', 'J0948+0022', 'J1107-4449', 'J1256-0547',
'J0747-3310', 'J1516+1932', 'J0438+3004', 'J2134-0153', 'J2226+0052',
'J1830+0619', 'J0426+2327', 'J1626-2951', 'J1225+1253', 'J1058-8003']
In [16]:
report, resume = q.make_report_from_sqldb("calibrators_brighterthan_0.1Jy_20180419.db", nonalmacal_priority, \
maxFreqRes=999999999, array='12m', \
excludeCycle0=True, \
selectPol=False, \
silent=True)
In [17]:
len(resume)
Out[17]:
In [18]:
q.write_report(report, "report_8_nonALMACAL_priority.txt")
In [ ]: