-
Notifications
You must be signed in to change notification settings - Fork 18
New Agent: tauHK #961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
merny93
wants to merge
24
commits into
main
Choose a base branch
from
tauhk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New Agent: tauHK #961
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
dd00b3d
inital tauHK code
merny93 86971d6
handling multiple data rates
merny93 c9a07fb
Commented out the commanding as that is being reworked but added subp…
merny93 026a61f
added commanding logic and advertising. Added load from config
merny93 d671dc3
made field definitions work with ocs-web components
merny93 e1663a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1646402
working on amun
merny93 1976725
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 31f1caf
added a downsampled feed for influx as full data rate was too much
merny93 13bf0a6
merge conflict resolution. not sure with what but oh well
merny93 55fa972
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c5c5093
Merge branch 'main' into tauhk
merny93 1288ae0
Fix loading/running files from relative paths
BrianJKoopman 4bfd4db
Fix pb2 import
BrianJKoopman 66efc19
Remove tauhk_logs feed and relog to stdout
BrianJKoopman 4c218cb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 491228e
Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks"
BrianJKoopman 5f76691
Revert "Remove tauhk_logs feed and relog to stdout"
BrianJKoopman d9cad29
Remove tauhk_logs feed and relog to stdout
BrianJKoopman c866f49
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 32a420f
Capitalize agent-class
BrianJKoopman 32a31d2
Working on rst docs
merny93 4eb66b9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4a82629
Start processes and load excitations on startup
BrianJKoopman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| .. highlight:: rst | ||
|
|
||
| .. _tauhk: | ||
|
|
||
| =========== | ||
| tauHK Agent | ||
| =========== | ||
|
|
||
| The tauHK system is an all in one cryogenic temperature control system. | ||
| More information can be found in the accompanying `paper <https://pubs.aip.org/aip/rsi/article/96/9/094902/3363308/HK-A-modular-housekeeping-system-for-cryostats-and>`_. | ||
|
|
||
| .. argparse:: | ||
| :filename: ../socs/agents/tauhk/agent.py | ||
| :func: make_parser | ||
| :prog: python3 agent.py | ||
|
|
||
| Dependencies | ||
| ------------ | ||
|
|
||
| The tauHK hardware comumunicates over ethernet with a static IP setup. | ||
| The hardware for the LAT has been configured to a static IP ``10.1.0.74`` and expects the control computer to be found at ``10.1.0.77``. | ||
|
|
||
| ``amun`` has been outfitted with a usb to ethernet device, this device can be configured with:: | ||
|
|
||
| $ sudo ip addr add 10.1.0.77/24 dev enx14ebb6850591 # set the IP | ||
| $ sudo ip link set enx14ebb6850591 up #bring up the dev if it is down (does not show up in ifconfig without -a flag) | ||
|
|
||
| The direct interaction with the hardware is handled by a percompiled binnary, please contact a member of the taurus cmb collaboration to obtain a copy. | ||
| This binary must be named ``tauhk-agent`` and placed in the same directoy as the ``agent.py``. | ||
|
|
||
| Finally, channel mappings must be provided in the form of a `protobuf <https://protobuf.dev/>`_ file descriptor. | ||
| This file descriptor is generated from a experiment configuration yaml with the following syntax:: | ||
|
|
||
| - rtd: # RTD card type | ||
| position: 2 # Physical card position in the crate (zero indexed) | ||
| channels: | ||
| - name: rtd_0 # Channel name mapping | ||
| channel: 0 # Card channel number (zero indexed) | ||
| lut: luts/table.lut # path to look up table for converting from native units to temperature | ||
| - name: rtd_1 # Name is mandatory | ||
| channel: 1 # Channel number is mandatory | ||
| # lut is optional | ||
| - diode: # Diode card type | ||
| position: 4 | ||
| channels: | ||
| - name: diode_0 | ||
| channel: 0 | ||
| lut: /abs_path/table.lut | ||
|
|
||
| The config file is then turned into a ``.proto`` file with ``python3 generate_proto`` which is turned into a file descriptor with:: | ||
|
|
||
| $ protoc --file-descriptor-out=descriptor.bin --include-imports system.proto | ||
|
|
||
| The tauHK binary expects this file descriptor to be named ``descriptor.bin`` in the same directoy as ``agent.py``. | ||
|
|
||
| For tauHK to output data in temperature units, lookup tables must be provided. | ||
| These lookup tables need to formated as follows:: | ||
|
|
||
| # Comments must have a leading pound sign | ||
| # Data must be in sorted increasing order | ||
| # Map from native units (ohms for RTD and volts for Diode) to temperature | ||
| 0.234515 300 | ||
| 0.245463 275 | ||
| # and so on... | ||
|
|
||
| Configuration File Examples | ||
| --------------------------- | ||
|
|
||
| Todo. if this is dockerized this will look different I suspect | ||
|
|
||
| Example Clients | ||
| --------------- | ||
|
|
||
| Device Configuration | ||
| ```````````````````` | ||
|
|
||
| The tauHK agent will not stream data (or really do anything) on it's own. | ||
| First, the binary must be launched with the ``start_crate`` process, the logs from the binary are re-logged into the agent logs for introspection. | ||
| To begin logging data the ``recieve_data`` process must be run, this starts the data stream to influx and to ``.g3`` files. | ||
|
|
||
| Commands can be sent via the ``generic_send`` task, allowing users to command individual channels or with ``load_excitation`` for multiple channels at the same time. | ||
|
|
||
| Agent API | ||
| --------- | ||
|
|
||
| .. autoclass:: socs.agents.tauhk.agent.TauHKAgent | ||
| :members: |
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is largely incomplete. There's a complete example in the ocs docs. You can also see any other agent's reference page for an example. Important things missing:
argparseblock, which automatically displays arguments for the agentCould you also add it to the index (in alphabetical order)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the first link may be incorrect. Was it supposed to point to: https://flake8.pycqa.org/en/latest/user/violations.html#in-line-ignoring-errors
Can you provide the link you had in mind please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, sorry about that, updated in the original post. It's here: https://ocs.readthedocs.io/en/main/developer/agent_references/documentation.html