File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ classifiers = [
12
12
]
13
13
description = " Develop a FastCS application to introspect an Eiger detector and odin-data processes"
14
14
dependencies = [
15
- " fastcs @ git+https://github.com/DiamondLightSource/FastCS.git@HTTP"
15
+ " fastcs @ git+https://github.com/DiamondLightSource/FastCS.git@HTTP" ,
16
+ " numpy" ,
17
+ " pillow" ,
16
18
] # Add project dependencies here, e.g. ["click", "numpy"]
17
19
dynamic = [" version" ]
18
20
license.file = " LICENSE"
Original file line number Diff line number Diff line change 3
3
from io import BytesIO
4
4
from typing import Any , Coroutine , Type
5
5
6
+ import numpy as np
6
7
from attr import Attribute
7
8
from fastcs .attributes import AttrR , AttrRW , AttrW
8
9
from fastcs .connections import HTTPConnection , IPConnectionSettings
@@ -325,12 +326,14 @@ async def handle_monitor(self):
325
326
Done until a no new images are available to be viewed.
326
327
"""
327
328
# collects images from the detector until there is no image.
328
- image_byte = await self .connection .get ("monitor/api/1.8.0/images/next" )
329
- if image_byte .status != 200 :
329
+ response , image_bytes = await self .connection .get_bytes (
330
+ "monitor/api/1.8.0/images/next"
331
+ )
332
+ if response .status != 200 :
330
333
print ("No Image" )
331
334
return
332
335
else :
333
- image = Image .open (BytesIO (image_byte ))
336
+ image = Image .open (BytesIO (image_bytes ))
334
337
335
338
# Extract basic metadata of image
336
339
image_size = image .size
@@ -354,3 +357,5 @@ async def handle_monitor(self):
354
357
"frames" : frames_in_image ,
355
358
"depth" : bit_depth ,
356
359
}
360
+
361
+ print (np .array (image ))
You can’t perform that action at this time.
0 commit comments