Skip to content

Add python -m RMS launcher and a headless station status command#925

Open
dvida wants to merge 3 commits into
prereleasefrom
rms-launcher-status
Open

Add python -m RMS launcher and a headless station status command#925
dvida wants to merge 3 commits into
prereleasefrom
rms-launcher-status

Conversation

@dvida

@dvida dvida commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #922 (includes its commit; this PR's own diff is the second commit). Merge #922 first and this diff will shrink to just the launcher/status changes.

  • RMS/__main__.py: running python -m RMS lists ~27 of the most commonly used tools grouped by topic (station operation, calibration, camera setup, viewing & media, configuration, analysis), and python -m RMS <command> [args...] dispatches to the corresponding module via runpy. Purely additive — every tool remains runnable directly as a module, and existing python -m Utils.X / python -m RMS.X invocations are unaffected.
  • Utils/StationStatus.py (python -m RMS status): headless station health report that works over SSH with no display:
    • Last night (from the observation summary database): FF files captured vs expected, lost capture time, first/last FF and detection times, days since last detection, tracebacks in the log, time sync status, repository lag, camera pointing/FOV
    • Current state: disk free in the data directory, camera reachability (ping), next capture start time and duration
    • --json for scripting; degrades gracefully to "No observation data yet" on fresh installs without creating the database as a side effect
  • Adds a getLatestObservationRecord() read helper to RMS/Formats/ObservationSummary.py
  • README: short "Available tools" section pointing at python -m RMS

Testing

  • python -m RMS prints the grouped tool list; python -m RMS <cmd> -h dispatches correctly (verified with capture-duration, skyfit); unknown commands exit with a hint
  • python -m RMS status and --json verified against a synthetic 2-night observation database (picks the latest night, formats all fields) and against an empty data directory
  • python -m RMS.StartCapture --help and other direct module invocations unchanged

🤖 Generated with Claude Code

dvida and others added 2 commits July 7, 2026 09:22
Add RMS/CLITools.py with addConfigArgument() and loadConfig() helpers
that standardize the -c/--config argument without the legacy nargs=1
pattern, and normalize str/list inputs before calling
loadConfigFromDirectory.

Convert the five scripts that still parsed sys.argv by hand to argparse
so they all support -h/--help: PointsViewer, Grouping3DRunner,
setAllCameraParams, SetCameraAddress, and SaturationSimulation (which
previously had no CLI at all - its hardcoded demo parameters are now
arguments with the old values as defaults).

Also fixes a NameError crash in PointsViewer (plt.title referenced an
undefined variable) and removes its hardcoded .config path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New RMS/__main__.py: running "python -m RMS" lists the most commonly
used tools grouped by topic, and "python -m RMS <command> [args...]"
dispatches to the corresponding module via runpy. Every command remains
runnable directly as a module, so existing invocations are unaffected.

New Utils/StationStatus.py ("python -m RMS status"): a station health
report that works over SSH with no display. Shows how the last night
went (FF files captured vs expected, lost capture time, first/last
detection, days since last detection, tracebacks in the log, time sync,
repository lag, camera pointing) from the observation summary database,
plus the current state (disk space, camera reachability, next capture
start). A --json flag outputs the report for use in scripts, and the
command degrades gracefully on fresh installs with no data yet.

Adds a getLatestObservationRecord() read helper to ObservationSummary
and documents the launcher in the README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1bc6e0d60e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Utils/StationStatus.py Outdated
Comment thread Utils/StationStatus.py Outdated
Route the config-loading banner prints to stderr when --json is used,
so stdout contains only the JSON document.

Pass a naive UTC time (RmsDateTime.utcnow) to getObservationDuration -
the capture duration code subtracts ephem's naive datetimes, so a
timezone-aware value raised TypeError during an active night and the
report showed "Next capture: n/a".

Co-Authored-By: Claude Fable 5 <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