Skip to main content

ThorCam

Github Build Status

A Python interface to the Thor scientific Cameras using .Net.

This library does not support the DCx cameras, only the scientific cameras.

See the docs for more information and to get started.

To install in Anaconda or native Python see the installation instructions.

Basic example

First create a subclass that prints the camera results:

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))

Then use the camera:

>>> # 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)

Release files for thorcam 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for thorcam 0.1.7
File Size Uploaded
thorcam-0.1.7.tar.gz 16.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for thorcam 0.1.7
File
thorcam-0.1.7-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
thorcam-0.1.7-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
thorcam-0.1.7-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
thorcam-0.1.7-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details

Total release size: 75.9 MB

Release files / thorcam-0.1.7.tar.gz

Download URL thorcam-0.1.7.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea00f15ef029ba4828ca41b797cf56aacfcc5400066d9fb9a8d7eef960d21240
BLAKE2b-256 checksum
How to use checksums
902d7ed37faa28a8d2e7b09646f8aad1275d4431804cd621c81ca06fa732d433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / thorcam-0.1.7-cp310-cp310-win_amd64.whl

Download URL thorcam-0.1.7-cp310-cp310-win_amd64.whl
Size 19.0 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
15ef3b986eff83d0176f26af215624541c33d6a500c1e6b911de2c865d60bdc2
BLAKE2b-256 checksum
How to use checksums
b74a1887df73be032e06cba2ce1977d4095b0677e00ebb03ef1d1afec54a8f95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / thorcam-0.1.7-cp39-cp39-win_amd64.whl

Download URL thorcam-0.1.7-cp39-cp39-win_amd64.whl
Size 19.0 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
f259e0934bfc490b2490bd42fab26a6233e1a40f9c62e0781d538179b45a779c
BLAKE2b-256 checksum
How to use checksums
789e5650c97368896705a2df15df8bda872e8a31921666aece8a5dd1f95d8116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / thorcam-0.1.7-cp38-cp38-win_amd64.whl

Download URL thorcam-0.1.7-cp38-cp38-win_amd64.whl
Size 19.0 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
efa1251b97e93f3a21f66de757f93ecbec6f424768fc5a6f2c9585e357fbe507
BLAKE2b-256 checksum
How to use checksums
c223d935408e6e803e364300c9cf2ca4742dde4c664d352943f41f22711a10a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / thorcam-0.1.7-cp37-cp37m-win_amd64.whl

Download URL thorcam-0.1.7-cp37-cp37m-win_amd64.whl
Size 19.0 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
713b502b2c0844c6df8b9b266f86dea30774f9496bba90bb4701a7eefa8f3dfc
BLAKE2b-256 checksum
How to use checksums
18eee4ecc67f12c29dd4775f7157fed2c146bf7d6155391164b5de8f2aecf7de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.9

Release history Release notifications | RSS feed

This release

0.1.7 This release

5 release files

0.1.6

5 release files

0.1.5

5 release files

0.1.4

5 release files

0.1.3

7 release files

0.1.2

3 release files

0.1.1

5 release files

0.1.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page