Setup

In order for the following examples to work, you need to install the library by running the following command in the main directory:

$ python setup.py install

Generating Test Data

Test data can be generated using the EmulatorMain class. Using the generateSingleObject method, one can generate observation data of transients and non-transients.

By passing in a value of True a transient is generated, while passing in False causes a non-transient to be generated.


In [1]:
from binaryclassifier import EmulatorMain

em = EmulatorMain.EmulatorMain()
em.generateSingleObject(True)


Out[1]:
[Observation0(time=14078, light=64.03),
 Observation1(time=28156, light=74.99),
 Observation2(time=42234, light=85.95),
 Observation3(time=56312, light=97.05)]

In [2]:
from binaryclassifier import EmulatorMain

em = EmulatorMain.EmulatorMain()
em.generateSingleObject(False)


Out[2]:
[Observation0(time=10559, light=47.98),
 Observation1(time=21118, light=47.97),
 Observation2(time=31677, light=47.95),
 Observation3(time=42236, light=47.96),
 Observation4(time=52795, light=48.0),
 Observation5(time=63354, light=47.98),
 Observation6(time=73913, light=47.97),
 Observation7(time=84472, light=47.96)]

Observation Data Format

The observation data returned by using the generateSingleObject method is formatted as a list of named tuples. Each tuple represents a single observation of the 'object'.

Each observation tuple contains the time the observation was taken at and the light level recorded in the observation of the object.


In [3]:
from binaryclassifier import EmulatorMain

em = EmulatorMain.EmulatorMain()
object1 = em.generateSingleObject(False)
print object1[0]
print "time:  " + str(object1[0][0])
print "light: " + str(object1[0][1])


Observation0(time=16671, light=68.02)
time:  16671
light: 68.02