diff --git a/ansto_simplon_api/routes/detector/config.py b/ansto_simplon_api/routes/detector/config.py index 8acd7f5..b41bde5 100644 --- a/ansto_simplon_api/routes/detector/config.py +++ b/ansto_simplon_api/routes/detector/config.py @@ -123,16 +123,19 @@ async def get_description(): @router.get("/detector_distance") async def get_detector_distance(): - return {"value": zmq_start_message.detector_translation} + return {"value": zmq_start_message.detector_translation[2]} @router.put("/detector_distance") async def put_detector_distance( input: SimplonRequestFloat, ): - detector_translation = (0, 0, input.value) - zmq_start_message.detector_translation = detector_translation - return {"value": zmq_start_message.detector_translation} + zmq_start_message.detector_translation = [ + zmq_start_message.detector_translation[0], + zmq_start_message.detector_translation[1], + input.value, + ] + return {"value": zmq_start_message.detector_translation[2]} @router.put("/detector_number") diff --git a/ansto_simplon_api/simulate_zmq_stream.py b/ansto_simplon_api/simulate_zmq_stream.py index abbba05..629a689 100644 --- a/ansto_simplon_api/simulate_zmq_stream.py +++ b/ansto_simplon_api/simulate_zmq_stream.py @@ -188,7 +188,7 @@ def create_list_of_compressed_frames( self.compression = compression self.number_of_data_files = number_of_datafiles - with h5py.File(hdf5_file_path) as hdf5_file: + with h5py.File(hdf5_file_path, mode="r") as hdf5_file: keys = list(hdf5_file["entry"]["data"].keys()) if number_of_datafiles is None: diff --git a/pyproject.toml b/pyproject.toml index a984cb5..498da98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ansto-simplon-api" -version = "0.2.5" +version = "0.2.6" description = "Simulated simplon api" authors = ["Francisco Hernandez Vivanco ", "Daniel Eriksson "]