Skip to content

Cal drift: gain-standard recertification reminder #59

@RFingAdam

Description

@RFingAdam

Background

The same gain-standard file (Howland BLPA-19 3100 Gain 2021-10-14.txt) is reused across every active calibration run in the archive: 2021, 2023, 2024, 2026. If the physical gain standard itself drifts between recertification events, every cal that uses it is biased — and the v1 drift tracker cannot detect this from data alone.

Industry practice is to recertify primary gain standards every 1–2 years.

Goal

Warn the operator when the gain-standard file in use is older than a configurable age threshold, and surface this in drift comparisons.

Acceptance Criteria

  • New setting: cal_drift.gain_std_max_age_days (default 730 = 2 years).
  • On record_run(), extract the gain-standard file's embedded date (filename like ... Gain 2021-10-14.txt or header-parsed if present) and compare to today.
  • If older than threshold, log a warning and set a new CalRunMeta.gain_std_stale flag; surface in the GUI dialog as a yellow icon on the consistency tab.
  • Drift comparison report (markdown/PDF) includes a "Calibration-standard age" row with warning when stale.
  • MCP: cal_drift_list_runs(stale_gain_std_only=True) filter.
  • Tests: synthetic gain-standard files dated 3 years ago → flag set; 6 months ago → not set.
  • Docs: tooltip in dialog explains what "stale gain standard" means and recommends recertification.

Notes

  • Do not automatically fail or block cal generation — this is advisory only. Operators know their standards better than a date heuristic.
  • Consider adding a one-time dismissal per standard so recertified files that retain the old 2021-10-14 name (just reusing) don't keep warning.

Related: v1 tracker at plot_antenna/cal_drift.py. Consistency-check table lives in compute_drift()_consistency().

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions