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.2.4.tar.gz (36.0 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.2.4-cp314-cp314-win_amd64.whl (59.2 kB view details)

Uploaded CPython 3.14Windows x86-64

pyvcam-2.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (321.2 kB view details)

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

pyvcam-2.2.4-cp313-cp313-win_amd64.whl (58.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pyvcam-2.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (321.1 kB view details)

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

pyvcam-2.2.4-cp312-cp312-win_amd64.whl (58.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pyvcam-2.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (321.1 kB view details)

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

pyvcam-2.2.4-cp311-cp311-win_amd64.whl (58.4 kB view details)

Uploaded CPython 3.11Windows x86-64

pyvcam-2.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (320.9 kB view details)

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

pyvcam-2.2.4-cp310-cp310-win_amd64.whl (58.4 kB view details)

Uploaded CPython 3.10Windows x86-64

pyvcam-2.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (320.2 kB view details)

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

pyvcam-2.2.4-cp39-cp39-win_amd64.whl (47.1 kB view details)

Uploaded CPython 3.9Windows x86-64

pyvcam-2.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (319.9 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.2.4.tar.gz.

File metadata

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

File hashes

Hashes for pyvcam-2.2.4.tar.gz
Algorithm Hash digest
SHA256 247de034666138d1b4a2c18205825a5b6d2a4aeec842089014b91b7a44444f39
MD5 7381d1eab65b93aedab836b10da24958
BLAKE2b-256 0587e607fdc30ff20c33de8f8bff1e8c5fca69eb4f352e2462c7fa28cc410e65

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4.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.2.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 59.2 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.2.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 22212645d20547b6294859e6e5441768104b7b1062c1b036b420383e1676cd88
MD5 ca83dd237e34a797cfcd44f3d9bba7d6
BLAKE2b-256 e2c6bf530b7b832f280b32ff20c52ec8d9c3334d33035b64955d867cb7fae29a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1f0e8bcb23a61afefcdb9e9def7a699a24e196361c51b43847c2d60e4a90d000
MD5 a0596a083603b389a75e514aba7a1769
BLAKE2b-256 48d4d6c80018507c7c6de806a1d39b51755a4181f45c390f266c204e0741f149

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 58.5 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.2.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6c5b6968d3f7ecac61a051288cddaa1584bcbabb32bd8a7b146c12ff412c8a4b
MD5 1ceb7f6a8d66d99bf949731d173992fa
BLAKE2b-256 3d567ea3fc2d4341f0d51e0e42f9c13153d418a03f82bf9aa9fc97aab52d5b83

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d2c9d2ff6b6b7cb89f260d02e249f39f9622bc535a542eca4e6b5bc48e1c261d
MD5 6eb304b2d730dc10aebb83217adc2cb8
BLAKE2b-256 db16c2de562b19ef13a7c4ce634b97a42503dc93fb6e888d86d389263d753064

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 58.5 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.2.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7d35a5b984053e4739d9d79a559dc49b16aa7bc97421194eb0ac07b38e498ed6
MD5 1a3c810d194f463b4cd8e067017134d2
BLAKE2b-256 bfb34335ea6152bf4c71344a78502a44a35b5e99c0e35d83dd703680b1cc022f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4f2cd5c974033715c639c2ccf135def4b73e6b2f1bb3d1fba904b0959373db48
MD5 6756f6a2cee9cf523ab1642b2d2d8fdc
BLAKE2b-256 f13b10cee181eb75613cd37e3d8ffafb9488af66552d7d1d134e6ffccd654d4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 58.4 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.2.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 71de223006e6a44cc3336aba1c2f388d268dd251e36256dd3b307fc6d6165603
MD5 b63cd38d79642144e546bf17eea160f6
BLAKE2b-256 338b03624644385883d3734131fbaf40bd8f073f74376b23a42045dec5d3544e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bea3e6adc7b8ffd7d8d123c7e57ef529ce89acf1ced05695d36a5a333b53458e
MD5 480e1910399ad040446ce6e81d64ecb2
BLAKE2b-256 ebd7b563ed66cfcd8827208ad59b6abdf4a75279a45146d302d9f190083e7433

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 58.4 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.2.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 03f84b559a20f5f8c794034d44790142c8e87dd7f28a5d10bcc3d14b7e679a5b
MD5 42f7804e8a74dfbc1f4b72e168b9517a
BLAKE2b-256 9c5157188d5f755522ecab500b7312abf8f4dccae2d223be69f2e39998e4e7bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c89bb273776950d116f85044ca258deffe69dd6b45cce80047478a940e525b3d
MD5 ce6d0266032492cf16a4d50202ccc60b
BLAKE2b-256 a07f0e95a5709348e7f0bbbfce8ab6f1abb626ea81d9713b453719800c2f3f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyvcam-2.2.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 47.1 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.2.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 69d56a6e16884c3befafb23944feaecb37c564db4efeac32268986193d504f86
MD5 c23252b01c3c1b16c3ade420c0c351ac
BLAKE2b-256 e750e72abbf3513bdc21b66df11306c128a4807aa3fcdf0fe120934a3358b694

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvcam-2.2.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 62003e67efd00b74243971443649a65a9dac6bddb7eb908f185493a6ef9a57c0
MD5 c02b1828e2e32b377249c3ac17312c23
BLAKE2b-256 2a2c53bd5a481f488d20d036f07b01278fc3c72d583c372442dd09828df1f64a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvcam-2.2.4-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