Skip to content

Chart: revive target cross, add nearby-DSO markers + zoom-scaled mag filter#513

Open
brickbots wants to merge 2 commits into
mainfrom
worktree-chart-markers
Open

Chart: revive target cross, add nearby-DSO markers + zoom-scaled mag filter#513
brickbots wants to merge 2 commits into
mainfrom
worktree-chart-markers

Conversation

@brickbots

Copy link
Copy Markdown
Owner

Summary

The chart screen's target cross was dead codeui_state.set_target() lost all callers in the object_details/object_list refactor, so ui_state.target() was always None and the cross never drew. Nearby catalog DSOs were never plotted (only a loaded observing list ever was), so on a fresh session with no list loaded the chart looked bare. This PR fixes both and adds a zoom-scaled magnitude filter for the new nearby layer.

What changed

  • ui/object_details.pyset_target(self.object) in update_object_info(), the single chokepoint for open / scroll / eyepiece-cycle / display-mode-cycle. The cross now tracks the last-viewed object immediately (not push-to, no 10s dwell lag).
  • ui/chart.pyplot_markers() restructured into three deduped layers:
    • Target cross — its own pass, full brightness, independent of chart_dso (survives chart_dso=0), with its designator label when on-screen (off-screen shows the existing pointer arrow, no label).
    • Observing list (unchanged) + new nearby layer, both at chart_dso brightness.
    • Deduped by object_id, precedence target → observing-list → nearby.
    • New module-level dso_mag_limit(fov): linear mag 11 @ 5° → mag 7 @ 60°, clamped; unknown mags (filter_mag == 99) hidden.
    • Nearby set = active "All Filtered" catalog objects within fov * 0.75°, mag-filtered, capped at the brightest 20. The BallTree is rebuilt only when the filter's dirty_time changes or deferred catalogs finish loading — never per frame; the radius query runs on the new-solve path only.
  • nearby.pyClosestObjectsFinder.get_objects_within_radius() via BallTree.query_radius (haversine), reusing the existing M/NGC dedup.
  • main.py — mark the filter dirty on catalogs_fully_loaded so the chart's index rebuilds to include newly loaded (e.g. WDS) objects.
  • docs/ax/ui/CONTEXT.md — new Target glossary term resolving target vs selected object.

Mag-curve endpoints and the fov * 0.75 radius margin are starting values to tune on-device (per the plan).

Testing

  • Unitdso_mag_limit endpoints/clamp/linearity; get_objects_within_radius correctness + dedup; nearby selection mag-filter/cap/type-filter, dedup precedence, and index-rebuild-only-on-dirty (stubbed Starfield, no hip_main.dat needed).
  • Integrationset_target tracks the object on open and scroll via a real UIObjectDetails; existing chart UI-module smoke still passes (real Starfield + real solve).
  • Live (headless app) — verified the on-screen cross + "M 57" label (Ring Nebula on-field), the off-screen pointer for NGC 1, and nearby markers rendering.

🤖 Generated with Claude Code

brickbots and others added 2 commits June 30, 2026 19:25
…filter

The chart screen's target cross was dead code (ui_state.set_target had no
callers after the object_details/object_list refactor, so ui_state.target()
was always None), nearby catalog DSOs were never plotted, and on a fresh
session with no observing list loaded the chart drew no markers at all.

This wires the target to selection and adds a nearby-catalog marker layer:

- object_details: set_target(self.object) in update_object_info() -- the one
  chokepoint for open/scroll/eyepiece-cycle -- so the cross tracks the
  last-viewed object immediately (no push-to, no dwell lag).
- chart.plot_markers(): restructured into deduped layers. The target cross is
  drawn in its own pass at full brightness, independent of chart_dso (so it
  survives chart_dso=0), with its designator label when on-screen. When
  chart_dso > 0, the observing-list layer (unchanged) and the new nearby layer
  render at chart_dso brightness. Deduped by object_id with precedence
  target -> observing-list -> nearby.
- Nearby layer: objects from the active "All Filtered" set within fov*0.75 deg,
  magnitude-filtered by a zoom-scaled limit (dso_mag_limit: mag 11 @ 5deg ->
  mag 7 @ 60deg, unknown mags hidden), capped at the brightest 20. The
  BallTree is rebuilt only when the catalog filter's dirty_time changes or
  deferred catalogs finish loading -- never per frame; the radius query runs
  on the new-solve path only.
- nearby: add ClosestObjectsFinder.get_objects_within_radius (query_radius,
  haversine), reusing the existing M/NGC dedup.
- main: mark the filter dirty on catalogs_fully_loaded so the chart's index
  rebuilds to include newly loaded (e.g. WDS) objects.
- docs: add the "Target" term to docs/ax/ui/CONTEXT.md resolving the
  target vs selected-object distinction.

Mag-curve endpoints and the radius margin are starting values to tune
on-device. Tested: dso_mag_limit endpoints/clamp, get_objects_within_radius
correctness, nearby mag/cap/dedup selection (stubbed Starfield), and
set_target tracking on open+scroll via the real UIObjectDetails; verified
live via the headless app (on-screen cross+label for M57, off-screen pointer
for NGC 1, nearby markers rendering).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #513 revives the chart's target cross and makes nearby-DSO markers
actually appear (magnitude-filtered by zoom). The Star Chart section
claimed 'markers for nearby objects' but never explained them; add prose
covering the object-type symbols, the filter/zoom behaviour and the
DSO Display brightness tie-in, plus the last-viewed-object cross with its
on-screen designation label and off-screen pointer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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