aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: e130832843da05c63664fa7ea481e3b7a1342a34 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# PicoStream

A fast, simple GUI for streaming from PicoScope 5000a series scopes. Built on [labdaemon](https://github.com/qnslab/labdaemon).

## What's new in v1.0

Complete rewrite with:

- **Dual channels** — acquire A and B simultaneously (16-bit = single channel only)
- **Ring buffer** — configurable lookback (5–120s) with on-demand recording
- **Pre-trigger capture** — include N seconds of data before you hit record
- **Keep or discard** — stop recording and either save or trash the file
- **VisPy plotting** — hardware-accelerated OpenGL, much faster than before
- **Zarr format** — chunked storage, faster than HDF5 for large files
- **PyQt6** — bumped from PyQt5

![PicoStream GUI](assets/images/screenshot.png)

## Install

Requires Python ≥3.10, PicoSDK installed.

Install PicoSDK from [picotech.com/downloads](https://www.picotech.com/downloads).

Linux users: create `/etc/udev/rules.d/99-picoscope.rules`:
```
SUBSYSTEM=="usb", ATTR{idVendor}=="0ce9", MODE="0666"
```
Then run `sudo udevadm control --reload-rules && sudo udevadm trigger`.

From PyPI:

```bash
pip install picostream
```

For development:

```bash
just sync
```

## Run

After pip install:

```bash
picostream
```

During development:

```bash
just gui
```

## Quickstart

1. Enter scope serial (or `MOCK` to simulate), click **Connect**
2. Set channels, voltage ranges, sample rate, resolution
3. **Start Acquisition** (Space bar)
4. **Start Recording** (R) when you want to save
5. **Stop & Keep** (K) or **Stop & Discard** (Del)

Recordings save to `~/picostream/` by default.

## Crash Cleanup

If the app crashes during recording, incomplete Zarr files remain in `~/picostream/`.
These are useless. Delete them:

```bash
rm -rf ~/picostream/*.zarr
```

Change save location in the GUI (Record Controls → Change...).

## Shortcuts

| Key | Action |
|-----|--------|
| Space | Start/stop acquisition |
| 1, 2 | Toggle channels |
| R | Start recording |
| K | Stop + keep |
| Del | Stop + discard |
| Ctrl+O | Open existing Zarr file |

## Development

```bash
just gui        # run from source
just test       # run tests
just test-cov   # run tests with coverage
just format     # format all code
just lint       # lint code
just typecheck  # type check
just build      # build PyInstaller executable
just clean      # remove build artifacts
just sync       # install dependencies
just update     # update dependencies
just help       # see all commands
```

## Acknowledgements

This began as a fork of [JoshHarris2108/pico_streaming](https://github.com/JoshHarris2108/pico_streaming) (unlicensed). The original producer-consumer architecture and PicoSDK integration came from Josh's work.

## Changelog

### v1.0.0
Complete rewrite — new architecture, new file format, dual channels, GUI-only.

### v0.2.0
CLI + HDF5 + single channel + PyQt5/PyQtGraph.

### v0.1.0
Initial release.