Skip to content

Chart: orientation indicator + flag NCP-up fallback when GPS isn't ready (#419)#444

Merged
brickbots merged 2 commits into
mainfrom
feature/chart-orientation-indicator
May 30, 2026
Merged

Chart: orientation indicator + flag NCP-up fallback when GPS isn't ready (#419)#444
brickbots merged 2 commits into
mainfrom
feature/chart-orientation-indicator

Conversation

@brickbots
Copy link
Copy Markdown
Owner

@brickbots brickbots commented May 28, 2026

Closes #419.

Summary

  • The chart used to silently fall back to NCP up when the user picked Horizontal or EQ (Auto) but no GPS lock was available, then flip to the real orientation once GPS arrived. Since "horiz" is the shipped default (default_config.json:19), this is the normal first-run experience and was confusing.
  • Adds a small bottom-right label on the Chart screen showing what's at the top of the chart — Zenith up, NCP up, or SCP up — so the user can always see the current orientation.
  • When the resolved orientation is a fallback (Horizontal or EQ-Auto chosen but no GPS lock yet), the label is prefixed with ! and rendered at higher brightness, flagging that the chart will reorient once GPS comes online.

Changes

  • python/PiFinder/ui/chart.py
    • New ChartOrientation dataclass (rot_deg, up_label, is_fallback).
    • get_chart_rotation_angle now returns it. Resolution is unchanged for eq_north_up / eq_south_up and for the GPS-locked branches of horiz / eq_auto. The lockless horiz and eq_auto branches now use location.lock (matching the canonical altaz_ready() test in state.py) and set is_fallback=True so the UI can flag the NCP-up default as transient.
    • UIChart.update draws the label after the chart paste.
  • python/PiFinder/ui/align.py — caller updated to unpack rot_deg from the new return type. No behavior change for the align screen itself.
  • python/tests/test_chart.py — new file, 11 unit tests covering each coord-sys × GPS-present/absent case plus the None RA/Dec path.
  • .claude/skills/pifinder-remote/SKILL.md — documents the two one-time worktree-setup steps the headless launcher needs but git worktrees don't inherit (copy the Hipparcos catalog and the tetra3 submodule contents in from the main checkout), plus the venv-activation requirement so the launcher's find_python picks up the main checkout's interpreter via sys.executable.

Test plan

  • pytest -m unit tests/test_chart.py — 11 new tests pass.
  • pytest -m unit overall — 159 tests pass (148 pre-existing + 11 new).
  • ruff check clean on chart.py, align.py, test_chart.py.
  • Live UI: launched headless from a fresh worktree, navigated to Chart, screenshot shows Zenith up rendered at bottom-right alongside the optional RA/Dec line at bottom-left. (Headless --camera debug provides a fake GPS lock, so the rendered case is the non-fallback path; the !NCP up fallback rendering goes through the same code with different text + brightness — both unit-tested.)
  • On-device confirmation: power up indoors (or otherwise pre-lock) with default config (chart_coord_sys = "horiz"), open Chart, confirm !NCP up shows immediately, then Zenith up after GPS lock.

🤖 Generated with Claude Code

brickbots and others added 2 commits May 28, 2026 13:31
…dy (#419)

The chart silently fell back to NCP up when the user picked Horizontal or
EQ (Auto) but no GPS lock was available yet, then flipped to the "real"
orientation once GPS arrived. With "horiz" as the shipped default
(default_config.json:19), this is the normal first-run experience and was
confusing.

Changes:

- python/PiFinder/ui/chart.py:
  - New ChartOrientation dataclass (rot_deg, up_label, is_fallback).
  - get_chart_rotation_angle now returns it. Resolution is unchanged for
    eq_north_up / eq_south_up, and for the GPS-locked branches of horiz /
    eq_auto. The lockless horiz and eq_auto branches now use location.lock
    (matching the canonical altaz_ready() test in state.py) and set
    is_fallback=True so the UI can flag the NCP-up default as transient.
  - UIChart.update draws a small bottom-right label after the chart paste:
    "Zenith up" / "NCP up" / "SCP up", prefixed with "!" and rendered at
    higher brightness when is_fallback=True.

- python/PiFinder/ui/align.py: caller updated to unpack rot_deg from the
  new return type.

- python/tests/test_chart.py: new file, 11 unit tests covering each
  coord-sys × GPS-present/absent case plus the None RA/Dec path.

- .claude/skills/pifinder-remote/SKILL.md: document the two one-time
  worktree-setup steps the headless launcher needs but git worktrees don't
  inherit (Hipparcos catalog copy + tetra3 submodule contents copy), plus
  the venv activation requirement so the launcher's find_python picks up
  the main checkout's interpreter via sys.executable.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@brickbots brickbots merged commit 4e0183f into main May 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant