Eiger simulator
Dectris Eiger detector simulator.
For now simulates Eiger 9M at full ROI in internal trigger single mode (ints).
Complete HTTP REST API + ZMQ data stream.
Installation
From within your favorite python environment:
$ pip install -e eiger-simulator
If you need the client library, you need in addition:
$ pip install -e eiger-simulator[client]
Usage
Run simulator with:
$ eiger-simulator --dataset=<path to the HDF5 master file> --max-memory=1_000_000_000
This will start a simulator listening to the HTTP interface on port 8000 and the ZMQ streaming socket on TCP port 9999
Run with --help to see the complete list of options
$ eiger-simulator --help
Usage: eiger-simulator [OPTIONS]
Options:
--host TEXT Bind web socket to this host. [default: 0]
--port INTEGER Bind web socket to this port. [default: 8000]
--zmq TEXT Bind ZMQ socket [default: tcp://*:9999]
--dataset PATH dataset path or file
--max-memory INTEGER max memory (bytes) [default: 1000000000]
--log-level [critical|error|warning|info|debug|trace]
Show only logs with priority LEVEL or above
[default: info]
--help Show this message and exit.
Client
The client is accessible as a python library:
>>> from eigersim.client import Eiger
>>> eiger = Eiger('http://127.0.0.1:8000')
>>> eiger.initialize()
[response 200]
>>> eiger.nimages
100
>>> eiger.count_time
0.1
>>> eiger.trigger_mode
'ints'
>>> eiger.arm()
[response 200]
>>> eiger.trigger()
[response 200]
Note that you should be able to use the client to connect to a real Eiger detector, not just the simulated one.
For reference, here is a simple client that listens to the ZMQ stream:
>>> import zmq
>>> ctx = zmq.Context()
>>> sock = ctx.socket(zmq.PULL)
>>> sock.connect('tcp://127.0.0.1:9999')
>>> while True:
data = sock.recv_multipart()
size = sum(len(i) for i in data)
print(f'packet #parts={len(data)} size={size/1000} KB')
Benchmarks
Benchmark results available here.
Metadata
Release files for eiger-simulator 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eiger-simulator-0.5.1.tar.gz | 39.1 kB | Without provenance | Details for eiger-simulator-0.5.1.tar.gz |
Release files / eiger-simulator-0.5.1.tar.gz
| Download URL | eiger-simulator-0.5.1.tar.gz |
|---|---|
| Size | 39.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d9d07ae00ffa1aa5d58fc6468111662ce86cf23d3192f4d8291af3a58b971584
|
|
BLAKE2b-256 checksum How to use checksums |
f3ad6289c1c8456cdde3facb959038638715de310138cf84e21357a773995d5b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.4
|
Security for eiger-simulator 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.