Skip to main content

Python interface to the .NET Thor cameras.

Project description

ThorCam

Github Build Status

Python interface for the Thor scientific Cameras using .Net.

For more information and to get started: https://matham.github.io/thorcam/index.html.

To install https://matham.github.io/thorcam/installation.html.

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 "['05761']"
>>> # open the camera
>>> cam.open_camera('05761')
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.3.tar.gz (15.0 kB view details)

Uploaded Source

Built Distributions

thorcam-0.1.3-cp38-cp38-win_amd64.whl (15.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

thorcam-0.1.3-cp38-cp38-win32.whl (13.4 MB view details)

Uploaded CPython 3.8 Windows x86

thorcam-0.1.3-cp37-cp37m-win_amd64.whl (15.7 MB view details)

Uploaded CPython 3.7m Windows x86-64

thorcam-0.1.3-cp37-cp37m-win32.whl (13.4 MB view details)

Uploaded CPython 3.7m Windows x86

thorcam-0.1.3-cp36-cp36m-win_amd64.whl (15.7 MB view details)

Uploaded CPython 3.6m Windows x86-64

thorcam-0.1.3-cp36-cp36m-win32.whl (13.4 MB view details)

Uploaded CPython 3.6m Windows x86

File details

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

File metadata

  • Download URL: thorcam-0.1.3.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for thorcam-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b36644663715eacb67688c42cad47b80e1e3b138c7093c9f6c08ec3353e8659b
MD5 9c5aef87e48d22512006ca8786ffd2af
BLAKE2b-256 2958b708ff2a24c125947e52c5cb779d17d9aa839716de5ae0249aeeca0a7723

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 15.7 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for thorcam-0.1.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2295dda2714e261c7c953d4957198b1c6879bf01637c6a9e1cd0b69dfde233da
MD5 d43daab38d05e9859371d90575fbd645
BLAKE2b-256 a2d589ad9b1909d5e3123809f7f3dd598dc6f0cf535b80ea710edca484bc3207

See more details on using hashes here.

File details

Details for the file thorcam-0.1.3-cp38-cp38-win32.whl.

File metadata

  • Download URL: thorcam-0.1.3-cp38-cp38-win32.whl
  • Upload date:
  • Size: 13.4 MB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for thorcam-0.1.3-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 03dda87b31ac6d2ce079c062a8b1b7acd0aee2004cafe90e6f1e05e61802a80c
MD5 26f9fdf313d001264f0abfee3621e456
BLAKE2b-256 22b95919586e0e515705b38e71b77328a3dc08a27bdd64fc168c7eb08c34bf78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: thorcam-0.1.3-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 15.7 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for thorcam-0.1.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e00f72741831ddeac4c670296a96f03d6fbae0b1c23aeb63dcc6c5615ecc71af
MD5 cfbb93ccc9962182ca617137aa30d8f7
BLAKE2b-256 4b4f9dacb279e83f15cba8d99fab3a1e960049e4061226d93f7c548066183935

See more details on using hashes here.

File details

Details for the file thorcam-0.1.3-cp37-cp37m-win32.whl.

File metadata

  • Download URL: thorcam-0.1.3-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 13.4 MB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for thorcam-0.1.3-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 8e97a1cf151be376ec9de3c6a382e5aaedfc306b5c6b5c3430c5ce60a77dea9f
MD5 a13df440b440d3f26115fc1a1874a0a4
BLAKE2b-256 9523901127fe53c476199236aaea1a91f6c185cfc38985b6163cb338464c6d08

See more details on using hashes here.

File details

Details for the file thorcam-0.1.3-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: thorcam-0.1.3-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 15.7 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8

File hashes

Hashes for thorcam-0.1.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 5ec7f4cebab4f8bc0aa5d0439a5cdf55207cec24cb76f8c69e78271b20f8f65a
MD5 01a2799b9d462581aa6fb8e9c5ec626b
BLAKE2b-256 ab9120967f5f73d5d487ce2387420093b485cac1920cd6ef540d66cdd680d627

See more details on using hashes here.

File details

Details for the file thorcam-0.1.3-cp36-cp36m-win32.whl.

File metadata

  • Download URL: thorcam-0.1.3-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 13.4 MB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.8

File hashes

Hashes for thorcam-0.1.3-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 830bbcb87c4d18e7eb9e4b0938d2b477f05f733e2007afd467930139e6d027b8
MD5 36ba08fdd39c0e4a88d65a19261a9fa1
BLAKE2b-256 9efcfc6020295910263972425db340f0a1ef2787eaa9d4ec2701d13d2ac20965

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