Skip to content

Commit

Permalink
Set x and y pixels automatically (#7)
Browse files Browse the repository at this point in the history
* set x pixels and y pixels in detector automatically when loading a hdf5 file

* fix array size bug

* add TODO
  • Loading branch information
fhernandezvivanco authored Jul 10, 2024
1 parent 789d6e2 commit 45c3ab8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ansto_simplon_api/schemas/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ansto_simplon_api/simulate_zmq_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <hernandf@ansto.gov.au>",
"Daniel Eriksson <daniele@ansto.gov.au>"]
Expand Down

0 comments on commit 45c3ab8

Please sign in to comment.