Files
Jungfraujoch/tests/test_data/jfjoch_broker_test.py
2025-05-28 18:49:27 +02:00

32 lines
1.2 KiB
Python

import requests
import h5py
import hdf5plugin
requests.post("http://localhost:5232/initialize")
with h5py.File("compression_benchmark.h5", "r") as f:
img = f["/entry/data/data"]
res = requests.put(url="http://localhost:5232/config/internal_generator_image?id=0", data = img[0, :, :].tobytes())
res = requests.put(url="http://localhost:5232/config/internal_generator_image?id=1", data = img[1, :, :].tobytes())
res = requests.put(url="http://localhost:5232/config/internal_generator_image?id=2", data = img[2, :, :].tobytes())
res = requests.put(url="http://localhost:5232/config/internal_generator_image?id=3", data = img[3, :, :].tobytes())
res = requests.put(url="http://localhost:5232/config/internal_generator_image?id=4", data = img[4, :, :].tobytes())
start_input = {
"beam_x_pxl":1090,
"beam_y_pxl":1136,
"detector_distance_mm":75,
"incident_energy_keV":12.4,
"sample_name":"lyso",
"unit_cell":{"a":36.9, "b":78.95, "c":78.95, "alpha":90, "beta":90, "gamma":90},
"images_per_trigger":18,
"file_prefix":"lyso_test_grid",
"grid_scan": {
"n_fast":3,
"step_x_um": 5.0,
"step_y_um": -3.0,
"snake": True
}
}
requests.post("http://localhost:5232/start", json=start_input)