In [2]:
import os
import random
import numpy as np
import pytff
import pytff.datasets as ds
In [3]:
tff = pytff.TFFCommand(tff_path="path/to/tff")
tff
Out[3]:
The main method of TFFCommand
instance is analize
In [4]:
help(tff.analyze)
In [5]:
periods = np.random.rand(10)
times = np.random.rand(10, 50)
values = np.random.rand(*times.shape)
In [6]:
tff_data, dff_data, match_data = tff.analyze(periods, times, values)
In [7]:
match_data[["src_idx", "template_id"]]
Out[7]:
In [7]:
data = np.loadtxt(ds.get("single", "ogle.dat"))
data
Out[7]:
Reformat the data for pytff
In [8]:
# this value is the real period of this star (i don't remember the original id
# is necesary to create an array of one element for only one star
periods = np.array([0.6347522])
# convert the first column of the data into a first row of the 2d array
times = data[:,0].reshape(1, len(data[:,0]))
# convert the second column of the data into a first row of the 2d array
values = data[:,1].reshape(1, len(data[:,1]))
In [9]:
tff_data, dff_data, match_data = tff.analyze(periods, times, values)
In [10]:
tff_data
Out[10]:
In [11]:
tff_data[0] # our first and only source
Out[11]:
In [12]:
tff_data["period"]
Out[12]:
In [13]:
match_data
Out[13]:
In [ ]: