From 45c3ab8a288baa689b7b0deea2b0dc69cc527d3f Mon Sep 17 00:00:00 2001 From: Francisco Hernandez Vivanco <49014169+fhernandezvivanco@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:11:03 +1000 Subject: [PATCH] Set x and y pixels automatically (#7) * set x pixels and y pixels in detector automatically when loading a hdf5 file * fix array size bug * add TODO --- ansto_simplon_api/schemas/configuration.py | 2 +- ansto_simplon_api/simulate_zmq_stream.py | 4 ++++ pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ansto_simplon_api/schemas/configuration.py b/ansto_simplon_api/schemas/configuration.py index 3b5770d..34a4538 100644 --- a/ansto_simplon_api/schemas/configuration.py +++ b/ansto_simplon_api/schemas/configuration.py @@ -62,7 +62,7 @@ class ZMQStartMessage(BaseModel): pixel_mask_enabled: bool = True pixel_size_x: float = 7.5e-05 pixel_size_y: float = 7.5e-05 - saturation_value: int | None = 0 + saturation_value: int | None = 33000 # TODO: check where this value comes from sensor_material: str = "Si" sensor_thickness: float = 4.5e-04 series_id: int = 0 diff --git a/ansto_simplon_api/simulate_zmq_stream.py b/ansto_simplon_api/simulate_zmq_stream.py index 9028ae3..b8c628f 100644 --- a/ansto_simplon_api/simulate_zmq_stream.py +++ b/ansto_simplon_api/simulate_zmq_stream.py @@ -148,6 +148,10 @@ def create_list_of_compressed_frames( datafile.shape[0] for datafile in datafile_list ] array_shape = datafile_list[0].shape[1:] + + zmq_start_message.image_size_x = array_shape[1] + zmq_start_message.image_size_y = array_shape[0] + dtype = datafile_list[0].dtype frame_list = [] diff --git a/pyproject.toml b/pyproject.toml index 1efaa85..4d482a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ansto-simplon-api" -version = "0.2.3" +version = "0.2.4" description = "Simulated simplon api" authors = ["Francisco Hernandez Vivanco ", "Daniel Eriksson "]