Mini utility that handles pictures taken for QUAK/ESR experiment by ThorCam camera
Project description
QUAK/ESR ThorCam interface
Note: Work in progress
This is a small Python service that runs on a Windows machine to which the ThorCam is attached to provide a bridge into the control system that has been realized on an OpenSource platform - it exposes an MQTT interface for configuration of camera settings and queue configuration as well as event signalling and allows to transfer images taken using SFTP.
Since the required .NET library to interface with the not so simple to handle closed source ThorCam library this application only runs on Windows.
Installation
pip install quakesrthorcam-tspspi
Configuration file
MQTT section
The MQTT section configures the broker, port, user
and password of the MQTT broker. The basetopic is a topic string
that gets prepended to every message and to every subscription.
Currently this module subscribes to the following topics:
triggerwill allow software triggering of the camera (currently not implemented)setrunsets the current run parameters. Those are a currentrunprefixwhich is a single string that gets prepended in front of every filename and an optional list of strings calledrunsuffixthat are used instead of numbering the frames in consecutive order on each hardware trigger.exposure/setallows one to pass a message containing anexposure_msfield to update the exposure. The camera interrupts streaming and triggering operation during changes.
The camera publishes:
raw/storedwhenever a new raw frame has been stored and uploaded to the configured servers. It contains alocalfilenameand aimagefilename. The local filename also includes the path on the camera server while the image filename is just the filename without any path by itself.
Camera section thorcam
serialis able to specify the serial number of the camera that the service should bind to. In case no serial is specified the first available camera is usedtriggeris an dictionary that is able to configure the default trigger settings:hardwarecan betrueorfalsecountspecifies the number of frames to capture after the trigger has triggered the camera. This has to be either 0 for continuous capture or an positive integer.
exposurecan be used to set the default exposure (in milliseconds)
Local file storage
imagedirspecifies the directory where images should be stored locally
Upload configuration (SFTP)
rawframesftpis a list of hosts to which the camera server should upload captured raw frames. Each entry is a dictionary that contains:hostspecifies the host to which the upload should be madeuserspecifies the SSH userdestpathis the path on the remote machine where the images should be storedkeyfilepoints to the SSH private key file that should be used for authentication
Example configuration file
{
"mqtt" : {
"broker" : "10.0.0.5",
"port" : "1883",
"user" : "YourMqttUser",
"password" : "NONDISCLOSEDSECRETLONGSTRING",
"basetopic" : "quakesr/experiment/camera/ebeam"
},
"thorcam" : {
"trigger" : {
"hardware" : true,
"count" : 1
},
"exposure" : 80
},
"imagedir" : "c:\\temp\\",
"rawframesftp" : [
{
"host" : "10.0.0.15",
"user" : "camserv",
"keyfile" : "c:\\users\\quak\\id_winselwolf",
"destpath" : "/home/pi/measurements/data/images/"
}
]
}
Dependencies
- paho-mqtt is the Eclipse Paho MQTT Python client that provides the interface to the MQTT broker (currently running on an RabbitMQ instance)
- thorcam is a wrapper around the .NET libraries supplied for the ThorCam service.
- paramiko is a pure Python SSHv2 implementation mainly used for file transfer in this application.
- Pillow is a python image library (PIL) clone that's used to encode the images.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quakesrthorcam-tspspi-0.0.1a9.tar.gz.
File metadata
- Download URL: quakesrthorcam-tspspi-0.0.1a9.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1867806e559d4feade4f6815b0b91c76d1ff4ce5dc4092333022e60a7cb2429
|
|
| MD5 |
30a3f96ee0560b402fb8467c9bfe4015
|
|
| BLAKE2b-256 |
590e9cee5198a506f7041bf54f3ab87a815847026b4f0ca38e3ad183b7a42c43
|
File details
Details for the file quakesrthorcam_tspspi-0.0.1a9-py3-none-any.whl.
File metadata
- Download URL: quakesrthorcam_tspspi-0.0.1a9-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f1d58a4f48603892cdb807add1897017d90c215e67e163bc19b6b54341c2871
|
|
| MD5 |
0bfc3cad9bb72bde525179ac43a53aa8
|
|
| BLAKE2b-256 |
0593f78ef26694b70c642c45857fab9503308beb82042f37c4cc3b7ff1f7be02
|