Skip to content
Snippets Groups Projects
Commit 8b812f6b authored by Kipp Cannon's avatar Kipp Cannon
Browse files

inspiral.py: don't hard-code snr history instruments

- closes out two FIXMEs
parent 5fdfe893
No related branches found
No related tags found
No related merge requests found
......@@ -504,11 +504,8 @@ class Data(object):
bottle.route("/latency_histogram.txt")(self.web_get_latency_histogram)
bottle.route("/latency_history.txt")(self.web_get_latency_history)
bottle.route("/snr_history.txt")(self.web_get_snr_history)
# FIXME don't hardcode the ifos
bottle.route("/H1_snr_history.txt")(lambda : self.web_get_sngl_snr_history(ifo = "H1"))
bottle.route("/L1_snr_history.txt")(lambda : self.web_get_sngl_snr_history(ifo = "L1"))
bottle.route("/V1_snr_history.txt")(lambda : self.web_get_sngl_snr_history(ifo = "V1"))
bottle.route("/K1_snr_history.txt")(lambda : self.web_get_sngl_snr_history(ifo = "K1"))
for instrument in rankingstat.instruments:
bottle.route("/%s_snr_history.txt" % instrument)(lambda : self.web_get_sngl_snr_history(ifo = instrument))
bottle.route("/likelihood_history.txt")(self.web_get_likelihood_history)
bottle.route("/far_history.txt")(self.web_get_far_history)
bottle.route("/ram_history.txt")(self.web_get_ram_history)
......@@ -653,8 +650,7 @@ class Data(object):
self.likelihood_history = deque(maxlen = 1000)
self.far_history = deque(maxlen = 1000)
self.ram_history = deque(maxlen = 2)
# FIXME don't hardcode
self.ifo_snr_history = {"H1": deque(maxlen = 10000), "L1": deque(maxlen = 10000), "V1": deque(maxlen = 10000), "K1": deque(maxlen = 10000)}
self.ifo_snr_history = dict((instrument, deque(maxlen = 10000)) for instrument in rankingstat.instruments)
def appsink_new_buffer(self, elem):
with self.lock:
......@@ -1230,8 +1226,7 @@ class Data(object):
for time, snr in self.snr_history:
yield "%f %e\n" % (time, snr)
# FIXME, don't hardcode these routes
def web_get_sngl_snr_history(self, ifo = "H1"):
def web_get_sngl_snr_history(self, ifo):
with self.lock:
# first one in the list is sacrificed for a time stamp
for time, snr in self.ifo_snr_history[ifo]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment