Skip to content
Snippets Groups Projects
Commit cfa8189f authored by Chad Hanna's avatar Chad Hanna
Browse files

update vis

parent 81422f39
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html>
<head>
<title>gstlal CBC Latency</title>
<link rel="stylesheet" type="text/css" href="gstlal.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="gstlal.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawLatency);
google.charts.setOnLoadCallback(drawSNR);
google.charts.setOnLoadCallback(drawHorizon);
google.charts.setOnLoadCallback(drawNoise);
google.charts.setOnLoadCallback(drawPSD);
google.charts.setOnLoadCallback(drawNoiseGauge);
google.charts.setOnLoadCallback(drawRangeGauge);
</script>
<title>gstlal CBC Latency</title>
<link rel="stylesheet" type="text/css" href="gstlal.css">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="gstlal.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawLatencyStatusByNodes);
google.charts.setOnLoadCallback(drawLatencyHistory);
google.charts.setOnLoadCallback(drawLatencyGauge);
google.charts.setOnLoadCallback(drawSNRStatusByNodes);
google.charts.setOnLoadCallback(drawSNRHistory);
google.charts.setOnLoadCallback(drawHorizon);
google.charts.setOnLoadCallback(drawNoise);
google.charts.setOnLoadCallback(drawPSD);
google.charts.setOnLoadCallback(drawNoiseGauge);
google.charts.setOnLoadCallback(drawRangeGauge);
</script>
</head>
<body>
<div class=topbox>
<table>
<tr><td><img width=100px src="http://www.lsc-group.phys.uwm.edu/cgit/gstlal/plain/gstlal/doc/gstlal.png"></td>
<td><ul class="tab">
<!-- <li><a href="#ldg" class="tablinks" onclick="openGstlalTab(event, 'LDG')">LDG</a></li> -->
<li><a href="#dashboard" class="tablinks" onclick="openGstlalTab(event, 'Dashboard')">Dashboard</a></li>
<!-- <li><a href="#events" class="tablinks" onclick="openGstlalTab(event, 'Events')">Events</a></li> -->
<li><a href="#detchar" class="tablinks" onclick="openGstlalTab(event, 'Detchar')">Detchar</a></li>
<li><a href="#logs" class="tablinks" onclick="openGstlalTab(event, 'Logs')">Logs</a></li>
<li><a href="#noise" class="tablinks" onclick="openGstlalTab(event, 'Noise')">Noise</a></li>
<li><a href="#sens" class="tablinks" onclick="openGstlalTab(event, 'Sensitivity')">Sensitivity</a></li>
<li><a href="#latency" class="tablinks" onclick="openGstlalTab(event, 'Latency')">Latency</a></li>
<li><a href="#snr" class="tablinks" onclick="openGstlalTab(event, 'SNR')">SNR</a></li>
</ul></td>
<td><form><input type="text" name="GPS" value=""><input type="submit" value="GPS"></form></dd>
</tr>
</table>
</div>
<br>
<div class=topbox>
<table>
<tr><td><img width=100px src="http://www.lsc-group.phys.uwm.edu/cgit/gstlal/plain/gstlal/doc/gstlal.png"></td>
<td><ul class="tab">
<li><a href="#ldg" class="tablinks" onclick="openGstlalTab(event, 'LDG')">LDG</a></li>
<li><a href="#dashboard" class="tablinks" onclick="openGstlalTab(event, 'Dashboard')">Dashboard</a></li>
<li><a href="#events" class="tablinks" onclick="openGstlalTab(event, 'Events')">Events</a></li>
<li><a href="#logs" class="tablinks" onclick="openGstlalTab(event, 'Logs')">Logs</a></li>
<li><a href="#noise" class="tablinks" onclick="openGstlalTab(event, 'Noise')">Noise</a></li>
<li><a href="#sens" class="tablinks" onclick="openGstlalTab(event, 'Sensitivity')">Sensitivity</a></li>
<li><a href="#latency" class="tablinks" onclick="openGstlalTab(event, 'Latency')">Latency</a></li>
<li><a href="#snr" class="tablinks" onclick="openGstlalTab(event, 'SNR')">SNR</a></li>
</ul></td>
<td><form><input type="text" name="GPS" value=""><input type="submit" value="GPS"></form></dd>
</tr>
</table>
</div>
<br>
<div id="LDG" class="tabcontent">
<iframe src="https://monitor.ligo.org/gwstatus" width=100% height=675></iframe>
</div>
<!--
<div id="LDG" class="tabcontent">
<iframe src="https://monitor.ligo.org/gwstatus" width=100% height=675></iframe>
</div>
-->
<div id="Dashboard" class="tabcontent">
<div id="noise_gauge"></div>
<div id="range_gauge"></div>
</div>
<div id="Dashboard" class="tabcontent">
<div id="noise_gauge"></div>
<div id="range_gauge"></div>
<div id="latency_gauge_wrapper"></div>
</div>
<div id="Logs" class="tabcontent">
<table width=100%>
<tr><td><iframe src="https://alog.ligo-wa.caltech.edu/aLOG/iframeSrc.php?authExpired=&content=1&step=&callRep=&startPage=&preview=&printCall=&callUser=&addCommentTo=&callHelp=&callFileType=#&reportSection=8&reportTask=General" width=100% height=675></iframe></td>
<td><iframe src="https://alog.ligo-la.caltech.edu/aLOG/iframeSrc.php?authExpired=&content=1&step=&callRep=&startPage=&preview=&printCall=&callUser=&addCommentTo=&callHelp=&callFileType=#&reportSection=6&reportTask=General" width=100% height=675></iframe></td></tr>
</table>
</div>
<div id="Logs" class="tabcontent">
<table width=100%>
<tr><td><iframe src="https://alog.ligo-wa.caltech.edu/aLOG/iframeSrc.php?authExpired=&content=1&step=&callRep=&startPage=&preview=&printCall=&callUser=&addCommentTo=&callHelp=&callFileType=#&reportSection=8&reportTask=General" width=100% height=675></iframe></td>
<td><iframe src="https://alog.ligo-la.caltech.edu/aLOG/iframeSrc.php?authExpired=&content=1&step=&callRep=&startPage=&preview=&printCall=&callUser=&addCommentTo=&callHelp=&callFileType=#&reportSection=6&reportTask=General" width=100% height=675></iframe></td></tr>
</table>
</div>
<div id="Events" class="tabcontent">
<iframe src="https://gracedb.ligo.org/latest/?query=gstlal" width=100% height=675></iframe>
</div>
<div id="Detchar" class="tabcontent">
<iframe src="https://ldas-jobs.ligo.caltech.edu/~detchar/summary/" width=100% height=675></iframe>
</div>
<div id="Noise" class="tabcontent">
<div id="noise"></div>
</div>
<!--
<div id="Events" class="tabcontent">
<iframe src="https://gracedb.ligo.org/latest/?query=gstlal" width=100% height=675></iframe>
</div>
-->
<div id="Sensitivity" class="tabcontent">
<div id="horizon"></div>
<div id="psd"></div>
</div>
<div id="Noise" class="tabcontent">
<div id="noise"></div>
</div>
<div id="Latency" class="tabcontent">
<div id="visualization"></div>
</div>
<div id="Sensitivity" class="tabcontent">
<div id="horizon"></div>
<div id="psd"></div>
</div>
<div id="SNR" class="tabcontent">
<div id="snr"></div>
</div>
<div id="Latency" class="tabcontent">
<div id="latency_status_by_nodes_wrapper"></div>
<div id="latency_history_wrapper"></div>
</div>
<div id="SNR" class="tabcontent">
<div id="snr_status_by_nodes_wrapper"></div>
<div id="snr_history_wrapper"></div>
</div>
</body>
</html>
......@@ -28,62 +28,139 @@ function openGstlalTab(evt, cityName) {
* Google charts
*/
// Give these wrappers global scope
var latency_status_by_nodes_wrapper;
var latency_history_wrapper;
var latency_gauge_wrapper;
var snr_status_by_nodes_wrapper;
var snr_history_wrapper;
var latency_wrapper;
var snr_wrapper;
var horizon_wrapper;
var noise_wrapper;
var psd_wrapper;
var noise_gauge_wrapper;
var range_gauge_wrapper;
function drawLatency() {
// Draw a column chart
latency_wrapper = new google.visualization.ChartWrapper({
chartType: 'CandlestickChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=0',
query: 'select latency_history',
refreshInterval: 5,
options: { title: 'Latency',
animation: {duration: 1000, easing: 'inAndOut', startup: true},
vAxis: {scaleType: 'log', minValue:5, maxValue:75, textPosition: 'out', ticks: [8,16,32,64] },
hAxis: {slantedText: true, slantedTextAngle: 90},
chartArea: {left:25,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'visualization',
});
latency_wrapper.draw();
var noise_wrapper;
var noise_gauge_wrapper;
/*
* Charts about latency
*/
function drawLatencyStatusByNodes() {
// Draw a column chart
latency_status_by_nodes_wrapper = new google.visualization.ChartWrapper({
chartType: 'CandlestickChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:0',
query: 'select latency_history where status by node',
refreshInterval: 5,
options: {title: 'Latency',
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {scaleType: 'log', minValue:5, maxValue:75, textPosition: 'out', ticks: [8,16,32,64] },
hAxis: {slantedText: true, slantedTextAngle: 90},
chartArea: {left:25,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'latency_status_by_nodes_wrapper',
});
latency_status_by_nodes_wrapper.draw();
}
function drawLatencyHistory() {
// Draw a column chart
latency_history_wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:1',
query: 'select latency_history where node is all',
refreshInterval: 5,
options: {title: 'Latency',
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {scaleType: 'log', minValue:5, maxValue:75, textPosition: 'out', ticks: [8,16,32,64] },
chartArea: {left:25,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'latency_history_wrapper',
});
latency_history_wrapper.draw();
}
function drawSNR() {
snr_wrapper = new google.visualization.ChartWrapper({
chartType: 'CandlestickChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=1',
query: 'select snr_history',
function drawLatencyGauge() {
latency_gauge_wrapper = new google.visualization.ChartWrapper({
chartType: 'Gauge',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:2',
query: 'select latency_history where now',
refreshInterval: 5,
options: { title: 'SNR',
animation: {duration: 1000, easing: 'inAndOut', startup: true},
vAxis: {scaleType: 'log', minValue:4, maxValue:150, textPosition: 'out', ticks: [4,8,16,32,64] },
hAxis: {slantedText: true, slantedTextAngle: 90},
chartArea: {left:30,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'snr',
});
snr_wrapper.draw();
options: {
animation: {duration: 4000, easing: 'linear'},
width: 1800, height: 200,
redFrom: 0, redTo: 20,
yellowFrom: 20, yellowTo: 50,
greenFrom: 50, greenTo: 100,
minorTicks: 5,
max: 100,
min: 0
},
containerId: 'latency_gauge_wrapper',
});
latency_gauge_wrapper.draw();
}
/*
* Charts about SNR
* NOTE these start numbering reqId at 100
*/
function drawSNRStatusByNodes() {
snr_status_by_nodes_wrapper = new google.visualization.ChartWrapper({
chartType: 'CandlestickChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:100',
query: 'select snr_history where status by node',
refreshInterval: 5,
options: {title: 'SNR',
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {scaleType: 'log', minValue:4, maxValue:150, textPosition: 'out', ticks: [4,8,16,32,64] },
hAxis: {slantedText: true, slantedTextAngle: 90},
chartArea: {left:30,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'snr_status_by_nodes_wrapper',
});
snr_status_by_nodes_wrapper.draw();
}
function drawSNRHistory() {
snr_history_wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:101',
query: 'select snr_history where node is all',
refreshInterval: 5,
options: {title: 'SNR',
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {scaleType: 'log', minValue:4, maxValue:150, textPosition: 'out', ticks: [4,8,16,32,64] },
chartArea: {left:30,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
},
containerId: 'snr_history_wrapper',
});
snr_history_wrapper.draw();
}
function drawHorizon() {
horizon_wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=2',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:102',
query: 'select horizon_history',
refreshInterval: 5,
options: { title: 'Horizon',
animation: {duration: 1000, easing: 'inAndOut', startup: true},
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {scaleType: 'log', minValue:4, maxValue:150, textPosition: 'out', ticks: [4,8,16,32,64,128] },
chartArea: {left:30,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
......@@ -98,11 +175,11 @@ horizon_wrapper.draw();
function drawNoise() {
noise_wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=3',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:200',
query: 'select noise',
refreshInterval: 5,
options: { title: 'Noise',
animation: {duration: 1000, easing: 'inAndOut', startup: true},
animation: {duration: 1000, easing: 'inAndOut'},
vAxis: {textPosition: 'out', viewWindowMode:'explicit', viewWindow:{min:-0.1, max:2}},
chartArea: {left:30,top:5,width:'100%',height:'73%'},
titlePosition: 'in',
......@@ -117,7 +194,7 @@ noise_wrapper.draw();
function drawPSD() {
psd_wrapper = new google.visualization.ChartWrapper({
chartType: 'LineChart',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=4',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:300',
query: 'select psd',
refreshInterval: 5,
options: { title: 'Amplitude Spectral Density',
......@@ -136,18 +213,18 @@ psd_wrapper.draw();
function drawNoiseGauge() {
noise_gauge_wrapper = new google.visualization.ChartWrapper({
chartType: 'Gauge',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=5',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:400',
query: 'select noise where now',
refreshInterval: 5,
options: {
animation: {duration: 4000, easing: 'linear'},
width: 1800, height: 200,
redFrom: 1, redTo: 2,
yellowFrom: 0.3, yellowTo: 1,
greenFrom: -0.1, greenTo: 0.3,
redFrom: 50, redTo: 100,
yellowFrom: 10, yellowTo: 50,
greenFrom: 0, greenTo: 10,
minorTicks: 5,
max: 2,
min: -0.2
max: 100,
min: 0
},
containerId: 'noise_gauge',
});
......@@ -155,10 +232,11 @@ function drawNoiseGauge() {
noise_gauge_wrapper.draw();
}
function drawRangeGauge() {
range_gauge_wrapper = new google.visualization.ChartWrapper({
chartType: 'Gauge',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?reqId=6',
dataSourceUrl: 'https://ldas-jobs.ligo.caltech.edu/~gstlalcbctest/cgi-bin/gstlal_data_server_latest_by_job?tqx=reqId:500',
query: 'select horizon_history where now',
refreshInterval: 5,
options: {
......
......@@ -2,31 +2,33 @@
import gviz_api
import h5py
import os
import os,sys
import cgi
import cgitb
cgitb.enable()
form = cgi.parse()
import numpy
from gstlal import llweb
import re
#import pyparsing
print "Content-type: application/json"
print
# we have to get a query according to the google standard
# queries must be of the form
# tq =
assert "tq" in form
assert "reqId" in form
reqId = form["reqId"][0]
assert "tqx" in form
reqId = form["tqx"][0].split(":")[1]
query = form["tq"][0]
#
# Default values
#
# Figure out if a GPS time is being specified, else assume "now"
if "gpstime" in query:
regex = re.compile("[0-9]{10}")
query_time = regex.search(query).group(0)
else:
query_time = int(llweb.now())
# FIXME don't hard code
base_path = "/home/gstlalcbctest/engineering/10/S6/bns"
#
......@@ -38,42 +40,73 @@ base_path = "/home/gstlalcbctest/engineering/10/S6/bns"
#
# Data types
#
for dt in ( ("latency_history", "Latency"),
("snr_history", "SNR")
):
for dt in (("latency_history", "Latency (s)"),
("snr_history", "SNR")
):
if dt[0] in query:
data_type = dt[0]
latest_time_path = base_path + "/aggregator"
# FIXME DONT HARD CODE
for level in str(int(llweb.now()))[0:6]:
latest_time_path += "/%s" % level
out_data = []
path = latest_time_path
path += "/by_job"
for job in os.listdir(path):
fname = "%s/%s/median/%s.hdf5" % (path, job, data_type)
f = f = h5py.File(fname, "r")
this_data = numpy.array(f["data"])[-25:]
if len(this_data) > 0:
mindata = numpy.min(this_data)# + numpy.random.randn()
maxdata = numpy.max(this_data)# + numpy.random.randn()
meandata = numpy.mean(this_data)
std = numpy.std(this_data)
out_data.append([job, mindata, meandata-std/2., meandata+std/2., maxdata])
f.close()
description = [
("job", "string"),
("std dev", "number"),
("job median-std/2", "number"),
("job median+std/2", "number"),
("job max", "number")
]
data_table = gviz_api.DataTable(description)
data_table.LoadData(out_data)
print data_table.ToJSonResponse(order_by = "job", req_id = reqId)
path = base_path + "/aggregator"
for level in str(query_time)[0:6]:
path += "/%s" % level
if "status by node" in query:
# FIXME at 10,000 second boundaries this query won't
# return the latest 25 samples, we need to look back a
# directory
out_data = []
path += "/by_job"
for job in os.listdir(path):
fname = "%s/%s/median/%s.hdf5" % (path, job, data_type)
f = f = h5py.File(fname, "r")
this_data = numpy.array(f["data"])[-25:]
if len(this_data) > 0:
mindata = numpy.min(this_data)
maxdata = numpy.max(this_data)
meandata = numpy.mean(this_data)
std = numpy.std(this_data)
out_data.append([job, mindata, meandata-std/2., meandata+std/2., maxdata])
f.close()
description = [
("job", "string"),
("std dev", "number"),
("job median-std/2", "number"),
("job median+std/2", "number"),
("job max", "number")
]
data_table = gviz_api.DataTable(description)
data_table.LoadData(out_data)
print data_table.ToJSonResponse(order_by = "job", req_id = reqId)
sys.exit()
if "where node is all" in query:
# FIXME at 10,000 second boundaries this query won't
# return all the relevant samples
# FIXME decide how many samples to return
out_data = []
fname = "%s/median/%s.hdf5" % (path, data_type)
f = h5py.File(fname, "r")
out_data.extend([[this_time, this_data] for this_time, this_data in zip(numpy.array(f["time"]), numpy.array(f["data"]))])
f.close()
description = [("time", "number"), (dt[0], "number")]
data_table = gviz_api.DataTable(description)
data_table.LoadData(out_data)
print data_table.ToJSonResponse(order_by = "time", req_id = reqId)
sys.exit()
if "now" in query:
out_data = []
fname = "%s/median/%s.hdf5" % (path, data_type)
f = h5py.File(fname, "r")
out_data = [[float(f["data"][-1])]]
f.close()
description = [(dt[1], "number")]
data_table = gviz_api.DataTable(description)
data_table.LoadData(out_data)
print data_table.ToJSonResponse(req_id = reqId)
sys.exit()
for dt in (("horizon_history", "time", "horizon"), ("noise", "time", "noise"), ("psd", "freq", "asd")):
for dt in (("horizon_history", "time", "horizon", "(Mpc)"), ("noise", "time", "noise", "|n(t)|"), ("psd", "freq", "asd", "ASD")):
if dt[0] in query:
data_type = dt[0]
latest_time_path = base_path + "/dq"
......@@ -99,8 +132,8 @@ for dt in (("horizon_history", "time", "horizon"), ("noise", "time", "noise"), (
if "now" in query:
out_data.append([latest["H1"][1], latest["L1"][1]])
description = [
("H1 %s" % (dt[2],), "number"),
("L1 %s" % (dt[2],), "number")
("H1 %s" % (dt[3],), "number"),
("L1 %s" % (dt[3],), "number")
]
else:
# FIXME don't harcode
......@@ -108,8 +141,8 @@ for dt in (("horizon_history", "time", "horizon"), ("noise", "time", "noise"), (
out_data.append([t, datadict["H1"].setdefault(t,0), datadict["L1"].setdefault(t,0)])
description = [
(dt[1], "number"),
("H1 %s" % dt[2], "number"),
("L1 %s" % dt[2], "number")
("H1 %s" % dt[3], "number"),
("L1 %s" % dt[3], "number")
]
data_table = gviz_api.DataTable(description)
......
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