Skip to content

Keyheader daemon - #52

Open
scizen9 wants to merge 11 commits into
mainfrom
don/add_keyheader
Open

scizen9 wants to merge 11 commits into
mainfrom
don/add_keyheader

Conversation

@scizen9

@scizen9 scizen9 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Making this a draft until I can test it out.

Comments welcome. Test results soon.

scizen9 and others added 11 commits September 29, 2026 16:44
A requesting daemon asks for a named segment at a moment and gets back
{keyword, value, comment} entries ready for astropy. Values come from the
keygrabber's database, chosen per card by interpolate, nearest, prior or
subsequent within a window.

Config load rejects malformed or FITS-reserved keywords, and any FITS
keyword repeated within or across segments. Segments and cards are lists,
since YAML silently drops a repeated mapping key. A missing or unusable
value is written as a blank card whose comment gives the reason.

The InfluxDB settings check moves out of build_sink into a shared
influx_settings() so the sink and the new source validate alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A commented keyheader.example.yaml with EXP-BEGIN and EXP-END segments
mapped from real hispec keywords. It ships as package data, and a test
parses it so a change to the validation rules cannot leave it stale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is way keywords can be used for other cameras.
@scizen9
scizen9 marked this pull request as ready for review November 12, 2026 22:50
@scizen9

scizen9 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator Author

Tested from my laptop by starting the keyheader daemon draft from hispec branch don/add_keyheader_daemon and using hispec.caltech.edu for rabbitmq and InfluxDB. Once the daemon was connected, I was able to submit a request from another window and received a well-formed reply.

Comment thread docs/source/keyheader.md

defaults:
mode: nearest
window_s: 300

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

keygrabber stamps each sample with the time the poll started (daemon.py:366), not when the hardware reported the value. At EXP-END, the newest stored “prior” sample can be up to one poll interval plus the write delay old, or more if the keygrabber is backed off. Might be best to explain that prior means "last stored sample", not "the state at that moment"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Would it be possible to change this behavior to stamping with the time when the hardware reported the value? This seems desireable.

Comment thread libby/keyheader/daemon.py Resolved

This branch has not been deployed

No deployments
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.

3 participants