Skip to content

neutronimaging/DetectorPoller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DetectorPoller

A service to poll a folder and publish the latest image.

Introduction

There are unfortunately detectors out there without and SDK that allows creative integration into a control system. A workaround is to implement a webservice that can serve the control system with the latest image when the acquisition is triggered.

This approach requires that the detector can be set in a stream to disk mode that contiuously write images to a specified location.

The current script is a raw prototype from ChatGPT and still needs some polishing. It is however a good starting point for the evaluation.

Install pixi

The code is supported by the pixi python manager. The package manager must be installed before starting. Go to pixi.sh for installation instuctions.

Clone repository

git clone https://github.com/neutronimaging/DetectorPoller.git

Install environment

Enter the repository folder

cd DetectorPoller

Install the pixi environment

pixi install

Start the service

A basic local host service is started like

cd src
mkdir outgoing
pixi run python serve_latest_image.py --dir outgoing --pattern "*.tif" --host 127.0.0.1 --port 8080 --debounce 2.0 --poll-interval 2 --log-level INFO

Test with the address http:\localhost:8080 in a webbrowser

About

A service to poll a folder and publish the latest image

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages