Last active
November 18, 2016 17:45
-
-
Save ExcaliburZero/4e7f6059c7c5d63ffac656d7277ae761 to your computer and use it in GitHub Desktop.
A small test of the lsstbroker.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import binary_classifier | |
import classifier | |
import classifier_box | |
import handler | |
import observation | |
### | |
# Define classifiers | |
### | |
def function(_): | |
return 0.2 | |
bc = binary_classifier.BinaryClassifier("001", function) | |
cl = classifier.Classifier() | |
cl.add_binary_classifier(bc) | |
cl_box = classifier_box.ClassifierBox() | |
cl_box.add_classifier(cl) | |
### | |
# Setup data handler | |
### | |
host = "localhost" | |
database = raw_input("Database:") | |
username = raw_input("Username:") | |
password = raw_input("Password:") | |
h = handler.MySqlDatabaseHandler(host, database, username, password) | |
h.set_classifier_box(cl_box) | |
### | |
# Run data through the handler | |
### | |
time = float(raw_input("Time:")) | |
obs = observation.Observation("LSST-0001A", time, 50.4, 0.005) | |
h.run(obs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment