Skip to content

slicecamd: structured [ACQMODEL] log line at fine-acquire lock (for ACAM geometry model)#454

Open
cfremling wants to merge 3 commits into
mainfrom
feat/acqmodel-logging
Open

slicecamd: structured [ACQMODEL] log line at fine-acquire lock (for ACAM geometry model)#454
cfremling wants to merge 3 commits into
mainfrom
feat/acqmodel-logging

Conversation

@cfremling

@cfremling cfremling commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

What

Adds one structured log line at fine-acquire convergence (lock):

[ACQMODEL] acam2slit dRA=<tot> dDEC=<tot> arcsec GOALRA=<deg> GOALDEC=<deg> CASANGLE=<deg> n=<n> cam=<L|R>
  • dRA/dDEC = total ACAM→slit residual = sum of the corrections fine-acquire applied during the run (the offset acam-acquire left behind), accumulated in two per-run members reset at run start.
  • GOALRA/GOALDEC = the target's goal coordinates read from the database (the sequencer passes them on the fineacquire start goal <ra> <dec> command).
  • CASANGLE = the actual cassegrain rotator angle (TCS telemetry).

Why

The ACAM astrometric acquire leaves the target a few arcsec off the slit, and slicecam fine-acquire removes that residual on every acquisition. Logging residual vs geometry, run after run, is the dataset needed to build/refine a geometric model of the ACAM→slit offset (and to recalibrate the FPoffsets D_A/Theta parameters — a small angle error there is amplified by the ~8′ ACAM↔slit baseline into a cass-dependent residual).

Crucially, the geometry must be fit against the GOAL coordinates — the input to the SCOPE→ACAM transform — not the telescope's actual RA/DEC. The actual pointing is the output of acam-acquire and drifts as fine-acquire applies offsets, so logging it would be circular. Altitude/hour-angle are derived offline from GOALRA/GOALDEC + the line's timestamp.

Risk

None to operations — pure logging plus three per-run doubles. The sequencer change only appends the DB goal to the existing fine-acquire start command (slicecamd parses it as an optional goal <ra> <dec>; manual runs without it log nan). No control-path change.

🤖 Generated with Claude Code

cfremling and others added 3 commits June 16, 2026 17:05
Emit one structured line at fine-acquire convergence with the total
ACAM->slit residual (sum of the corrections applied during the run)
paired with the pointing geometry: cass rotator angle, altitude
(from airmass), azimuth, and telescope RA/DEC (TCS telemetry).

Why: the ACAM astrometric acquire leaves the target a few arcsec off
the slit, and fine-acquire removes that residual every time. Logging
the residual vs geometry, run after run, lets us build/refine a
geometric (flexure) model of the ACAM->slit offset over time so
acam-acquire can pre-compensate it -- fewer fine-acquire iterations
and fewer non-converging acquisitions. Today this signal is only
recoverable by scraping per-correction "requested offsets" lines
(which are unit-ambiguous and interleaved with manual put-on-slit).

No behavior change: pure logging plus two per-run accumulators reset
at run start. HA is derived offline from TELRA + the line timestamp,
so no site ephemeris is added to the daemon.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The [ACQMODEL] line previously logged the telescope's actual RA/DEC (TELRA/
TELDEC from TCS telemetry). That is the OUTPUT of acam-acquire and drifts as
fine-acquire applies offsets, so it cannot be used to fit the SCOPE->ACAM
geometry. Log the target's GOAL coordinates instead -- the INPUT to the
transform -- sourced from the database by the sequencer.

- sequencerd: do_slicecam_fineacquire passes the DB target coords on the
  fineacquire start command ("... start goal <ra_deg> <dec_deg>").
- slicecamd: fineacquire parses/strips the optional "goal <ra> <dec>", stores
  it, and the [ACQMODEL] line now reports GOALRA/GOALDEC + CASANGLE (actual
  rotator angle) + total ACAM->slit residual. Dropped TELRA/TELDEC and the
  ALT/AZ/AIRMASS fields -- altitude/hour-angle are derived offline from
  GOALRA/GOALDEC + the line timestamp.

Manual "fineacquire start" without goal logs GOALRA/GOALDEC as nan.
Still pure logging plus per-run accumulators; no control-path change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@astronomerdave

Copy link
Copy Markdown
Contributor

I reworked how the [ACQMODEL] line obtains the GOAL (DB target) coords. Instead of the sequencer appending goal <ra> <dec> to the fineacquire start command, slicecamd now subscribes to Topic::TARGETINFO (already published by sequencerd) and snapshots the goal at fine-acquire start.

@astronomerdave astronomerdave requested review from prkrtg and scizen9 June 23, 2026 18:53
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.

2 participants