Python接口到.NET Thor相机。
项目描述
ThorCam
使用.Net
的Python接口,用于Thor科学相机。
此库不支持DCx相机,仅支持科学相机。
有关更多信息和使用方法,请参阅文档。
要在Anaconda或原生Python中安装,请参阅安装说明。
基本示例
首先创建一个子类,该子类将打印相机结果
from thorcam.camera import ThorCam
class MyThorCam(ThorCam):
def received_camera_response(self, msg, value):
super(MyThorCam, self).received_camera_response(msg, value)
if msg == 'image':
return
print('Received "{}" with value "{}"'.format(msg, value))
def got_image(self, image, count, queued_count, t):
print('Received image "{}" with time "{}" and counts "{}", "{}"'
.format(image, t, count, queued_count))
然后使用相机
>>> # create camera
>>> cam = MyThorCam()
<__main__.MyThorCam at 0x25a72f6a748>
>>> # start the server etc.
>>> cam.start_cam_process()
>>> # get list of attached cams
>>> cam.refresh_cameras()
Received "serials" with value "['03756']"
>>> # open the camera
>>> cam.open_camera('03756')
Received "settings" with value "{'binning_x': 1, 'binning_x_range': [1, 24], ..."
Received "cam_open" with value "None"
>>> cam.exposure_range
[0.0, 1000000.0]
>>> cam.exposure_ms
241.948
>>> # update the exposure value
>>> cam.set_setting('exposure_ms', 150)
Received "settings" with value "{'exposure_ms': 150.0}"
>>> cam.exposure_ms
150.0
>>> # now play the camera
>>> cam.play_camera()
Received "playing" with value "True"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67900>" with time "2e-07" and counts "1", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67990>" with time "0.2310473" and counts "2", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67A68>" with time "0.4735178" and counts "3", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67B40>" with time "0.7157285" and counts "4", "1"
Received image "<ffpyplayer.pic.Image object at 0x000001D1D8D67C18>" with time "0.9583721" and counts "5", "1"
>>> # now stop playing
>>> cam.stop_playing_camera()
Received "playing" with value "False"
>>> # close the camera
>>> cam.close_camera()
Received "cam_closed" with value "None"
>>> # close the server and everything
>>> cam.stop_cam_process(join=True)
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分布
thorcam-0.1.7.tar.gz (16.2 kB 查看哈希值)
构建分发版
thorcam-0.1.7-cp310-cp310-win_amd64.whl (19.0 MB 查看哈希值)
thorcam-0.1.7-cp39-cp39-win_amd64.whl (19.0 MB 查看哈希值)
thorcam-0.1.7-cp38-cp38-win_amd64.whl (19.0 MB 查看哈希值)
thorcam-0.1.7-cp37-cp37m-win_amd64.whl (19.0 MB 查看哈希值)
关闭
thorcam-0.1.7.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | ea00f15ef029ba4828ca41b797cf56aacfcc5400066d9fb9a8d7eef960d21240 |
|
MD5 | b227455ae278bf6b151b6d5766cc4322 |
|
BLAKE2b-256 | 902d7ed37faa28a8d2e7b09646f8aad1275d4431804cd621c81ca06fa732d433 |
关闭
thorcam-0.1.7-cp310-cp310-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 15ef3b986eff83d0176f26af215624541c33d6a500c1e6b911de2c865d60bdc2 |
|
MD5 | 0400e5310b6489ed154a34b7166e68f1 |
|
BLAKE2b-256 | b74a1887df73be032e06cba2ce1977d4095b0677e00ebb03ef1d1afec54a8f95 |
关闭
thorcam-0.1.7-cp39-cp39-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | f259e0934bfc490b2490bd42fab26a6233e1a40f9c62e0781d538179b45a779c |
|
MD5 | cadf155b3e20403585c9dccd69d73283 |
|
BLAKE2b-256 | 789e5650c97368896705a2df15df8bda872e8a31921666aece8a5dd1f95d8116 |
关闭
thorcam-0.1.7-cp38-cp38-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | efa1251b97e93f3a21f66de757f93ecbec6f424768fc5a6f2c9585e357fbe507 |
|
MD5 | 708ea538632ade96ecd33be223faa2e5 |
|
BLAKE2b-256 | c223d935408e6e803e364300c9cf2ca4742dde4c664d352943f41f22711a10a1 |
关闭
thorcam-0.1.7-cp37-cp37m-win_amd64.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 713b502b2c0844c6df8b9b266f86dea30774f9496bba90bb4701a7eefa8f3dfc |
|
MD5 | 4ea1d6e3f071cab4d4141d92b4c1d0c6 |
|
BLAKE2b-256 | 18eee4ecc67f12c29dd4775f7157fed2c146bf7d6155391164b5de8f2aecf7de |