-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpsahistpage.html
205 lines (176 loc) · 5.94 KB
/
psahistpage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="plotly-latest.min.js"></script>
<title>Pixie-Net PSA Histogram</title>
<style type="text/css">
body { background-color:#d0d0d0; font-family:sans-serif; }
h1 { margin:0; font-size:24px }
h2 { margin-top:15px; font-size:20px; font-weight:normal; border-bottom:1px solid #ff9040 }
p { font-size:14px }
li { font-size:14px }
a { color:#6060d0; text-decoration:none }
a:hover { text-decoration:underline }
.header { padding: 20px; text-align: center; background: #1e73be; color: white; }
.header h1 { font-size: 40px; }
/* Ensure proper sizing */
* { box-sizing: border-box; }
/* Column container */
.row { display: flex; flex-wrap: wrap; }
/* Sidebar/left column */
.side { height: 100%; width: 180px; position: fixed; background-color: white; padding: 20px; }
.side a { float: left; display: block; color: #002b80; text-align: left; padding: 10px 10px; text-decoration: none; }
.side a:hover { background-color: #ddd; color: #1e73be; }
/* bottom help section */
.fixed_bot { position: fixed; bottom: 0; left: 0; width: 180px; padding: 20px }
.fixed_bot p {font-size: 11px; }
.fixed_bot a {font-size: 12px; }
/* Main column */
.main { margin-left: 180px; padding: 20px; }
.w3-card-2{
background-color:white;
border-radius:3px;
padding: 10px;
margin-bottom: 20px;
box-shadow:0 4px 10px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)
}
.tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; }
.tooltip .tooltiptext {
visibility: hidden;
width: 250px;
background-color: #1e73be;
color: white;
text-align: left;
border-radius: 6px;
padding: 5px 5px;
position: absolute;
z-index: 1;
}
.tooltip:hover .tooltiptext { visibility: visible; width: 250px; top: 100%; left: 80%; margin-left: -60px; }
</style>
</head>
<body>
<div class="header">
<h1>Pixie-Net PSA Histogram</h1>
</div>
<div class="row">
<div class="side">
<img src="xialogo.jpg" width="140" height=auto alt="XIA Logo">
<p> </p>
<a href="/index.html"> Home </a>
<a href="cgitraces.cgi"> Current ADC traces </a>
<a href="cgistats.cgi"> Current run statistics </a>
<a href="mcapage.html">Most recent <br> MCA spectra</a>
<a href="/webops/webopsindex.html"> Web interface </a>
<div class="fixed_bot">
<h2>Help</h2>
<i><p>This page displays the PSA spectra saved to file psa2D.csv by startdaq, acquire, etc. </p>
<p>Hover over plot to see plot options </p>
<p>Use browser button to refresh </p></i>
</div>
</div>
<div class="main">
<div class="w3-card-2">
<!-- Plotly chart will be drawn inside these DIV -->
<div id="Ch0" style="width:480px; height:400px;"></div>
</div>
<div class="w3-card-2">
<div id="Ch1" style="width:480px; height:400px;"></div>
</div>
<div class="w3-card-2">
<div id="Ch2" style="width:480px; height:400px;"></div>
</div>
<div class="w3-card-2">
<div id="Ch3" style="width:480px; height:400px;"></div>
</div>
</div>
</div>
<script>
// define global constants
var Nbins=100;
Plotly.d3.csv('psa2D.csv', function(err, rows){
function unpack(rows, key) {
return rows.map(function(row) { return row[key]; });
}
// define the color scheme
var psacolor = [
['0.000', 'rgb(245,245,245)'],
['0.002', 'rgb(255,100,100)'],
['0.010', 'rgb(255, 0, 0)'],
['0.020', 'rgb(255, 64, 0)'],
['0.030', 'rgb(255,128, 0)'],
['0.040', 'rgb(255,191, 0)'],
['0.050', 'rgb(255,255, 0)'],
['0.075', 'rgb(191,255, 0)'],
['0.100', 'rgb(128,255, 0)'],
['0.130', 'rgb( 64,255, 0)'],
['0.160', 'rgb( 0,255, 0)'],
['0.200', 'rgb( 0,255, 64)'],
['0.250', 'rgb( 0,255,128)'],
['0.300', 'rgb( 0,255,191)'],
['0.360', 'rgb( 0,191,255)'],
['0.420', 'rgb( 0,128,255)'],
['0.480', 'rgb( 0, 64,255)'],
['0.540', 'rgb( 0, 0,255)'],
['0.700', 'rgb( 64, 0,255)'],
['0.750', 'rgb(128, 0,255)'],
['0.850', 'rgb(191, 0,255)'],
['0.980', 'rgb(255, 0,255)'],
['1.000', 'rgb( 0, 0, 0)'],
];
var z_data0=[ ];
for(i=0;i< Nbins;i++)
{
z_data0.push(unpack(rows,i));
}
var z_data1=[ ];
for(i=Nbins;i<Nbins*2;i++)
{
z_data1.push(unpack(rows,i));
}
var z_data2=[ ];
for(i=Nbins*2;i< Nbins*3;i++)
{
z_data2.push(unpack(rows,i));
}
var z_data3=[ ];
for(i=Nbins*3;i< Nbins*4;i++)
{
z_data3.push(unpack(rows,i));
}
var data0 = [{
z: z_data0,
colorscale: psacolor,
type: 'heatmap'
}];
var data1 = [{
z: z_data1,
colorscale: psacolor,
type: 'heatmap'
}];
var data2 = [{
z: z_data2,
colorscale: psacolor,
type: 'heatmap'
}];
var data3 = [{
z: z_data3,
colorscale: psacolor,
type: 'heatmap'
}];
var layout = {
autosize: true,
margin: {t: 20},
xaxis: { title: 'Energy' },
yaxis: { title: 'PSA value' }
};
Plotly.newPlot('Ch0', data0, layout);
Plotly.newPlot('Ch1', data1, layout);
Plotly.newPlot('Ch2', data2, layout);
Plotly.newPlot('Ch3', data3, layout);
});
</script>
</body>
</html>