Commit 73b3039
Improve ASI detector support and reduce excessive logging (#111)
* use serval to interface with timepix3 cameras
* Simplify HZanoli's changes, auto-determine `self.exposure_cooldown` from config
* Stop the passive collection during single-frame acquisition instead of setting `self.grabber.frametime = 0` to avoid failing 0-second frames
* In `CameraServal`, always request `tiff` (faster than pgm), removing need for 'asic' config
Reading tiff is faster than pgm virtually always, especially if PixelDepth = 2**N (benchmark: https://chatgpt.com/canvas/shared/67b4942e54808191bf08685ce305112d):
bit_depth pgm png tiff
1 117.41 ± 6.32 ms nan ± nan ms 0.17 ± 0.03 ms
4 117.24 ± 11.10 ms nan ± nan ms 0.17 ± 0.04 ms
6 151.23 ± 48.35 ms nan ± nan ms 0.16 ± 0.01 ms
8 0.08 ± 0.22 ms 1.41 ± 0.09 ms 0.20 ± 0.07 ms
10 153.95 ± 13.69 ms nan ± nan ms 0.63 ± 0.10 ms
12 153.15 ± 23.07 ms nan ± nan ms 0.46 ± 0.17 ms
14 150.50 ± 17.25 ms nan ± nan ms 0.68 ± 0.11 ms
16 1.84 ± 0.20 ms 2.10 ± 0.15 ms 0.42 ± 0.15 ms
20 nan ± nan ms nan ± nan ms 2.17 ± 0.22 ms
24 nan ± nan ms nan ± nan ms 2.21 ± 0.21 ms
32 nan ± nan ms nan ± nan ms 2.22 ± 0.19 ms
* Serval: restrict exposure to 0.001-10 (common medi/timepix limit AFAIK)
* Detector_config.asic is unnecessary if Serval always saves tiff
* Fix `serval.yaml`: {PixelDepth: 24, BothCounters: True} are mutually incompatible
* Filter out external DEBUG log records: reduces log size by 100MB/s
* In `THANKS.md`, fix the link so that it points into instamatic contributions
* In `about` frame, fix links and make other text copy-able
* Auto-adapt `Copyable` width to prevent main widget stretching
* Apply ruff suggestions to `main.py`
* @hzanoli: in `get_movie`, exposure and trigger periods both have to match
* With new `block`-based mechanism, these lines are no longer needed
* Make tem_server serializer import absolute to allow running as script
* Improve the comments in `serval.yaml` config file
Co-authored-by: Henrique Zanoli <henrique.zanoli@amscins.com>
* Handle 0 <= exposure < 10, fix `get_movie` (TODO test)
* Prevent tk from trying to write into a closed `console_frame:Writer`
* Synchronize `_get_image_single`, `get_movie` to prevent threading race issues
* Improve typing, readability on `camera_serval`, follow ruff format
* Log instamatic debug if -v, other debug if -vv, paths if -vvv
* Fix typo, consistenly use `option.verbose`
* Defer formatting of log messages until necessary
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Reorder image getters in `CameraServal.get_image` (todo fix manually)
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Update `videostream.py`: block passive preview when collecting movie
* Remove `CameraServal.lock` as synchronisation is now done at `VideoStream`
* `VideoStream`: Stop requesting media after it has been collected
* `VideoStream`: callback with request to avoid confusion, add `test_get_movie`
* Generalize `VideoStream.get_image` and `.get_movie` into `_get_media`
* `CameraServal` tested, make `get_movie` return `np.ndarray`s not `Image`s
* `CameraServal`: add unified `_get_images`, allow movies > MAX_EXPOSURE
* `CameraServal`: single image is communicated via `n_triggers = Ignore`
* Fix typos, consistently use param name `n_frames` rather than `n_triggers`
* Try to squeeze frame definition in 2 lines
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
* Add missing `MovieRequest` docstring
---------
Co-authored-by: Henrique Zanoli <henrique.zanoli@amscins.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>1 parent 20f8285 commit 73b3039
10 files changed
Lines changed: 279 additions & 128 deletions
File tree
- src/instamatic
- camera
- config/camera
- experiments/cred
- gui
- server
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | | - | |
31 | 35 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | | - | |
45 | | - | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 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 | + | |
52 | 111 | | |
53 | 112 | | |
54 | | - | |
| 113 | + | |
| 114 | + | |
55 | 115 | | |
56 | 116 | | |
57 | 117 | | |
| |||
67 | 127 | | |
68 | 128 | | |
69 | 129 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
90 | 138 | | |
91 | | - | |
| 139 | + | |
| 140 | + | |
92 | 141 | | |
93 | | - | |
94 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
95 | 147 | | |
96 | 148 | | |
97 | 149 | | |
| |||
111 | 163 | | |
112 | 164 | | |
113 | 165 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 166 | + | |
122 | 167 | | |
123 | 168 | | |
124 | 169 | | |
125 | 170 | | |
126 | 171 | | |
127 | 172 | | |
128 | | - | |
| 173 | + | |
129 | 174 | | |
130 | 175 | | |
| 176 | + | |
131 | 177 | | |
132 | 178 | | |
133 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
11 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
12 | 31 | | |
13 | 32 | | |
14 | 33 | | |
15 | 34 | | |
16 | 35 | | |
17 | 36 | | |
18 | | - | |
19 | | - | |
| 37 | + | |
| 38 | + | |
20 | 39 | | |
21 | 40 | | |
22 | 41 | | |
| |||
37 | 56 | | |
38 | 57 | | |
39 | 58 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 59 | + | |
| 60 | + | |
43 | 61 | | |
44 | 62 | | |
45 | 63 | | |
| |||
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| 71 | + | |
53 | 72 | | |
54 | | - | |
55 | | - | |
56 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
57 | 81 | | |
58 | 82 | | |
59 | | - | |
60 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
61 | 87 | | |
62 | 88 | | |
63 | 89 | | |
| |||
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
74 | | - | |
| 100 | + | |
75 | 101 | | |
76 | 102 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 103 | + | |
82 | 104 | | |
83 | 105 | | |
84 | 106 | | |
| |||
109 | 131 | | |
110 | 132 | | |
111 | 133 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
125 | 153 | | |
126 | 154 | | |
127 | 155 | | |
128 | 156 | | |
129 | | - | |
| 157 | + | |
| 158 | + | |
130 | 159 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
137 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
138 | 167 | | |
139 | | - | |
140 | 168 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
146 | 173 | | |
147 | | - | |
148 | | - | |
| 174 | + | |
| 175 | + | |
149 | 176 | | |
150 | 177 | | |
151 | 178 | | |
| |||
0 commit comments