fix(psd): add angle labels to PSD band decomposition cards

This commit is contained in:
2026-01-29 23:58:14 +00:00
parent a1000052cb
commit 12afd0c54f

View File

@@ -415,7 +415,7 @@ def make_psd_plot(psd_data_dict, title="Power Spectral Density"):
return fig.to_html(include_plotlyjs=False, full_html=False, div_id="psd_plot")
def _psd_summary_html(band_dict):
def _psd_summary_html(band_dict, label=""):
"""Generate an HTML summary card for PSD band RMS values."""
m = band_dict
total = m['total_rms']
@@ -425,7 +425,7 @@ def _psd_summary_html(band_dict):
return f"""
<div class="sf-breakdown">
<h4>PSD Band Decomposition (Tony Hull Methodology)</h4>
<h4>{'PSD Band Decomposition — ' + label if label else 'PSD Band Decomposition (Tony Hull Methodology)'}</h4>
<div class="sf-band-grid">
<div class="sf-band-card sf-lsf">
<div class="sf-band-label">Gravity Signature</div>
@@ -979,9 +979,9 @@ def generate_report(
print(f" [WARN] PSD for {ang_label} failed: {e}")
psd_plot_html = make_psd_plot(psd_plot_data) if psd_plot_data else ""
psd_summary_40 = _psd_summary_html(psd_bands['40° vs 20°']) if '40° vs 20°' in psd_bands else ""
psd_summary_60 = _psd_summary_html(psd_bands['60° vs 20°']) if '60° vs 20°' in psd_bands else ""
psd_summary_90 = _psd_summary_html(psd_bands['90° (Abs)']) if '90° (Abs)' in psd_bands else ""
psd_summary_40 = _psd_summary_html(psd_bands['40° vs 20°'], '40° vs 20° (Relative)') if '40° vs 20°' in psd_bands else ""
psd_summary_60 = _psd_summary_html(psd_bands['60° vs 20°'], '60° vs 20° (Relative)') if '60° vs 20°' in psd_bands else ""
psd_summary_90 = _psd_summary_html(psd_bands['90° (Abs)'], '90° Manufacturing (Absolute)') if '90° (Abs)' in psd_bands else ""
# Per-angle RMS plot
angle_rms_data = {}