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.2.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.2-cp314-cp314-win_amd64.whl (64.1 kB view details)

Uploaded CPython 3.14Windows x86-64

pyvcam-2.3.2-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.2-cp313-cp313-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.13Windows x86-64

pyvcam-2.3.2-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.2-cp312-cp312-win_amd64.whl (63.4 kB view details)

Uploaded CPython 3.12Windows x86-64

pyvcam-2.3.2-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.2-cp311-cp311-win_amd64.whl (63.3 kB view details)

Uploaded CPython 3.11Windows x86-64

pyvcam-2.3.2-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.2-cp310-cp310-win_amd64.whl (63.3 kB view details)

Uploaded CPython 3.10Windows x86-64

pyvcam-2.3.2-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.2-cp39-cp39-win_amd64.whl (50.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pyvcam-2.3.2-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.2.tar.gz.

File metadata

  • Download URL: pyvcam-2.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 9be199526db5984430e4aff48e98c642df8b2d61818f921f04aac518c933f9f0
MD5 7ac132fdaa3c0d52bd24a39de8954c9e
BLAKE2b-256 7bc9777f702636241177ef89af5f8c60990533f8cd62304519b3642e442b779e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 016de692d45619a52ad87d2e66e0a6dae897f9ee96929acde1b94c4aa472431d
MD5 fce3eb1dc88748c3fed784cbe886369b
BLAKE2b-256 b6df759e887dd8d1a9ce232a764d630fb07ef9ebcea13d9c48e5bc90e88d6dca

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1c568419615406914ad5dac51b2def6644c0dcb36d5bff0d7dc8bb945b95b28e
MD5 83042f777837d04c25e7f6877cd9df5f
BLAKE2b-256 91d55fe9610598e9c379a61f5824bd8c6a2719700dfc83533717aba9a59669f4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8bebf491af899eee713d497823927b1954a4217293e6f3f955cb983639d2b59b
MD5 fa14fd86779c168ae5c196e7edf62792
BLAKE2b-256 fb96052151696bc952f323a87eed27d186e4c8681727ad938d68337348b34b2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e99e06ed9a529978fec8fed076098c753dc9f60f49b7f8cd150e92a934df87c7
MD5 f797f6474414ad3aacb0386b35df4f1f
BLAKE2b-256 4ea8370d21ba8e9f0377a1c7bb2a560d520077d57f90c3c00724230744ff1222

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6edc6684ad9989eed36385808a9e4cebbc702ada58fd2dc0ac0293fa7a5388df
MD5 93415e30a225f3173415ed9033a2d83c
BLAKE2b-256 6da58b808d2f97e0d3e2e9f27db67704a4570d9101ed40a7f75d39f021f4a8ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fd6b53be37ce8d00fdcabff6f504d6868159f884efbffd6375e6188e77710ed7
MD5 28a05c6d53c9105bd808d3b74515f61c
BLAKE2b-256 ebc15c85b0a7ba239363bfd71ea5bdfdedc0d60048e72104d3e33a1ebb23e198

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7c45594971792a9bd001701b564e3da1e163fa6f5668cdacc7bc34c389f5f521
MD5 3fde55cf09ec105c68bce7f8a0676700
BLAKE2b-256 2fa3c16f2c8aa3d6df79b843c5a46a86f4b1123f130eaa3cfdcf65ecfc0a5996

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97ccdee93ca077d43413157a2cb356bcb236dd92b2f78f9681696c085d2b835a
MD5 939a309e7fe2fe7e29e5403aac8e0da6
BLAKE2b-256 7238135263bcddbb7f6142fe42b8bcc1cc5723447051cf560ceac78308a64d8a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 55602f499d5abd37637cdf9445e46f3b1152cafe427cb45cb06cfd7d441bd9c0
MD5 a5f82542b78ba68c75e30cceed5d9c45
BLAKE2b-256 2f03369c38832d70c82d6cc656cb32e6d2c1574bee9c18f12a524b9fe2e9a209

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c090de94a95b64cb8d98e65a25a3da80f006f282dadb41f36a278b7b2705b19a
MD5 7a9c98a8bc2cd84194dc2095394c3e0f
BLAKE2b-256 0e3f7a79b5823cf8f4ea3bae9fa7e2a0244618404e7147c634bd71240373c7df

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyvcam-2.3.2-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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c1e3e5990ad878119e4b99f8ccd57503528cb2d77c49460a406014be8e650755
MD5 f4d3f52c2b99a6d7dfab660b1eaddb57
BLAKE2b-256 af2ba05100533be06431e7c074be699b2e82432def5018af9791db9bf4f9cb07

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyvcam-2.3.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43911f723b62693053394f8397a4bd5a19378950d5c8efc2ed05f28551a100cf
MD5 81d2ea97f4a3881242e78be54b55076b
BLAKE2b-256 fb9b30d2265f4b79a6f3dd1b5ff0e3df8736f14e81d77c7dc438ee057fa0db40

See more details on using hashes here.

Provenance

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