diff --git a/examples/detector.h5 b/examples/detector.h5 new file mode 100644 index 0000000000000000000000000000000000000000..dc8fc6ac774d86542d42e4591352c7da05354880 Binary files /dev/null and b/examples/detector.h5 differ diff --git a/examples/projection.h5 b/examples/projection.h5 index e4c4e1df717ce3ab2473d3288b9f069d80dbe3a0..442d5ed9173aa20d98a231ac535cc936d4cb9ff7 100644 Binary files a/examples/projection.h5 and b/examples/projection.h5 differ diff --git a/pyproject.toml b/pyproject.toml index 7cbc0edea22d9f801902e074c1aae6a0944745f4..36f67a7f0f29c998fb808f8c2fd6086b743a76fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "h5schemas" -version = "0.1.13" +version = "0.1.14" description = "Add your description here" readme = "README.md" authors = [ diff --git a/src/h5schemas/detector/add_detector.py b/src/h5schemas/detector/add_detector.py index 9b5063ead04750d66c1a5e51cdf9d3a4832831af..fa85970a94ecfb6925af46926f2699c00348f6d6 100644 --- a/src/h5schemas/detector/add_detector.py +++ b/src/h5schemas/detector/add_detector.py @@ -20,11 +20,22 @@ def add_detector_sample( detector_image_dimensions_px: tuple[int, int], pixel_pitch_mm: tuple[float, float], ): - h5_file["image_dimensions_px/u"][...] = detector_image_dimensions_px[0] - h5_file["image_dimensions_px/v"][...] = detector_image_dimensions_px[1] + dst = h5_file["image_dimensions_px/u"] + dst.resize((dst.shape[0] + 1,)) + dst[-1,] = detector_image_dimensions_px[0] + + dst = h5_file["image_dimensions_px/v"] + dst.resize((dst.shape[0] + 1,)) + dst[-1,] = detector_image_dimensions_px[1] + + dst = h5_file["pixel_pitch_mm/v"] + dst.resize((dst.shape[0] + 1,)) + dst[-1,] = pixel_pitch_mm[0] + + dst = h5_file["pixel_pitch_mm/v"] + dst.resize((dst.shape[0] + 1,)) + dst[-1,] = pixel_pitch_mm[1] - h5_file["pixel_pitch_mm/u"][...] = pixel_pitch_mm[0] - h5_file["pixel_pitch_mm/v"][...] = pixel_pitch_mm[1] def get_detector_schemas(): @@ -33,4 +44,4 @@ def get_detector_schemas(): if __name__ == "__main__": test_file = File("./examples/detector.h5", "w") - init_detector(test_file) + init_detector(test_file, (128, 128), (0.139, 0.139)) diff --git a/uv.lock b/uv.lock index dcf914aae7e0effa6c70bec0b18e8306d336b1ac..695c5ddce5966b32dd459c6df3caa55366b71332 100644 --- a/uv.lock +++ b/uv.lock @@ -52,7 +52,7 @@ wheels = [ [[package]] name = "h5schemas" -version = "0.1.12" +version = "0.1.14" source = { editable = "." } dependencies = [ { name = "h5py" }, @@ -85,16 +85,16 @@ wheels = [ [[package]] name = "hypothesis" -version = "6.129.4" +version = "6.130.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "attrs" }, { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "sortedcontainers" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/bb/98/0051e770d36f7e0a55bcfa3590790448d57ed2f355da9adbb957b1f545d9/hypothesis-6.129.4.tar.gz", hash = "sha256:e9fd66c25b8f0aa6395ce6728360892c3af22529cc16cae7512a4672776d4781", size = 425235 } +sdist = { url = "https://files.pythonhosted.org/packages/25/01/3cca6316aaa0474e109f93c8fda2a31c23de92d86f4826f79ea0c0e6d011/hypothesis-6.130.0.tar.gz", hash = "sha256:274050b4518611500a55f7a5d0247a5359dce0107cb20f10323d6b587cc522d2", size = 425943 } wheels = [ - { url = "https://files.pythonhosted.org/packages/8d/7c/7266143385cbd19c839f9b61cc660d74c5ce2626fea41d8b215ccc5cfba3/hypothesis-6.129.4-py3-none-any.whl", hash = "sha256:45a31fe2b936688b2954f375c7f87e9dfefa4f2cddfa31cdeba15d77600e1286", size = 489542 }, + { url = "https://files.pythonhosted.org/packages/46/2b/638b52450e44d83230a12b1dd366c1c5c315b171432d4b1e8213e0cb5e04/hypothesis-6.130.0-py3-none-any.whl", hash = "sha256:b75e6fc4738d2e2a1b75d151432cb06e1303de3142905cd7060ba293c18376ce", size = 490230 }, ] [[package]] @@ -418,8 +418,8 @@ wheels = [ [[package]] name = "thd-json" -version = "0.1.12" -source = { git = "https://mygit.th-deg.de/roboct-public/roboct-schemas#f9f601e871cd8a514e4df9884a17777bc2474c21" } +version = "0.1.13" +source = { git = "https://mygit.th-deg.de/roboct-public/roboct-schemas#0f378205d14a78c744808eba8b5523e9ed2d075f" } dependencies = [ { name = "hatchling" }, { name = "hypothesis" },