In [1]:
import Loader
import Features
In [2]:
#create a single candidate object (K2), with ID of 2044 (arbitrary)
dat=Loader.Candidate(2044,'ktwo204490599c02_lpd_LC.txt',observatory='K2')
dat
Out[2]:
In [3]:
#set up a featureset object
feat=Features.Featureset(dat,useflatten=False)
feat
Out[3]:
In [4]:
#calculate some features
feat.CalcFeatures(featuredict={'SPhot_max':[],'Contrast':[],'LSPeriod':[1],'LSAmp':[1],'F8':[]})
In [5]:
#show current set of calculates features (note, LSPeriod0 is present as it was calculated by the SPhot_max function)
feat.features
Out[5]:
In [6]:
#calculate some more features
feat.CalcFeatures(featuredict={'LSPeriod':[3],'LSAmp':[3]})
feat.features
Out[6]:
In [7]:
#now let's use some tsfresh features to save us some coding
feat.CalcFeatures(featuredict={'TSFresh':['flux__median']})
In [9]:
#using more tsfresh features takes no more time
feat.CalcFeatures(featuredict={'TSFresh':['flux__time_reversal_asymmetry_statistic__lag_2']})
feat.features
Out[9]:
In [ ]: