Skip to content

Update to Dark Script#368

Open
edenacadia wants to merge 5 commits into
devfrom
eden/dark-script
Open

Update to Dark Script#368
edenacadia wants to merge 5 commits into
devfrom
eden/dark-script

Conversation

@edenacadia

@edenacadia edenacadia commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Update to collect_camera_configs_for_darks and shot_in_the_dark python scripts for end-of-night dark taking.

Summary

Initial work done to make script compatible with new datetime file formats.
This work written in part by Codex 5.3 in response to the prompt: "In the shot_in_the_dark script, we need a way to cleanly exit on a keyboard interrupt. When interrupted, the script should print out a "exiting" statement, release control of the cameras and shutters, and save a json file with the darks remaining to do".

  • Extend collect_camera_configs_for_darks to support richer date/time filtering (--night, --date-start/--date-end, and --last-night) and include observation directory metadata in output for better provenance.
  • Improve dark-config collection robustness by expanding ignored header keys, adding timestamp parsing helpers, and tightening validation/logging for partial or dark-only samples.
  • Add graceful interrupt handling in shot_in_the_dark: print exiting, stop worker threads cooperatively, persist remaining dark configurations to *_remaining.json, and always run cleanup to return observing/streamwriter/camera state to safe defaults (including EM gain reset).

Test plan

  • python -m py_compile scripts/shot_in_the_dark
  • Run collect_camera_configs_for_darks with:
    • --night YYYY-MM-DD
    • --date-start YYYY-MM-DD_HHMMSS --date-end YYYY-MM-DD_HHMMSS
    • --last-night
  • Run shot_in_the_dark against a small config and press Ctrl+C mid-run; verify:
    • exiting is printed
    • cleanup logs confirm observing + streamwriter shutdown and EM gain reset
    • <input>_remaining.json is written with unfinished configs
  • Confirm normal (non-interrupted) run behavior is unchanged.

@edenacadia edenacadia requested review from a team and joseph-long April 22, 2026 21:31
@joseph-long

Copy link
Copy Markdown
Member

Looking good! There are some print()s that could be logs, etc, but I think it's good to begin testing.

@edenacadia

Copy link
Copy Markdown
Contributor Author

@joseph-long Cleaned up print statements and finished testing

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