From afe8726f87d39dff9327355138913f26bb0fce01 Mon Sep 17 00:00:00 2001
From: Ansel Neunzert <ansel.neunzert@ligo.org>
Date: Thu, 6 Oct 2016 14:16:54 -0700
Subject: [PATCH] Added header, separator bars to summary page

---
 combtrack_makesummary.py        |  8 ++-
 combtrack_summary_template.html | 99 +++++++++++++++++++++++++++++++++
 summary_style.css               | 18 +++++-
 3 files changed, 120 insertions(+), 5 deletions(-)
 create mode 100644 combtrack_summary_template.html

diff --git a/combtrack_makesummary.py b/combtrack_makesummary.py
index 6e03429..d5500be 100644
--- a/combtrack_makesummary.py
+++ b/combtrack_makesummary.py
@@ -20,7 +20,11 @@ def color_for_combtrack_file(fname):
 		if "\"url\":" in line:
 			pervadenow=float(line.split("],\"url\":")[0].split(",")[-1])
 	x=int(max(0,np.log10(strnow*pervadenow))*50)
-	return colors.rgb2hex(cm.viridis(x)[:-1])
+	rgb=np.array(cm.viridis(x)[:-1])*255
+	rgb=rgb.astype(int)
+	rgb+=20
+	rgb=[min(i,255) for i in rgb]
+	return "rgba({},{},{},{})".format(rgb[0],rgb[1],rgb[2],1)
 
 def recent_link_for_combtrack_file(fname):
 	reclink=""
@@ -92,7 +96,7 @@ def main():
 			combspstr,comboffstr=fname.split("_")[0:2]
 			combsp=combspstr.strip("sp").replace("p",".")
 			comboff=comboffstr.strip("off").replace("p",".")
-			comb_tag="{0}<br>{1}".format(combsp,comboff)
+			comb_tag="{0}<br><hr>{1}".format(combsp,comboff)
 			if args.combnotesfile:
 				for combkey in notesdict.keys():
 					if combkey in fname:
diff --git a/combtrack_summary_template.html b/combtrack_summary_template.html
new file mode 100644
index 0000000..5ada18f
--- /dev/null
+++ b/combtrack_summary_template.html
@@ -0,0 +1,99 @@
+<html>
+<head>
+	<link rel="stylesheet" type="text/css" href="summary_style.css">
+
+</head>
+<body>
+
+<h2> Daily comb summary </h2>
+<p>See the bottom of this page for help and navigation.</p>
+<div id="notes">
+	{{includetxt}}
+</div>
+
+<section class="">
+<div class="container">
+
+<table>
+	<tr class="tablehead">
+	<td><b>Tracked combs</b> &rarr;<br><small>(spacing, offset where teeth=offset+n*spacing)</small></td>
+		{% for tag in content.columns.values %}
+		<td>{{ tag }}</td>
+		{% endfor %}
+	</tr>
+<tbody>
+</tr>
+{% for index,row in content.iterrows() %}
+	<tr>
+
+	<td> {{index}} </td>
+
+	{% for col in content.columns %}
+		{% if col!='interest' %}
+		{{row[col]}}
+		{% endif %}
+	{% endfor %}
+
+	</tr>
+{% endfor %}
+</tbody>
+</table>
+</div>
+</section>
+<h2>Navigation</h2>
+<div id="notes">
+
+<table>
+<tr style='font-weight:bold;'>
+	<td>Information</td>
+	<td>Where to find it</td>
+	<td>Notes</td>
+</tr>
+
+<tr>
+	<td>Which combs am I looking at?</td>
+	<td>The two numbers in each cell indicate spacing and offset.</td>
+	<td>This information is the same for each entry in the column. These are intended to be human-readable labels; the number of significant figures does not correspond to known comb resolution (which will be added to extended info in hover text)</td>
+</tr>
+
+<tr>
+	<td>In which channels is the comb present?</td>
+	<td>The color of each cell indicates the strength and pervasiveness of the comb in the most recent spectrum for that channel.</td>
+	<td>Brighter (more yellow) cells have stronger combs. Normalization for the cumulative plot is not identical to that for daily plots.</td>
+</tr>
+
+<tr>
+	<td>How does the comb change over time?</td>
+	<td>Clicking any cell will take you to a tracking plot for that comb and channel.</td>
+	<td>Tracking covers over a year of data.</td>
+</tr>
+
+<tr>
+	<td>What does the most recent spectrum for [channel] look like?</td>
+	<td>Click on the channel name.</td>
+	<td>These are daily spectra, not cumulative unless otherwise noted.</td>
+</tr>
+
+<tr>
+	<td>What does [channel] look like on [date]?</td>
+	<td>First, navigate to a tracking plot for that channel (the plot for any comb will work). Then, click the day you are interested in.</td>
+	<td>All the tracked combs will be highlighted in this channel (unless you go all the way back to O1 data, in which case known combs from O1 are highlighted instead)</td>
+</tr>
+
+<tr>
+	<td>What extended information is available for these combs?</td>
+	<td>Hover over any cell corresponding to that comb to see the notes and info.</td>
+	<td>This information is added manually through a configuration file. Details on comb resolution and range will go here.</td>
+</tr>
+
+<tr>
+	<td>Are there new combs, not yet listed on this table?</td>
+	<td>Check the unidentified comb alert status.</td>
+	<td>The parameters and thresholds of this comb search are likely to be tweaked. Real combs should be added to the tracked list.</td>
+</tr>
+
+</table>
+</div>
+
+</body>
+</html>
diff --git a/summary_style.css b/summary_style.css
index 829e45e..7e266c2 100644
--- a/summary_style.css
+++ b/summary_style.css
@@ -6,19 +6,32 @@ background-color:darkgray;
 
 td {
 padding:2 10 2 10;
+outline:1px solid black;
 }
 
-td:hover {
+/*td:hover {
 outline: 3px solid white;
 }
+*/
 
+hr {
+border:1px solid rgba(0, 0, 0, .3)!important;
+width:100%;
+margin-top:0px;
+margin-bottom:0px;
+opacity:50%;
+}
+
+tr.tablehead td {
+background-color:white!important;
+}
 tr:hover { 
 background-color: lightgray!important;
 }
 
 a:link, a:visited, a:hover, a:active {
 text-decoration: none; 
-color: black;
+color: black!important;
 target-name:new;
 target-new:tab;
 }
@@ -91,7 +104,6 @@ padding: 3 3 3 3;
     border: 1px solid black;
     border-radius: 6px;
  
-    /* Position the tooltip text - see examples below! */
     position: absolute;
     z-index: 1;
 }
-- 
GitLab