<%!
rsc_path = ""
import os
import pipeline.infrastructure.renderer.htmlrenderer as hr
def is_rejected(keep):
desc=''
if not keep:
desc = ' <a style="color:red">rejected</a>'
return desc
%>
<%
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import cm
import matplotlib.colors as colors
def fmt_rms(rms,scale=1.e3):
if rms is None:
return 'N/A'
else:
#return np.format_float_positional(rms*scale, precision=3, fractional=False, trim='-')
return np.format_float_positional(rms*scale, precision=3, fractional=False)
def val2color(x, cmap_name='Greys',vmin=None,vmax=None):
"""
some cmap_name options: 'Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds'
"""
norm=colors.Normalize(vmin, vmax)
x_norm=0.05+0.5*(x-vmin) / (vmax-vmin)
cmap=cm.get_cmap(name=cmap_name)
rgb=cmap(x_norm)
rgb_hex=colors.to_hex(rgb)
return rgb_hex
def dev2color(x):
color_list=['gainsboro','lightgreen','yellow','red']
if x<=4 and x>3:
rgb_hex='#D3D3D3'
if x<=5 and x>4:
rgb_hex=colors.cnames[color_list[1]]
if x<=6 and x>5:
rgb_hex=colors.cnames[color_list[2]]
if x>6:
rgb_hex=colors.cnames[color_list[3]]
return rgb_hex
def dev2shade(x):
color_list=['gainsboro','lightgreen','yellow','red']
cmap=cm.get_cmap(name='Reds')
absx=abs(x)
if absx<4 and absx>=3:
rgb_hex=colors.to_hex(cmap(0.2))
if absx<5 and absx>=4:
rgb_hex=colors.to_hex(cmap(0.3))
if absx<6 and absx>=5:
rgb_hex=colors.to_hex(cmap(0.4))
if absx>=6:
rgb_hex=colors.to_hex(cmap(0.5))
return rgb_hex
border_line="2px solid #AAAAAA"
cell_line="1px solid #DDDDDD"
bgcolor_list=[dev2shade(3.),dev2shade(4.),dev2shade(5.),dev2shade(6.)]
%>
<%inherit file="t2-4m_details-base.mako"/>
<style type="text/css">
.table {
border-collapse: collapse;
vertical-align: middle;
text-align: center;
}
.table td {
border-collapse: collapse;
vertical-align: middle;
text-align: center;
font-size: 12px;
}
.table th {
border-collapse: collapse;
vertical-align: middle;
text-align: center;