forked from mehulghosal/small-neo-lightcurves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcdb_confirm.py
43 lines (32 loc) · 1.2 KB
/
lcdb_confirm.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
import subprocess, sys
import numpy as np
f = np.loadtxt('star_parameters.csv', delimiter=',', dtype=object, skiprows=1)
L = np.array(f[:,1], dtype=float)
a = np.array(f[:,2], dtype=float)
# f = f[np.where(L>0)]
# L = np.array(f[:,1], dtype=float)
# a = np.array(f[:,2], dtype=float)
# print(len(f))
lcdb_summary = np.loadtxt('/home/mehul/code/ast-lightcurve-database_V4_0/data/lc_summary.csv', delimiter=',', skiprows=22, dtype=object)
# print(f)
# index = sys.argv[1]
#for index in range(len(f)-1, -1, -1):
for index in range(len(f)):
# print(f[index])
obj_name = f[index, 0].split(' ')
# print(obj_name[0].join(obj_name[1]))
obj_name = obj_name[0] + " " + obj_name[1]
# print(obj_name)
lcdb_ind = -1
for j in range(len(lcdb_summary)):
if obj_name in lcdb_summary[j, 1]:
lcdb_ind = j
break
# print(lcdb_ind)
if not lcdb_ind == -1:
period = float(lcdb_summary[lcdb_ind, 19].split('"')[1])
diameter = float(lcdb_summary[lcdb_ind, 8].split('"')[1])
print(obj_name, period * 3600, diameter)
# print(lcdb_summary[lcdb_ind])
# pass
# subprocess.run(['python3', 'magic_star.py', f[index, 0].split(' ')[1], str(L[index]), str(a[index])])#, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)