forked from scriptorron/indi_pylibcamera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
print_camera_information.py
executable file
·38 lines (35 loc) · 1.19 KB
/
print_camera_information.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
from picamera2 import Picamera2
import pprint
# list of available cameras:
cameras = Picamera2.global_camera_info()
print(f'Found {len(cameras)} cameras.')
print()
for c, camera in enumerate(cameras):
print(f'Camera {c}:')
pprint.pprint(cameras[c])
print()
picam2 = Picamera2(c)
print('Camera properties:')
pprint.pprint(picam2.camera_properties)
print()
print("Raw sensor modes:")
pprint.pprint(picam2.sensor_modes)
print()
print('Camera controls:')
pprint.pprint(picam2.camera_controls)
print()
if "ExposureTime" in picam2.camera_controls:
print('Exposure time:')
min_exp, max_exp, default_exp = picam2.camera_controls["ExposureTime"]
print(f' min: {min_exp}, max: {max_exp}, default: {default_exp}')
else:
print("ERROR: ExposureTime not in camera controls!")
print()
if "AnalogueGain" in picam2.camera_controls:
print('AnalogGain:')
min_again, max_again, default_again = picam2.camera_controls["AnalogueGain"]
print(f' min: {min_again}, max: {max_again}, default: {default_again}')
else:
print("ERROR: AnalogueGain not in camera controls!")
print()