Skip to main content

Python interface to the .NET Thor cameras.

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thorcam-0.1.5.tar.gz (16.0 kB view details)

Uploaded Source

Built Distributions

thorcam-0.1.5-cp310-cp310-win_amd64.whl (14.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

thorcam-0.1.5-cp39-cp39-win_amd64.whl (14.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

thorcam-0.1.5-cp38-cp38-win_amd64.whl (14.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

thorcam-0.1.5-cp37-cp37m-win_amd64.whl (14.9 MB view details)

Uploaded CPython 3.7m Windows x86-64

File details

Details for the file thorcam-0.1.5.tar.gz.

File metadata

  • Download URL: thorcam-0.1.5.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for thorcam-0.1.5.tar.gz
Algorithm Hash digest
SHA256 996797e5d88a224e11c120505efebd5b72057f84929c4ebad4ef60654c2a8dc2
MD5 3f62354ce9978e1ca971a44a8cc00eaa
BLAKE2b-256 bbb4c71a97f49f4c779d69eeb7ccac47120b4613c213c7b25746a90b813faf59

See more details on using hashes here.

File details

Details for the file thorcam-0.1.5-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: thorcam-0.1.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for thorcam-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cb5767f45ecfa2cf1facf0eaace3d87fe4401c87a55c4e60e1a2ac3eca8934f7
MD5 6ffbf561b2c5d30ef3f0a32d6415a3e0
BLAKE2b-256 ff59814bfc462b86febdb3b744cbd0e1b6d15e5d4791c5ddde44ee3c209ee0ed

See more details on using hashes here.

File details

Details for the file thorcam-0.1.5-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: thorcam-0.1.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for thorcam-0.1.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 d569475c1fe5a404612c17c5af9135e7e6c3b8f3cab3f6d3c8e463a861854332
MD5 8f2de2e01e16935e1e5f1332d7f680a7
BLAKE2b-256 ed379fa0d63ca71d9ad7526209bf02fa4538125bab706a85bc626a05b11db3c9

See more details on using hashes here.

File details

Details for the file thorcam-0.1.5-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: thorcam-0.1.5-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for thorcam-0.1.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fe5c452846ea376e98cec5c331df11635635978f34d5ae71df7dd64c00e4a9c4
MD5 b4e28dcafda78a508be2cca79de4bfc9
BLAKE2b-256 377956487b3444909da042fc061ff7a04f5a7d7de4095ed3c18f0d58b78ae52c

See more details on using hashes here.

File details

Details for the file thorcam-0.1.5-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: thorcam-0.1.5-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 14.9 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for thorcam-0.1.5-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 302f6132aef48cccbdbaf43f358845e7accfcccbbcbb5b99dbcd20a0f3c2bded
MD5 4a3a3f848090e62452db74671054ae4b
BLAKE2b-256 9c04028e77479a5adc4da114a156a7b28d08dd0a2a73534acf68373ac86684c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page