Skip to content

Show when the SQM reading is still converging #601

Description

@brickbots

Background

Field report from a user comparing PiFinder's SQM against a Unihedron SQM-L: the
final values agreed closely (21.44 vs 21.43), but panning from a bright patch of
sky to a dark one showed ~19 at first and took roughly half a minute to settle on
21.44. Because the title bar now always shows an SQM number, there is no cue
that the displayed value is still converging — it reads as a finished
measurement the whole time.

Why it happens

This is the rolling window working as designed, not a photometry fault.
RadiometerAccumulator (python/PiFinder/sqm/radiometer.py:224) publishes the
median of up to 12 radiometer samples inside a 15-second window:

max_samples: int = 12
max_age_seconds: float = 15.0
...
value = float(np.median(values))

A median does not move until more than half the window has been replaced, so
after a slew the published value stays blended across two patches of sky for the
length of the window. At night-time frame cadence that is comfortably the ~30
seconds the user observed.

Proposal

Surface the convergence state in the UI. No new photometry is required —
RadiometerAccumulator.estimate() already computes and returns both signals in
its details dict:

  • radiometer_samples — how many samples in the window were accepted
  • radiometer_frame_scatternp.std() across the window's values

Plumb these through to the UI and render a settling cue while the window is
mixed or scatter is high. Consumers to update:

  • python/PiFinder/ui/sqm.py — the SQM screen's main value
  • python/PiFinder/ui/base.py:47RotatingInfoDisplay, the title-bar readout,
    which already has a "---" path for the no-data case that a settling state
    could reuse

Presentation is open — dimming the value, a small progress pip, or dashing it
until the window is coherent would all work. The requirement is only that a user
can tell "still settling" from "this is the reading".

Supersedes

This was chosen over a separate proposal to carry the measurement's RA/Dec in
state.SQM and blank the reading once the telescope moved more than 10–20°.
That approach needs a shared-state dataclass change across two processes, and it
degrades badly when there is no solve (SQM is deliberately solve-independent, so
pointing may be unknown or IMU-only). Showing convergence directly is a better
solution: it uses data the accumulator already produces, needs no pointing, and
covers every cause of an unsettled window — not just deliberate slews.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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