py-coreDAQ 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_coredaq-0.2.0/MANIFEST.in +6 -0
- py_coredaq-0.2.0/PKG-INFO +101 -0
- py_coredaq-0.2.0/README.md +72 -0
- py_coredaq-0.2.0/py_coreDAQ/__init__.py +62 -0
- py_coredaq-0.2.0/py_coreDAQ/_coredaq.py +1773 -0
- py_coredaq-0.2.0/py_coreDAQ/_exceptions.py +49 -0
- py_coredaq-0.2.0/py_coreDAQ/_simulator.py +458 -0
- py_coredaq-0.2.0/py_coreDAQ/_transport.py +387 -0
- py_coredaq-0.2.0/py_coreDAQ/py.typed +0 -0
- py_coredaq-0.2.0/py_coreDAQ.egg-info/PKG-INFO +101 -0
- py_coredaq-0.2.0/py_coreDAQ.egg-info/SOURCES.txt +15 -0
- py_coredaq-0.2.0/py_coreDAQ.egg-info/dependency_links.txt +1 -0
- py_coredaq-0.2.0/py_coreDAQ.egg-info/requires.txt +4 -0
- py_coredaq-0.2.0/py_coreDAQ.egg-info/top_level.txt +1 -0
- py_coredaq-0.2.0/pyproject.toml +63 -0
- py_coredaq-0.2.0/setup.cfg +4 -0
- py_coredaq-0.2.0/tests/test_coredaq_api.py +692 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py_coreDAQ
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Python driver for the coreDAQ 4-channel optical power meter.
|
|
5
|
+
Author-email: Core Instrumentation <hello@coreinstrumentation.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://coreinstrumentation.com
|
|
8
|
+
Project-URL: Repository, https://github.com/coreinstrumentation/py_coreDAQ
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/coreinstrumentation/py_coreDAQ/issues
|
|
10
|
+
Keywords: optical power meter,photonics,coreDAQ,instrumentation,DAQ
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Requires-Dist: pyserial>=3.5
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
29
|
+
|
|
30
|
+
# coreDAQ
|
|
31
|
+
|
|
32
|
+
`coreDAQ` is a smart photonic data acquisition system for optical power measurement, programmable capture, and Python-driven lab automation.
|
|
33
|
+
|
|
34
|
+
On initialization, the API configures the instrument to `500 Hz` sample rate and `OS 1`. You can change those global settings later with `set_sample_rate_hz(...)` and `set_oversampling(...)`.
|
|
35
|
+
|
|
36
|
+
The runtime ships with embedded InGaAs and silicon responsivity curves, defaults to watt readings, and exposes a clean package import:
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from py_coreDAQ import coreDAQ
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install .
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For editable local development:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install -e .
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from py_coreDAQ import coreDAQ
|
|
58
|
+
|
|
59
|
+
with coreDAQ("/dev/tty.usbmodemXXXX") as meter:
|
|
60
|
+
print(meter.identify())
|
|
61
|
+
print(meter.frontend(), meter.detector())
|
|
62
|
+
|
|
63
|
+
meter.set_wavelength_nm(1550.0)
|
|
64
|
+
meter.set_reading_unit("w")
|
|
65
|
+
power_w = meter.read_channel(0, n_samples=8)
|
|
66
|
+
capture = meter.get_data(frames=1024, unit="w")
|
|
67
|
+
|
|
68
|
+
print(power_w)
|
|
69
|
+
print(capture.trace(0)[:5])
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Main User APIs
|
|
73
|
+
|
|
74
|
+
- `read_all()` and `read_channel()` for live powermeter readings
|
|
75
|
+
- `read_all_full()` and `read_channel_full()` when you want the full measurement object
|
|
76
|
+
- `get_data()` and `get_data_channel()` for DAQ traces, including `trigger=True` external-trigger capture
|
|
77
|
+
- `get_ranges()`, `get_range_all()`, `set_range()`, `set_range_power()`, and `set_ranges()`
|
|
78
|
+
- `capture_channel_mask()`, `set_capture_channel_mask()`, `capture_channels()`, and `set_capture_channels()` for DAQ masking
|
|
79
|
+
- `set_sample_rate_hz()` and `set_oversampling()` for global read settings
|
|
80
|
+
- `set_reading_unit("w" | "dbm" | "v" | "mv" | "adc")`
|
|
81
|
+
- `autoRange=True` by default on all `read*()` methods, with `autoRange=False` available for fixed-range reads
|
|
82
|
+
- `zero_dark()` and `restore_factory_zero()`
|
|
83
|
+
- `is_clipped()` and `signal_status()`
|
|
84
|
+
|
|
85
|
+
## Documentation Map
|
|
86
|
+
|
|
87
|
+
- [Quickstart](docs/quickstart.md): first read, first capture, and first trigger-based capture
|
|
88
|
+
- [Read Power](docs/readings.md): every `read*` method, `n_samples`, `autoRange`, and rich read fields
|
|
89
|
+
- [Capture Data](docs/capture.md): `get_data(...)`, `CaptureResult`, and capture status fields
|
|
90
|
+
- [Capture with External Trigger](docs/trigger.md): trigger-based capture workflows
|
|
91
|
+
- [Ranges and AutoRange](docs/ranges.md): range indices, power-based range selection, and autoRange behavior
|
|
92
|
+
- [Units, Sample Rate, and Oversampling](docs/settings.md): units, sample rate, oversampling, and recommended setups
|
|
93
|
+
- [Frames, Masking, and Memory Limits](docs/frames.md): capture masks, frame counts, and SDRAM limits
|
|
94
|
+
- [Zeroing and Signal Health](docs/zeroing.md): zeroing, clipping, and signal health checks
|
|
95
|
+
- [API Reference](docs/api-reference.md): grouped method signatures and examples
|
|
96
|
+
|
|
97
|
+
## Documentation
|
|
98
|
+
|
|
99
|
+
The docs site is configured for Read the Docs:
|
|
100
|
+
|
|
101
|
+
`https://py-coredaq.readthedocs.io/`
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# coreDAQ
|
|
2
|
+
|
|
3
|
+
`coreDAQ` is a smart photonic data acquisition system for optical power measurement, programmable capture, and Python-driven lab automation.
|
|
4
|
+
|
|
5
|
+
On initialization, the API configures the instrument to `500 Hz` sample rate and `OS 1`. You can change those global settings later with `set_sample_rate_hz(...)` and `set_oversampling(...)`.
|
|
6
|
+
|
|
7
|
+
The runtime ships with embedded InGaAs and silicon responsivity curves, defaults to watt readings, and exposes a clean package import:
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from py_coreDAQ import coreDAQ
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install .
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For editable local development:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from py_coreDAQ import coreDAQ
|
|
29
|
+
|
|
30
|
+
with coreDAQ("/dev/tty.usbmodemXXXX") as meter:
|
|
31
|
+
print(meter.identify())
|
|
32
|
+
print(meter.frontend(), meter.detector())
|
|
33
|
+
|
|
34
|
+
meter.set_wavelength_nm(1550.0)
|
|
35
|
+
meter.set_reading_unit("w")
|
|
36
|
+
power_w = meter.read_channel(0, n_samples=8)
|
|
37
|
+
capture = meter.get_data(frames=1024, unit="w")
|
|
38
|
+
|
|
39
|
+
print(power_w)
|
|
40
|
+
print(capture.trace(0)[:5])
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Main User APIs
|
|
44
|
+
|
|
45
|
+
- `read_all()` and `read_channel()` for live powermeter readings
|
|
46
|
+
- `read_all_full()` and `read_channel_full()` when you want the full measurement object
|
|
47
|
+
- `get_data()` and `get_data_channel()` for DAQ traces, including `trigger=True` external-trigger capture
|
|
48
|
+
- `get_ranges()`, `get_range_all()`, `set_range()`, `set_range_power()`, and `set_ranges()`
|
|
49
|
+
- `capture_channel_mask()`, `set_capture_channel_mask()`, `capture_channels()`, and `set_capture_channels()` for DAQ masking
|
|
50
|
+
- `set_sample_rate_hz()` and `set_oversampling()` for global read settings
|
|
51
|
+
- `set_reading_unit("w" | "dbm" | "v" | "mv" | "adc")`
|
|
52
|
+
- `autoRange=True` by default on all `read*()` methods, with `autoRange=False` available for fixed-range reads
|
|
53
|
+
- `zero_dark()` and `restore_factory_zero()`
|
|
54
|
+
- `is_clipped()` and `signal_status()`
|
|
55
|
+
|
|
56
|
+
## Documentation Map
|
|
57
|
+
|
|
58
|
+
- [Quickstart](docs/quickstart.md): first read, first capture, and first trigger-based capture
|
|
59
|
+
- [Read Power](docs/readings.md): every `read*` method, `n_samples`, `autoRange`, and rich read fields
|
|
60
|
+
- [Capture Data](docs/capture.md): `get_data(...)`, `CaptureResult`, and capture status fields
|
|
61
|
+
- [Capture with External Trigger](docs/trigger.md): trigger-based capture workflows
|
|
62
|
+
- [Ranges and AutoRange](docs/ranges.md): range indices, power-based range selection, and autoRange behavior
|
|
63
|
+
- [Units, Sample Rate, and Oversampling](docs/settings.md): units, sample rate, oversampling, and recommended setups
|
|
64
|
+
- [Frames, Masking, and Memory Limits](docs/frames.md): capture masks, frame counts, and SDRAM limits
|
|
65
|
+
- [Zeroing and Signal Health](docs/zeroing.md): zeroing, clipping, and signal health checks
|
|
66
|
+
- [API Reference](docs/api-reference.md): grouped method signatures and examples
|
|
67
|
+
|
|
68
|
+
## Documentation
|
|
69
|
+
|
|
70
|
+
The docs site is configured for Read the Docs:
|
|
71
|
+
|
|
72
|
+
`https://py-coredaq.readthedocs.io/`
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""py_coreDAQ — Python driver for the coreDAQ 4-channel optical power meter.
|
|
2
|
+
|
|
3
|
+
Quick start::
|
|
4
|
+
|
|
5
|
+
from py_coreDAQ import coreDAQ
|
|
6
|
+
|
|
7
|
+
with coreDAQ.connect() as coredaq: # auto-discovers real hardware
|
|
8
|
+
print(coredaq.read_all()) # [W, W, W, W]
|
|
9
|
+
|
|
10
|
+
with coreDAQ.connect(simulator=True) as coredaq:
|
|
11
|
+
result = coredaq.capture(frames=500)
|
|
12
|
+
print(result.trace(0))
|
|
13
|
+
|
|
14
|
+
All public names are importable from this top-level package::
|
|
15
|
+
|
|
16
|
+
from py_coreDAQ import (
|
|
17
|
+
coreDAQ, CaptureResult, ChannelReading, MeasurementSet,
|
|
18
|
+
coreDAQError, coreDAQConnectionError, coreDAQTimeoutError,
|
|
19
|
+
)
|
|
20
|
+
"""
|
|
21
|
+
__version__ = "0.2.0"
|
|
22
|
+
|
|
23
|
+
from ._coredaq import (
|
|
24
|
+
CaptureChannelStatus,
|
|
25
|
+
CaptureLayout,
|
|
26
|
+
CaptureResult,
|
|
27
|
+
ChannelProxy,
|
|
28
|
+
ChannelReading,
|
|
29
|
+
DeviceInfo,
|
|
30
|
+
MeasurementSet,
|
|
31
|
+
SignalStatus,
|
|
32
|
+
coreDAQ,
|
|
33
|
+
)
|
|
34
|
+
from ._exceptions import (
|
|
35
|
+
coreDAQCalibrationError,
|
|
36
|
+
coreDAQConnectionError,
|
|
37
|
+
coreDAQError,
|
|
38
|
+
coreDAQTimeoutError,
|
|
39
|
+
coreDAQUnsupportedError,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
__all__ = [
|
|
43
|
+
"__version__",
|
|
44
|
+
# Main class
|
|
45
|
+
"coreDAQ",
|
|
46
|
+
# Channel proxy
|
|
47
|
+
"ChannelProxy",
|
|
48
|
+
# Dataclasses
|
|
49
|
+
"DeviceInfo",
|
|
50
|
+
"SignalStatus",
|
|
51
|
+
"ChannelReading",
|
|
52
|
+
"MeasurementSet",
|
|
53
|
+
"CaptureLayout",
|
|
54
|
+
"CaptureChannelStatus",
|
|
55
|
+
"CaptureResult",
|
|
56
|
+
# Exceptions
|
|
57
|
+
"coreDAQError",
|
|
58
|
+
"coreDAQConnectionError",
|
|
59
|
+
"coreDAQTimeoutError",
|
|
60
|
+
"coreDAQCalibrationError",
|
|
61
|
+
"coreDAQUnsupportedError",
|
|
62
|
+
]
|