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.4.tar.gz (15.8 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.10 Windows x86-64

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

Uploaded CPython 3.9 Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

thorcam-0.1.4-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.4.tar.gz.

File metadata

  • Download URL: thorcam-0.1.4.tar.gz
  • Upload date:
  • Size: 15.8 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.4.tar.gz
Algorithm Hash digest
SHA256 20404ad48a9a9a5bef5113b6179ffee25f4bde08b43278587bd97994ec563955
MD5 88655a269490713563b57cf709de416d
BLAKE2b-256 e5776ef575d0c18582af9a0c737ac9808b1e21dde3184b7e8f150f43eb8e80f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.4-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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9ffc964597c300dab487f08fe9fc4a3d7999be11dc00a4c17d125a243187cc87
MD5 d330834fe6c19c19140c454d97edfaf8
BLAKE2b-256 d2aa8a29ade2f1bb9b51a0894a34dd76dcbc827d6e424a2c44fd601e5c4fa747

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.4-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.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 63aaefca41267e0442f4c80058057c67ed74c1ba8ee8051140f08e26521eb383
MD5 25928fb9dc714485983b4de21717dcad
BLAKE2b-256 cd975d53bcbc576eca04e302c8033ac35423f52eb530d5806589e81d40900b98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.4-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.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 84d1832d771ce4faa925973cf22f4cd189df8b43e593aaff42a53fcdf140c9cc
MD5 6c414392ecf9ebf78c1b81120846db3b
BLAKE2b-256 6e1eb256c10553ba7aca2d3f3f8828a92ea2b240c22421c93d67da0c8d390392

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.4-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.4-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 dd4ca8c3205668d5a571af984842f309533bceb2333708ee5a56fc861b775e01
MD5 07764e3215b935e3f65eff4d411bd563
BLAKE2b-256 973fa89aec7178a0e75a55be5764d4eb783c4fa3dfb9fa4b1e4960e7e36cd1ef

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