Skip to main content

Python wrapper for PVCAM functionality

Project description

PyVCAM

GitHub release GitHub release GitHub License
PyPI release TestPyPI release Python version from PEP 621 TOML
Tests status Average time to resolve an issue Percentage of issues still open

PyVCAM is a Python 3.x wrapper for the PVCAM library.

Installation

The wrapper can be installed using the following command in an environment with python and pip:

pip install PyVCAM

It requires the latest PVCAM to be installed - can be downloaded here.

The binary packages are available for 64-bit Windows and Linux on Intel platform only. For 32-bit or Arm Linux platform it must be complied from the source code. Please follow the instructions for development below.

Examples

The installed package contains just the wrapper. If you want to get an image from the camera right away before writing your own application, PyVCAM repository contains multiple examples, like seq_mode.py or live_mode.py.

Get a local copy of the GitHub repository by downloading the zip archive or cloning it e.g. from git command prompt:

git clone https://github.com/Photometrics/PyVCAM.git PyVCAM

Then switch to the folder with examples and run one:

cd PyVCAM/examples
python seq_mode.py

Some examples show the image from camera in a UI window and require opencv-python or matplotlib packages to be installed.

Development

For troubleshooting or active contribution you may want to install PyVCAM from GitHub.

Prerequisites

  • Cloned repository from GitHub as described in Examples chapter above.
  • A C/C++ compiler is needed to build native source code. On Windows, Visual Studio 2022 was used for testing.
  • The latest PVCAM and PVCAM SDK - both can be downloaded here.

Installation

Use your command prompt to navigate into the directory that contains pyproject.toml file and run:

pip install .

How to use the wrapper

An understanding of PVCAM API is very helpful for understanding PyVCAM.

Create Camera Example

This will create a camera object using the first camera that is found that can then be used to interact with the camera.

from pyvcam import pvc 
from pyvcam.camera import Camera   

pvc.init_pvcam()                   # Initialize PVCAM 
cam = next(Camera.detect_camera()) # Use generator to find first camera
cam.open()                         # Open the camera

Single Image Example

This captures a single image with a 20 ms exposure time and prints the values of the first 5 pixels.

# A camera object named cam has already been created
frame = cam.get_frame(exp_time=20)
print("First five pixels of frame: {}, {}, {}, {}, {}".format(*frame[:5]))

Changing Settings Example

This is an example of how to change some of the settings on the cameras.

cam.clear_mode = "Never"
cam.exp_mode = "Ext Trig Trig First"

The same setting can be done without the strings via predefined constants that are generated from C header pvcam.h:

from pyvcam import constants as const

cam.clear_mode = const.CLEAR_NEVER
cam.exp_mode = const.EXT_TRIG_TRIG_FIRST

Changing Speed Table Settings Example

When changing speed table, set new value to all three properties in this exact order: readout_portspeedgain, otherwise some legacy cameras could end up in invalid state.

cam.readout_port = 0
cam.speed = 0
cam.gain = 1

More information on how to use this wrapper and how it works can be found in docs/PyVCAM.md.

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

pyvcam-2.3.1.tar.gz (39.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyvcam-2.3.1-cp314-cp314-win_amd64.whl (64.1 kB view details)

Uploaded CPython 3.14Windows x86-64

pyvcam-2.3.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (348.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvcam-2.3.1-cp313-cp313-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.13Windows x86-64

pyvcam-2.3.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (347.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvcam-2.3.1-cp312-cp312-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.12Windows x86-64

pyvcam-2.3.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (347.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvcam-2.3.1-cp311-cp311-win_amd64.whl (63.3 kB view details)

Uploaded CPython 3.11Windows x86-64

pyvcam-2.3.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (347.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvcam-2.3.1-cp310-cp310-win_amd64.whl (63.3 kB view details)

Uploaded CPython 3.10Windows x86-64

pyvcam-2.3.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (346.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvcam-2.3.1-cp39-cp39-win_amd64.whl (50.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pyvcam-2.3.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (345.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pyvcam-2.3.1.tar.gz.

File metadata

  • Download URL: pyvcam-2.3.1.tar.gz
  • Upload date:
  • Size: 39.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1.tar.gz
Algorithm Hash digest
SHA256 3bc142bc3480c33547817c119e37c11435700a859756f1d5beb1706f926537c3
MD5 d6fe76d2df680c469dc8abcdd5af8416
BLAKE2b-256 297d73d3f734099aa0150913c2c3c6821052ede6b9c8ef2d6d14c1ee912a9f3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1.tar.gz:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5980c702e3fddab78ec5adf68a4dad079b0dd25e04f6182f2050fa0c17e0f095
MD5 8850e0713775ba8b06051fb28e02caae
BLAKE2b-256 f60ad4736e4d8f767fdc8c03f01427010f9ef61fc7e8721415e0bf40c2579e76

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp314-cp314-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b91d5b4f740d060ffed1078d1994f516b88766a2232cbc67c215236630c6dbaa
MD5 e1933efb663b6e0e91338a6e5481d094
BLAKE2b-256 a9bb94c0f35ee5cc5a1a734404e5fecc5d136d3c20e602dda792de07285686a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 00f196cdabe1ea61e494b40eff9c4e6244f85da89b879b9d30e8468c85281160
MD5 9db69f7eb668cc6796491284e4d72cc1
BLAKE2b-256 3fb81d6a420911d689ea5add9b884e966df4ceaee61b4f604d05b166765b6bb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp313-cp313-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87688b6fe842bfc3505e86f82b1b6b9db01645f2f81f25014c036eb12fb17e01
MD5 c74f70ee76ffa4bef21ec2913080a147
BLAKE2b-256 4082e2273cda068d67ec5d7586d18a3ebcdcfff917a33c263af599bba685328c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 63.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 443e96816525b0b161c42fcf854e3fc4340274cb58abcab9540b763c699ae01d
MD5 82b052e5d818e076f85d60a3c55c71e6
BLAKE2b-256 2961921fea00da13fc456da28f6fbb259711739084e9ace14b0ee588dfc72bfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp312-cp312-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b7eb0ac7edecadfa8b614bd295bf9d1fcd54c56fd5967b0d65bf2ed54513e8f1
MD5 d491decd8b7123fe36df420390f21edc
BLAKE2b-256 d60c104d28a47042917e92eb6243ceacc066395e0b5611903e3157cd25b60d4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 63.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 df3ed2045c0101733aa4d0a8b7a83a553aede3a289c255adbbf37e5573aaf4b5
MD5 36cb814a51ea8ec3ba4ae558f7ed6e6b
BLAKE2b-256 08df56cc6d9b0a7d24c216ff312ac0b43deb3b9a43f55c15721b4f1635f76fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp311-cp311-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 073b3fa06b8083058196ba3850f454cd712686277a37e794a1756fa78028f8ef
MD5 7c41972c5a1d3e51ec0a893240b1b130
BLAKE2b-256 883fe83509f72143c7bc7aa3ac0d0f21c68a5d0105f2b286c92c9c5252b0de59

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 63.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2d88eb6ab0922e85770f04fcd632da629ac5e50642b41d799b166bd00f4bb674
MD5 a358a33db410e2d96bb70ef7742daa5d
BLAKE2b-256 f8bec41c2f12c4d679eb1b34b91bdf778bb301334553928c3932c7dc445e6322

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp310-cp310-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bbdb414639931e38f94945ba969c29f5f5372072acf19fbf76ae1e4d5df6c496
MD5 9ddd4e36b09d401d0971d76b01bb1346
BLAKE2b-256 a4478cc81ec62afa704ce4d342231311b11d242e87af920e7baa13efeb23cf52

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.3.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 50.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyvcam-2.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bd20a51a1b3b01f9c82e784219f71daa9826c3b10ee834f544471f7641a0d444
MD5 1c8e9384b1d53dc0a917b6cfc254ac3b
BLAKE2b-256 2d085d6c1962b2a7bceb49fa73c98664a0ff26833ea397a6114792deaa9a3351

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp39-cp39-win_amd64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvcam-2.3.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.3.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b0a5612aee1fa8b341ba8aee82f9c9425c55c91ce4a7cb1f298f677675cca3a5
MD5 1471a08f6b661459bec7ea6b37552a8e
BLAKE2b-256 4461030f4c71fdfd6bf856a627873d6cb0d6e485bd608f9fded85540abfd859c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.3.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: deploy_pypi.yml on Photometrics/PyVCAM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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