Files
radiacode/web/static/css/style.css
Jacquin Antoine 0847a3fc80 Fix: CsI(Tl) non-linear response correction + detector calibration overhaul
Root cause of Am-241 misidentification: the Radiacode 103's CsI(Tl) crystal
shifts low-energy peaks upward (59.5 keV → 71.6 keV for Am-241) due to
non-proportional scintillation response. The model was trained on theoretical
peak positions and couldn't match the shifted real peaks.

Changes:
- Add inverse CsI(Tl) non-linear correction to inference pipeline
  (radiacode_monitor.py, web/config.py, test_detection.py)
  E_apparent = E_true * (1 + 0.37 * exp(-E_true/100))
  Corrects channel mapping so peaks appear at theoretical energies
- Fix energy calibration: DetectorConfig now uses E = 0.33 + 2.97*ch
  with 1023 channels, matching the real detector (was energy_min=20,
  skip_first_channel=True, different channel width)
- Add K-escape peaks for CsI(Tl) iodine X-ray escape (E - 28.5 keV)
- Add asymmetric peak shapes for low-energy tails (< 200 keV)
- Add log1p normalization in dataset and inference (replaces max-norm)
- Add background-subtracted training mode (subtract_background flag)
- Add low-signal augmentation (0.01-5 Bq activities, 30-300s durations)
- Update docker-compose.yml: batch_size=32, duration=30-300s,
  CSI_NONLINEAR_ALPHA/BETA env vars for detect and web
- Web dashboard: apply CsI correction to displayed spectra
- Various UI fixes (Chart.js width, zoom/pan, isotope lines)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 17:35:22 +02:00

252 lines
5.2 KiB
CSS

:root {
--bg: #1a1a2e;
--bg-card: #16213e;
--text: #e0e0e0;
--text-dim: #888;
--accent: #0f3460;
--accent-bright: #4fc3f7;
--green: #4caf50;
--red: #f44336;
--yellow: #ff9800;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
}
header {
background: var(--bg-card);
padding: 12px 20px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #333;
}
header h1 {
font-size: 1.2em;
color: var(--accent-bright);
}
#status-bar {
display: flex;
align-items: center;
gap: 16px;
font-size: 0.9em;
}
.status-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--red);
}
.status-dot.connected { background: var(--green); }
nav {
background: var(--accent);
display: flex;
}
nav a {
flex: 1;
text-align: center;
padding: 10px;
color: var(--text-dim);
text-decoration: none;
font-size: 0.95em;
transition: all 0.2s;
}
nav a:hover { background: rgba(255,255,255,0.1); }
nav a.active { color: var(--accent-bright); border-bottom: 2px solid var(--accent-bright); }
main { padding: 12px 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.controls, .bg-stats, #isotopes-table, #peaks-table, .history-item, .chart-header {
margin-left: 12px;
margin-right: 12px;
}
.chart-container {
background: var(--bg-card);
border-radius: 8px;
padding: 12px;
margin: 0 12px 12px 12px;
height: 450px;
width: calc(100% - 24px);
position: relative;
overflow: hidden;
}
.chart-container canvas {
display: block;
}
.controls {
display: flex;
gap: 12px;
margin-bottom: 12px;
align-items: center;
}
.controls label {
display: flex;
align-items: center;
gap: 6px;
font-size: 0.9em;
color: var(--text-dim);
cursor: pointer;
}
.controls button {
background: var(--accent);
color: var(--text);
border: 1px solid #444;
padding: 6px 14px;
border-radius: 4px;
cursor: pointer;
font-size: 0.85em;
}
.controls button:hover { background: var(--accent-bright); color: #000; }
.btn-small {
background: var(--accent);
color: var(--text);
border: 1px solid #444;
padding: 4px 10px;
border-radius: 4px;
cursor: pointer;
font-size: 0.8em;
margin-left: auto;
}
.btn-small:hover { background: var(--accent-bright); color: #000; }
.chart-container.fullscreen {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 1000;
background: var(--bg);
padding: 20px;
margin: 0;
border-radius: 0;
display: flex;
flex-direction: column;
height: 100vh;
}
.chart-container.fullscreen canvas {
flex: 1;
}
.exit-fullscreen-btn {
display: none;
position: absolute;
top: 10px;
right: 14px;
z-index: 1001;
background: rgba(255,255,255,0.15);
color: #fff;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
font-size: 1.2em;
cursor: pointer;
line-height: 1;
}
.chart-container.fullscreen .exit-fullscreen-btn {
display: flex;
align-items: center;
justify-content: center;
}
.exit-fullscreen-btn:hover {
background: rgba(255,255,255,0.3);
}
.chart-header {
display: flex;
justify-content: flex-end;
margin-bottom: 4px;
}
#isotopes-table, #peaks-table {
background: var(--bg-card);
border-radius: 8px;
padding: 12px;
}
.isotope-row {
display: flex;
justify-content: space-between;
padding: 6px 0;
border-bottom: 1px solid #333;
font-size: 0.9em;
}
.isotope-row:last-child { border-bottom: none; }
.isotope-name { color: var(--accent-bright); font-weight: bold; min-width: 80px; }
.isotope-prob { color: var(--green); min-width: 60px; }
.isotope-activity { color: var(--text-dim); }
.bg-stats {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 12px;
margin-bottom: 12px;
}
.bg-stat {
background: var(--bg-card);
border-radius: 8px;
padding: 12px;
text-align: center;
}
.bg-stat-value { font-size: 1.4em; color: var(--accent-bright); }
.bg-stat-label { font-size: 0.8em; color: var(--text-dim); }
.history-item {
background: var(--bg-card);
border-radius: 8px;
padding: 12px;
margin-bottom: 8px;
cursor: pointer;
transition: background 0.2s;
}
.history-item:hover { background: #1e2a4a; }
.history-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.history-date { font-weight: bold; color: var(--accent-bright); }
.history-cps { color: var(--text-dim); }
.history-isotopes { color: var(--green); font-size: 0.85em; }
.history-details { margin-top: 8px; padding-top: 8px; border-top: 1px solid #333; font-size: 0.9em; display: none; }
.history-details.open { display: block; }
.peak-row {
display: flex;
justify-content: space-between;
padding: 4px 0;
font-size: 0.85em;
}
@media (max-width: 600px) {
.bg-stats { grid-template-columns: repeat(2, 1fr); }
header { flex-direction: column; gap: 8px; }
nav a { font-size: 0.85em; padding: 8px; }
}