forked from isadoranun/time-series-feats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_lightcurve
51 lines (31 loc) · 922 Bytes
/
import_lightcurve
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
from Feature import FeatureSpace
import numpy as np
class LeerLC_MACHO:
def __init__(self,id):
self.id=id
def leerLC(self):
fid=open('lc_'+self.id+'.B.mjd','r')
saltos_linea = 3
delimiter = ' '
for i in range(0,saltos_linea):
fid.next()
LC = []
for lines in fid:
str_line = lines.strip().split()
floats = map(float, str_line)
#numbers = (number for number in str_line.split())
LC.append(floats)
LC = np.asarray(LC)
data = LC[:,1]
error = LC[:,2]
mjd = LC[:,0]
return [data, error, mjd]
#Opening the blue band
# lc = LeerLC_MACHO(fid)
# data = lc[:,1]
# error = lc[:,2]
# mjd = lc[:,0]
# #Opening the red band
# fid2=open('lc_'+id+'.R.mjd','r')
# lc2 = LeerLC_MACHO(fid2)
# second_data = lc2[:,1]