阿尔巴艾格模拟器
eiger-simulator的Python项目详细描述
艾格模拟器
{1}$
Dectris-Eiger探测器模拟器。在
目前,在内部触发单模式(ints)下模拟Eiger 9M的全ROI。在
完成httprestapi+ZMQ数据流。在
安装
在您最喜欢的python环境中:
$ pip install -e eiger-simulator
如果您需要客户端库,还需要:
^{pr2}$使用
运行模拟器:
$ eiger-simulator --dataset=<path to the HDF5 master file> --max-memory=1_000_000_000
这将启动一个模拟器来监听端口8000和 TCP端口9999上的ZMQ流式套接字
使用--help
运行以查看选项的完整列表
$ 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.
客户
客户端可以作为python库访问:
>>>fromeigersim.clientimportEiger>>>eiger=Eiger('http://127.0.0.1:8000')>>>eiger.initialize()[response200]>>>eiger.nimages100>>>eiger.count_time0.1>>>eiger.trigger_mode'ints'>>>eiger.arm()[response200]>>>eiger.trigger()[response200]
请注意,您应该能够使用客户端连接到真正的Eiger检测器,而不仅仅是 模拟的那个。在
作为参考,下面是一个简单的客户端,它监听ZMQ流:
>>>importzmq>>>ctx=zmq.Context()>>>sock=ctx.socket(zmq.PULL)>>>sock.connect('tcp://127.0.0.1:9999')>>>whileTrue:data=sock.recv_multipart()size=sum(len(i)foriindata)print(f'packet #parts={len(data)} size={size/1000} KB')
基准
基准结果可用here。在
- 项目
标签: