Compare commits
32 Commits
1.0.0-test
...
1.0.0_rc.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b9ce9a26e | |||
| 3035d9e144 | |||
| 53b5a304d3 | |||
| 30a92d8eb9 | |||
| 81df571961 | |||
| 1717e171b9 | |||
| 4e59930972 | |||
| a32c7274a6 | |||
| 8809b8d0d5 | |||
| 86b3934387 | |||
| 7d9dcf2721 | |||
| 953c3fa972 | |||
| 5d7a4e1ff2 | |||
| f85b87bfd2 | |||
| 500222bdcc | |||
| c4d677f05b | |||
| 76ff39c012 | |||
| 3ef89483e8 | |||
| e185fbb3f5 | |||
| 701c083739 | |||
| 03662506c6 | |||
| 1b297babe9 | |||
| adc7aa7c7d | |||
| 27e17c316d | |||
| d7d66dc85c | |||
| 2a8fc3a466 | |||
| e4acd93b88 | |||
| 4ca397bd42 | |||
| 4d780c1dda | |||
| 949f693311 | |||
| 2b945f6dfa | |||
| 91fd44bff7 |
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
cmake-build-debug/
|
||||
cmake-build-release/
|
||||
build*/
|
||||
119
.gitlab-ci.yml
119
.gitlab-ci.yml
@@ -2,11 +2,11 @@ stages:
|
||||
- build
|
||||
- test
|
||||
- synthesis
|
||||
- release
|
||||
|
||||
build:x86:gcc:
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
@@ -23,7 +23,6 @@ build:x86:gcc:
|
||||
build:x86:gcc_writer:
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
@@ -35,12 +34,11 @@ build:x86:gcc_writer:
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release -DJFJOCH_WRITER_ONLY=ON ..
|
||||
- make -j48 jfjoch
|
||||
- make -j48
|
||||
|
||||
build:x86:driver:
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
tags:
|
||||
@@ -49,18 +47,16 @@ build:x86:driver:
|
||||
needs: []
|
||||
artifacts:
|
||||
paths:
|
||||
- "jfjoch_driver_*.tar.gz"
|
||||
- "jfjoch_driver.tar.gz"
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- cd fpga/pcie_driver
|
||||
- make
|
||||
- bash pack.sh
|
||||
- mv jfjoch_driver_*.tar.gz ../..
|
||||
- mv jfjoch_driver.tar.gz ../..
|
||||
|
||||
build:x86:vitis_hls:
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
@@ -83,27 +79,43 @@ build:x86:vitis_hls:
|
||||
|
||||
build:x86:frontend:
|
||||
stage: build
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- cd frontend_ui
|
||||
- npm install
|
||||
- npm run build
|
||||
- mkdir build
|
||||
- cd build
|
||||
- zip -r ../../frontend.${CI_COMMIT_SHORT_SHA}.zip *
|
||||
- /usr/bin/cmake ..
|
||||
- make frontend
|
||||
- cd ../frontend_ui/build
|
||||
- tar czf ../../jfjoch_frontend.tar.gz *
|
||||
artifacts:
|
||||
paths:
|
||||
- frontend.${CI_COMMIT_SHORT_SHA}.zip
|
||||
- jfjoch_frontend.tar.gz
|
||||
expire_in: 1 week
|
||||
|
||||
build:x86:rpm:
|
||||
stage: build
|
||||
tags:
|
||||
- x86
|
||||
needs: []
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make frontend
|
||||
- make -j48 package
|
||||
- mv *.rpm ..
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.rpm"
|
||||
expire_in: 1 week
|
||||
|
||||
test:x86:gcc:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -112,18 +124,16 @@ test:x86:gcc:
|
||||
tags:
|
||||
- gcc
|
||||
- x86
|
||||
- ib
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
- make -j48 CatchTest CompressionBenchmark HDF5DatasetWriteTest
|
||||
- make -j48 jfjoch_test HDF5DatasetWriteTest
|
||||
- cd tests
|
||||
- ./CatchTest -r junit -o report.xml
|
||||
- ./jfjoch_test -r junit -o report.xml
|
||||
- cd ../tools
|
||||
- ./HDF5DatasetWriteTest ../../tests/test_data/compression_benchmark.h5
|
||||
- numactl -m 0 -N 0 ./CompressionBenchmark ../../tests/test_data/compression_benchmark.h5
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
reports:
|
||||
@@ -133,7 +143,6 @@ test:x86:crystfel:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -157,7 +166,6 @@ test:x86:xds_durin:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -181,7 +189,6 @@ test:x86:xds_neggia:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -205,7 +212,6 @@ test:x86:xia2.ssx:
|
||||
stage: test
|
||||
timeout: 90m
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
@@ -229,43 +235,44 @@ test:x86:xia2.ssx:
|
||||
|
||||
synthesis:vivado_pcie_100g:
|
||||
stage: synthesis
|
||||
dependencies: []
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
allow_failure: true
|
||||
changes:
|
||||
- fpga/hls/*
|
||||
- fpga/hdl/*
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/include/jfjoch_fpga.h
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
tags:
|
||||
- vivado
|
||||
retry: 1
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.mcs"
|
||||
- "jfjoch_fpga_pcie_100g.mcs"
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
|
||||
- touch jfjoch_fpga_pcie_100g.mcs
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make pcie_100g
|
||||
- mv fpga/*.mcs ..
|
||||
needs: ["build:x86:gcc", "build:x86:vitis_hls", "test:x86:gcc"]
|
||||
- make -j4 pcie_100g
|
||||
- mv fpga/jfjoch_fpga_pcie_100g.mcs ..
|
||||
needs: ["build:x86:gcc", "test:x86:gcc"]
|
||||
|
||||
synthesis:vivado_pcie_8x10g:
|
||||
stage: synthesis
|
||||
dependencies: []
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
CC: gcc
|
||||
CXX: g++
|
||||
allow_failure: true
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
- if: $CI_PIPELINE_SOURCE == "push"
|
||||
@@ -274,19 +281,55 @@ synthesis:vivado_pcie_8x10g:
|
||||
- fpga/hdl/*
|
||||
- fpga/scripts/*
|
||||
- fpga/xdc/*
|
||||
- fpga/include/jfjoch_fpga.h
|
||||
- fpga/pcie_driver/jfjoch_fpga.h
|
||||
allow_failure: true
|
||||
tags:
|
||||
- vivado
|
||||
retry: 1
|
||||
artifacts:
|
||||
paths:
|
||||
- "*.mcs"
|
||||
- "jfjoch_fpga_pcie_8x10g.mcs"
|
||||
expire_in: 1 week
|
||||
script:
|
||||
- source /opt/rh/gcc-toolset-12/enable
|
||||
- source /opt/Xilinx/Vivado/2022.1/settings64.sh
|
||||
- touch jfjoch_fpga_pcie_8x10g.mcs
|
||||
- mkdir -p build
|
||||
- cd build
|
||||
- /usr/bin/cmake ..
|
||||
- make pcie_8x10g
|
||||
- mv fpga/*.mcs ..
|
||||
needs: [ "build:x86:gcc", "build:x86:vitis_hls", "test:x86:gcc" ]
|
||||
- make -j4 pcie_8x10g
|
||||
- mv fpga/jfjoch_fpga_pcie_8x10g.mcs ..
|
||||
needs: [ "build:x86:gcc", "test:x86:gcc" ]
|
||||
|
||||
release:
|
||||
stage: release
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
||||
when: manual
|
||||
tags:
|
||||
- x86
|
||||
dependencies:
|
||||
- synthesis:vivado_pcie_8x10g
|
||||
- synthesis:vivado_pcie_100g
|
||||
- build:x86:frontend
|
||||
- build:x86:driver
|
||||
- build:x86:rpm
|
||||
script:
|
||||
- export PACKAGE_VERSION=`head -n1 VERSION`
|
||||
- export PACKAGE_REGISTRY_URL="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/jungfraujoch/${PACKAGE_VERSION}"
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm "${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_driver.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_frontend.tar.gz "${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_100g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs"'
|
||||
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file jfjoch_fpga_pcie_8x10g.mcs "${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs"'
|
||||
- >
|
||||
release-cli create --name "Release $PACKAGE_VERSION" --tag-name $PACKAGE_VERSION
|
||||
--assets-link "{\"name\":\"jfjoch_driver.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_driver.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_frontend.tar.gz\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_frontend.tar.gz\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_fpga_pcie_8x10g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_8x10g.mcs\"}"
|
||||
--assets-link "{\"name\":\"jfjoch_fpga_pcie_100g.mcs\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch_fpga_pcie_100g.mcs\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-writer-${PACKAGE_VERSION}-1.el8.x86_64.rpm\",\"link_type\":\"package\"}"
|
||||
--assets-link "{\"name\":\"jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"url\":\"${PACKAGE_REGISTRY_URL}/jfjoch-driver-dkms-${PACKAGE_VERSION}-1.el8.noarch.rpm\",\"link_type\":\"package\"}"
|
||||
|
||||
19
.gitmodules
vendored
19
.gitmodules
vendored
@@ -1,19 +0,0 @@
|
||||
[submodule "image_analysis/fast-feedback-indexer"]
|
||||
path = image_analysis/fast-feedback-indexer
|
||||
url = https://github.com/paulscherrerinstitute/fast-feedback-indexer/
|
||||
[submodule "frame_serialize/tinycbor"]
|
||||
path = frame_serialize/tinycbor
|
||||
url = https://github.com/intel/tinycbor
|
||||
[submodule "compression/zstd"]
|
||||
path = compression/zstd
|
||||
url = https://github.com/facebook/zstd
|
||||
[submodule "detector_control/slsDetectorPackage"]
|
||||
path = detector_control/slsDetectorPackage
|
||||
url = https://github.com/fleon-psi/slsDetectorPackage
|
||||
branch = "jfjoch-shmem"
|
||||
[submodule "compression/bitshuffle_hperf"]
|
||||
path = compression/bitshuffle_hperf
|
||||
url = https://github.com/kalcutter/bitshuffle
|
||||
[submodule "broker/pistache"]
|
||||
path = broker/pistache
|
||||
url = https://github.com/fleon-psi/pistache
|
||||
139
CMakeLists.txt
139
CMakeLists.txt
@@ -1,7 +1,9 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.19)
|
||||
|
||||
PROJECT(Jungfraujoch VERSION 1.0 LANGUAGES C CXX)
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
FILE(STRINGS VERSION JFJOCH_VERSION)
|
||||
|
||||
PROJECT(jfjoch VERSION 1.0.0 LANGUAGES C CXX)
|
||||
SET(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||
|
||||
SET(CMAKE_CXX_STANDARD 20)
|
||||
SET(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
@@ -9,6 +11,32 @@ SET(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -Wno-deprecated-enum-enum-conversion")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-O3 -march=native -mtune=native")
|
||||
|
||||
SET(BUILD_SHARED_LIBS OFF)
|
||||
SET(BUILD_TESTING OFF)
|
||||
|
||||
SET(ZSTD_LEGACY_SUPPORT OFF)
|
||||
SET(ZSTD_MULTITHREAD_SUPPORT OFF)
|
||||
SET(ZSTD_BUILD_PROGRAMS OFF)
|
||||
SET(ZSTD_BUILD_SHARED OFF)
|
||||
|
||||
SET(SLS_USE_RECEIVER OFF)
|
||||
SET(SLS_USE_RECEIVER_BINARIES OFF)
|
||||
SET(SLS_BUILD_SHARED_LIBRARIES OFF)
|
||||
|
||||
SET(BUILD_FAST_INDEXER OFF)
|
||||
SET(BUILD_FAST_INDEXER_STATIC ON)
|
||||
|
||||
SET(HDF5_ENABLE_SZIP_SUPPORT OFF)
|
||||
SET(HDF5_ENABLE_SZIP_ENCODING OFF)
|
||||
SET(HDF5_BUILD_EXAMPLES OFF)
|
||||
SET(HDF5_BUILD_CPP_LIB OFF)
|
||||
SET(HDF5_ENABLE_Z_LIB_SUPPORT OFF)
|
||||
SET(HDF5_EXTERNALLY_CONFIGURED 1)
|
||||
|
||||
SET(jbig OFF)
|
||||
SET(zstd OFF)
|
||||
SET(lzma OFF)
|
||||
|
||||
INCLUDE(CheckLanguage)
|
||||
CHECK_LANGUAGE(CUDA)
|
||||
|
||||
@@ -28,19 +56,52 @@ SET(JFJOCH_WRITER_ONLY OFF CACHE BOOL "Compile HDF5 writer only")
|
||||
INCLUDE_DIRECTORIES(include)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
|
||||
#This is to supress error in TORCH
|
||||
|
||||
IF ((NOT EXISTS /usr/bin/python) AND (EXISTS /usr/bin/python3))
|
||||
SET(PYTHON_EXECUTABLE /usr/bin/python3)
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(Torch HINTS /opt/libtorch/share/cmake/Torch/)
|
||||
FIND_LIBRARY(NUMA_LIBRARY NAMES numa DOC "NUMA Library")
|
||||
CHECK_INCLUDE_FILE(numaif.h HAS_NUMAIF)
|
||||
CHECK_INCLUDE_FILE(numa.h HAS_NUMA_H)
|
||||
|
||||
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
#FIND_PACKAGE(ZeroMQ 4 REQUIRED)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(tiff
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/libtiff
|
||||
GIT_TAG v4.6.0
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
FetchContent_Declare(hdf5
|
||||
GIT_REPOSITORY https://github.com/HDFGroup/hdf5/
|
||||
GIT_TAG hdf5_1.14.4.2
|
||||
GIT_SHALLOW 1
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
FetchContent_Declare(
|
||||
pistache_http
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/pistache
|
||||
GIT_TAG 51553b92cc7bb25ac792462722ddd4fae33d14b1
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
zstd
|
||||
GIT_REPOSITORY https://github.com/facebook/zstd
|
||||
GIT_TAG 794ea1b0afca0f020f4e57b6732332231fb23c70
|
||||
SOURCE_SUBDIR build/cmake
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
sls_detector_package
|
||||
GIT_REPOSITORY https://github.com/fleon-psi/slsDetectorPackage
|
||||
GIT_TAG bae261433241ff2f458350e26ab026f00f01c427
|
||||
)
|
||||
|
||||
FetchContent_Declare(
|
||||
catch2
|
||||
GIT_REPOSITORY https://github.com/catchorg/Catch2
|
||||
GIT_TAG 4e8d92b
|
||||
EXCLUDE_FROM_ALL
|
||||
)
|
||||
|
||||
FetchContent_MakeAvailable(pistache_http zstd sls_detector_package catch2 hdf5 tiff)
|
||||
|
||||
ADD_SUBDIRECTORY(jungfrau)
|
||||
ADD_SUBDIRECTORY(compression)
|
||||
@@ -48,11 +109,9 @@ ADD_SUBDIRECTORY(common)
|
||||
ADD_SUBDIRECTORY(writer)
|
||||
ADD_SUBDIRECTORY(frame_serialize)
|
||||
|
||||
ADD_SUBDIRECTORY(broker/pistache)
|
||||
ADD_SUBDIRECTORY(detector_control)
|
||||
IF (JFJOCH_WRITER_ONLY)
|
||||
MESSAGE(STATUS "Compiling HDF5 writer only")
|
||||
SET(jfjoch_executables jfjoch_writer)
|
||||
ELSE()
|
||||
ADD_SUBDIRECTORY(broker)
|
||||
ADD_SUBDIRECTORY(fpga)
|
||||
@@ -62,17 +121,57 @@ ELSE()
|
||||
ADD_SUBDIRECTORY(tests)
|
||||
ADD_SUBDIRECTORY(tools)
|
||||
ADD_SUBDIRECTORY(preview)
|
||||
ADD_SUBDIRECTORY(resonet)
|
||||
SET(jfjoch_executables jfjoch_broker jfjoch_writer CatchTest CompressionBenchmark HDF5DatasetWriteTest jfjoch_udp_simulator sls_detector_put sls_detector_get)
|
||||
ENDIF()
|
||||
|
||||
ADD_CUSTOM_COMMAND(OUTPUT frontend_ui/build/index.html
|
||||
COMMAND npm run build
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui)
|
||||
ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html)
|
||||
IF (NOT JFJOCH_WRITER_ONLY)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT frontend_ui/build/index.html
|
||||
COMMAND npm install
|
||||
COMMAND npm run build
|
||||
COMMAND npm run redocly
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui)
|
||||
ADD_CUSTOM_TARGET(frontend DEPENDS frontend_ui/build/index.html)
|
||||
|
||||
ADD_CUSTOM_TARGET(jfjoch DEPENDS ${jfjoch_executables})
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
|
||||
DESTINATION /usr/src/jfjoch-1.0.0
|
||||
COMPONENT driver-dkms
|
||||
FILES_MATCHING PATTERN "dkms.conf")
|
||||
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/
|
||||
DESTINATION /usr/src/jfjoch-1.0.0/src
|
||||
COMPONENT driver-dkms
|
||||
FILES_MATCHING PATTERN "*.c" PATTERN "*.h" PATTERN "Makefile")
|
||||
|
||||
FILE(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui/build/)
|
||||
INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/frontend_ui/build/ DESTINATION share/jfjoch/frontend COMPONENT jfjoch )
|
||||
ENDIF()
|
||||
|
||||
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
SET(CMAKE_INSTALL_PREFIX /opt/jfjoch CACHE PATH "Default directory" FORCE)
|
||||
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
# Set Package Name
|
||||
set(CPACK_PACKAGE_NAME "jfjoch")
|
||||
|
||||
SET(CPACK_COMPONENTS_ALL jfjoch writer driver-dkms)
|
||||
SET(CPACK_GENERATOR RPM)
|
||||
SET(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
SET(CPACK_RPM_MAIN_COMPONENT jfjoch)
|
||||
SET(CPACK_RPM_PACKAGE_RELEASE_DIST ON)
|
||||
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
SET(CPACK_RPM_PACKAGE_VERSION ${JFJOCH_VERSION})
|
||||
SET(CPACK_RPM_PACKAGE_RELEASE 1)
|
||||
SET(CPACK_RPM_PACKAGE_SUMMARY "Jungfraujoch data acquisition system")
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION "Jungfraujoch")
|
||||
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_REQUIRES "dkms, gcc, bash, sed")
|
||||
SET(CPACK_RPM_DRIVER-DKMS_PACKAGE_ARCHITECTURE "noarch")
|
||||
SET(CPACK_RPM_DRIVER-DKMS_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/postinstall.sh)
|
||||
SET(CPACK_RPM_DRIVER-DKMS_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/fpga/pcie_driver/preuninstall.sh)
|
||||
SET(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/src)
|
||||
|
||||
# Set The Vendor Name
|
||||
SET(CPACK_PACKAGE_VENDOR "Paul Scherrer Institut")
|
||||
|
||||
# Set The License Information
|
||||
SET(CPACK_RPM_PACKAGE_LICENSE "Proprietary")
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
# MAX IV docker config
|
||||
|
||||
FROM harbor.maxiv.lu.se/dockerhub/library/ubuntu:22.04
|
||||
|
||||
RUN set -ex; \
|
||||
apt-get update; \
|
||||
apt-get install -y pkg-config git cmake make g++ libhdf5-dev libczmq-dev;\
|
||||
apt-get install -y pkg-config git cmake make g++;\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
|
||||
48
README.md
48
README.md
@@ -7,6 +7,7 @@ Citation: F. Leonarski, M. Bruckner, C. Lopez-Cuenca, A. Mozzanica, H.-C. Stadle
|
||||
The project is supported by :
|
||||
* Innosuisse via Innovation Project "NextGenDCU high data rate acquisition system for X-ray detectors in structural biology applications" (101.535.1 IP-ENG; Apr 2023 - Sep 2025).
|
||||
* ETH Domain via Open Research Data Contribute project (Jan - Dec 2023)
|
||||
* AMD University Program with donation of licenses of Ethernet IP cores and Vivado software
|
||||
|
||||
## License
|
||||
|
||||
@@ -33,32 +34,31 @@ Other linux platforms should work, but no tests were done so far.
|
||||
### Dependencies
|
||||
Required:
|
||||
* C++20 compiler and C++20 standard library; recommended GCC 11+ or clang 14+ (Intel OneAPI, AMD AOCC)
|
||||
* CMake version 3.21 or newer + GNU make tool
|
||||
* HDF5 library version 1.10 or newer
|
||||
* TIFF library (with C++ headers)
|
||||
* CMake version 3.21 or newer + GNU make tool
|
||||
* JPEG library (turbo-jpeg is also OK)
|
||||
|
||||
Optional:
|
||||
* CUDA compiler version 11 or newer - required for MX indexing and ML resolution estimation
|
||||
* CUDA compiler version 11 or newer - required for MX fast feedback indexer
|
||||
* NUMA library - to pin threads to nodes/CPUs
|
||||
* Node.js - to make frontend
|
||||
* libtorch - for resolution estimation using model from Stanford - see below
|
||||
|
||||
Provided as GIT submodules:
|
||||
Automatically downloaded by CMake and statically linked:
|
||||
* SLS Detector Package - see [github.com/slsdetectorgroup/slsDetectorPackage](https://github.com/slsdetectorgroup/slsDetectorPackage)
|
||||
* tinycbor (Intel) - see [github.com/intel/tinycbor](https://github.com/intel/tinycbor)
|
||||
* Zstandard (Facebook) - see [github.com/facebook/zstd](https://github.com/facebook/zstd)
|
||||
* Pistache webserver - see [github.com/pistacheio/pistache](https://github.com/pistacheio/pistache)
|
||||
* Fast feedback indexer (Hans-Christian Stadler, PSI) - see [github.com/paulscherrerinstitute/fast-feedback-indexer](https://github.com/paulscherrerinstitute/fast-feedback-indexer)
|
||||
* fast replacement for Bitshuffle pre-compression filter (Kal Cutter, DECTRIS) - see [github.com/kalcutter/bitshuffle](https://github.com/kalcutter/bitshuffle)
|
||||
* Catch2 testing library - see [github.com/catchorg/Catch2](https://github.com/catchorg/Catch2)
|
||||
* HDF5 library - see [github.com/HDFGroup/hdf5](https://github.com/HDFGroup/hdf5)
|
||||
* TIFF library - see [gitlab.com/libtiff/libtiff](https://gitlab.com/libtiff/libtiff)
|
||||
|
||||
For license check LICENSE file in respective directory
|
||||
Please follow the link provided above to check for LICENSE file. Building code with dependencies above requires access from the build system to github.com.
|
||||
|
||||
Directly included in the repository:
|
||||
* JSON parser/writer from N. Lohmann - see [github.com/nlohmann/json](https://github.com/nlohmann/json)
|
||||
* Catch2 testing library - see [github.com/catchorg/Catch2](https://github.com/catchorg/Catch2)
|
||||
* Xilinx arbitrary precision arithmetic headers - see [github.com/Xilinx/HLS_arbitrary_Precision_Types](https://github.com/Xilinx/HLS_arbitrary_Precision_Types)
|
||||
* Bitshuffle filter from K. Masui - see [github.com/kiyo-masui/bitshuffle](https://github.com/kiyo-masui/bitshuffle)
|
||||
* Fast replacement for Bitshuffle pre-compression filter (Kal Cutter, DECTRIS) - see [github.com/kalcutter/bitshuffle](https://github.com/kalcutter/bitshuffle)
|
||||
* Tinycbor (Intel) - see [github.com/intel/tinycbor](https://github.com/intel/tinycbor)
|
||||
* LZ4 compression by Y.Collet - see [github.com/lz4/lz4](https://github.com/lz4/lz4)
|
||||
* Spdlog logging library - see [github.com/gabime/spdlog](https://github.com/gabime/spdlog)
|
||||
* ZeroMQ library (through slsDetectorPackage) - see [github.com/zeromq/libzmq](https://github.com/zeromq/libzmq)
|
||||
@@ -68,15 +68,14 @@ For license check LICENSE file in respective directory
|
||||
### Software components
|
||||
|
||||
* `jfjoch_broker` in `broker` - main service running on the Jungfraujoch server, responsible for control of the detector and data acquisition;
|
||||
Example configuration `jfjoch_broker` for the modules is given in configuration files present in `etc` directory.
|
||||
Example configuration `jfjoch_broker` for the modules is given in configuration files present in `etc` directory. See [details](broker/README.md).
|
||||
* `jfjoch_writer` in `writer` - HDF5 writer; HDF5 writer is designed to work on the same or separate server system. It has rather limited requirements in terms of performance and memory.
|
||||
The goal is to separate data acquisition node with custom FPGA hardware and file system node with stronger security/stability requirements.
|
||||
The goal is to separate data acquisition node with custom FPGA hardware and file system node with stronger security/stability requirements. See [details](writer/README.md).
|
||||
|
||||
### Compilation
|
||||
Use the following commands:
|
||||
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@@ -85,10 +84,9 @@ make jfjoch
|
||||
|
||||
### Compilation (writer only)
|
||||
In most use cases it is better to have a separate machine, with access to distributed file system, for writing.
|
||||
Such machine needs only a HDF5 writer service with less dependencies. For compilation use the following commands:
|
||||
Such machine needs only a HDF5 writer service with fewer dependencies. For compilation use the following commands:
|
||||
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DJFJOCH_WRITER_ONLY=ON ..
|
||||
@@ -96,8 +94,7 @@ make jfjoch
|
||||
```
|
||||
|
||||
## Versions
|
||||
**FPGA release** is as hexadecimal number indicted in the [jfjoch_fpga.h](fpga/pcie_driver/jfjoch_fpga.h) as JFJOCH_FPGA_RELEASE constant.
|
||||
It is also included in the name of FPGA firmware file (.mcs) and kernel driver archive. This number indicated breaking changes in the FPGA firmware interface.
|
||||
**FPGA release** is as hexadecimal number indicted in the [jfjoch_fpga.h](fpga/pcie_driver/jfjoch_fpga.h) as JFJOCH_FPGA_RELEASE constant. This number indicated breaking changes in the FPGA firmware interface.
|
||||
FPGA release has to be consistent between FPGA firmware, kernel driver and `jfjoch_broker` - both kernel driver and software won't work in case of version mismatch.
|
||||
Commits to `main` branch with the same FPGA release version are OK to mix between components.
|
||||
|
||||
@@ -113,7 +110,6 @@ Frontend is written in TypeScript. For details see [frontend_ui/](frontend_ui) d
|
||||
|
||||
Jungfraujoch Cmake scripts have an option to start frontend build with the following command:
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@@ -123,25 +119,11 @@ Contrary to standard CMake way, frontend will be built in "source" `frontend_ui/
|
||||
|
||||
## Tests
|
||||
|
||||
Automated test routine is then accessible as `tests/CatchTest`. There are also benchmark routines:
|
||||
Automated test routine is then accessible as `tests/jfjoch_test`. There are also benchmark routines:
|
||||
|
||||
* `CompressionBenchmark` to measure compression bandwidth (single threaded)
|
||||
* `HDF5DatasetWriteTest` to measure HDF5 dataset writing speed (single threaded)
|
||||
* `jfjoch_spot_finding_test` to apply spot finding and indexing routines in Jungfraujoch to an example dataset - this is equivalent to FPGA spot finding algorithm, but NOT performance equivalent as it is particularly not-efficient
|
||||
* `jfjoch_action_test` to test quality/performance of FPGA card(s) and software routines
|
||||
|
||||
In addition, tests are executed to verify that datasets written by Jungfraujoch are readable with XDS Durin plugin, XDS Neggia plygin and CrystFEL.
|
||||
Input files for these programs are placed in `xds_durin`, `xds_neggia` and `crystfel` folders. See `.gitlab-ci.yml` for details.
|
||||
|
||||
## Resolution estimation
|
||||
|
||||
Resolution estimation can be done with a recent deep learning model by D. Mendez et al.
|
||||
(see [Acta Cryst D, 80, 26-43](https://doi.org/10.1107/S2059798323010586)), adapted to Jungfraujoch.
|
||||
Model used in the original paper is located in the [resonet/](resonet) directory, after converting to TorchScript format.
|
||||
|
||||
To use the feature it is necessary to install [libtorch](https://pytorch.org/) library, preferably in `/opt/libtorch` location. The C++11 ABI version needs to be chosen.
|
||||
For RHEL 8 systems, please download older version 2.1.0, as version 2.2.0 requires newer `glibc` library than available with the operating system.
|
||||
Version 2.1.0 can be downloaded with the following command:
|
||||
```
|
||||
wget https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0%2Bcu121.zip
|
||||
```
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
AUX_SOURCE_DIRECTORY(gen/model MODEL_SOURCES)
|
||||
|
||||
ADD_LIBRARY(JFJochAPI STATIC ${MODEL_SOURCES} gen/api/DefaultApi.cpp gen/api/DefaultApi.h)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochAPI pistache_static)
|
||||
@@ -14,6 +15,6 @@ TARGET_LINK_LIBRARIES(JFJochBroker JFJochReceiver JFJochDetector JFJochCommon JF
|
||||
ADD_EXECUTABLE(jfjoch_broker jfjoch_broker.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_broker JFJochBroker)
|
||||
|
||||
INSTALL(TARGETS jfjoch_broker RUNTIME)
|
||||
|
||||
INSTALL(TARGETS jfjoch_broker RUNTIME COMPONENT jfjoch)
|
||||
|
||||
INSTALL(FILES redoc-static.html DESTINATION jfjoch/frontend COMPONENT jfjoch )
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "JFJochBrokerHttp.h"
|
||||
#include "gen/model/Error_message.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
#include "../common/GitInfo.h"
|
||||
|
||||
// From https://en.cppreference.com/w/cpp/string/byte/tolower
|
||||
inline std::string str_tolower(std::string s) {
|
||||
@@ -22,6 +24,10 @@ inline SpotFindingSettings Convert(const org::openapitools::server::model::Spot_
|
||||
ret.enable = input.isEnable();
|
||||
ret.indexing = input.isIndexing();
|
||||
ret.indexing_tolerance = input.getIndexingTolerance();
|
||||
if (input.filterPowderRingsIsSet())
|
||||
ret.filter_spots_powder_ring = input.isFilterPowderRings();
|
||||
if (input.minSpotCountPowderRingIsSet())
|
||||
ret.min_spot_count_powder_ring = input.getMinSpotCountPowderRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -36,6 +42,8 @@ inline org::openapitools::server::model::Spot_finding_settings Convert(const Spo
|
||||
ret.setEnable(input.enable);
|
||||
ret.setIndexing(input.indexing);
|
||||
ret.setIndexingTolerance(input.indexing_tolerance);
|
||||
ret.setFilterPowderRings(input.filter_spots_powder_ring);
|
||||
ret.setMinSpotCountPowderRing(input.min_spot_count_powder_ring);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -45,6 +53,7 @@ inline org::openapitools::server::model::Measurement_statistics Convert(const Me
|
||||
if (!input.file_prefix.empty())
|
||||
ret.setFilePrefix(input.file_prefix);
|
||||
|
||||
ret.setExperimentGroup(input.experiment_group);
|
||||
ret.setImagesExpected(input.images_expected);
|
||||
ret.setImagesCollected(input.images_collected);
|
||||
ret.setImagesSent(input.images_sent);
|
||||
@@ -67,7 +76,8 @@ inline org::openapitools::server::model::Measurement_statistics Convert(const Me
|
||||
|
||||
if (input.bkg_estimate)
|
||||
ret.setBkgEstimate(input.bkg_estimate.value());
|
||||
|
||||
ret.setUnitCell(input.unit_cell);
|
||||
ret.setRunNumber(input.run_number);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -184,10 +194,10 @@ inline org::openapitools::server::model::Detector_status Convert(const DetectorS
|
||||
output.setHighVoltageV(input.high_voltage_V);
|
||||
switch (input.power_state) {
|
||||
case DetectorPowerState::ON:
|
||||
output.setPowerchip("On");
|
||||
output.setPowerchip("PowerOn");
|
||||
break;
|
||||
case DetectorPowerState::OFF:
|
||||
output.setPowerchip("Off");
|
||||
output.setPowerchip("PowerOff");
|
||||
break;
|
||||
case DetectorPowerState::PARTIAL:
|
||||
output.setPowerchip("Partial");
|
||||
@@ -316,6 +326,9 @@ inline PreviewJPEGSettings Convert(const org::openapitools::server::model::Previ
|
||||
ret.saturation_value = input.getSaturation();
|
||||
ret.show_roi = input.isShowRoi();
|
||||
ret.show_indexed = input.isShowIndexed();
|
||||
ret.show_user_mask = input.isShowUserMask();
|
||||
if (input.resolutionRingIsSet())
|
||||
ret.resolution_ring = input.getResolutionRing();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -325,6 +338,13 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s
|
||||
ret.ImagesPerTrigger(input.getImagesPerTrigger());
|
||||
ret.NumTriggers(input.getNtrigger());
|
||||
|
||||
if (input.runNumberIsSet())
|
||||
ret.RunNumber(input.getRunNumber());
|
||||
if (input.runNameIsSet())
|
||||
ret.RunName(input.getRunName());
|
||||
|
||||
ret.ExperimentGroup(input.getExperimentGroup());
|
||||
|
||||
if (!input.fpgaOutputIsSet())
|
||||
ret.FPGAOutputMode(FPGAPixelOutput::Auto);
|
||||
else {
|
||||
@@ -343,13 +363,13 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown output format");
|
||||
}
|
||||
|
||||
ret.Summation(input.getSummation());
|
||||
if (input.imageTimeUsIsSet())
|
||||
ret.ImageTime(std::chrono::microseconds(input.getImageTimeUs()));
|
||||
ret.BeamX_pxl(input.getBeamXPxl());
|
||||
ret.BeamY_pxl(input.getBeamYPxl());
|
||||
ret.DetectorDistance_mm(input.getDetectorDistanceMm());
|
||||
ret.PhotonEnergy_keV(input.getPhotonEnergyKeV());
|
||||
|
||||
ret.PhotonEnergyMultiplayer(input.getPhotonEnergyMultiplier());
|
||||
ret.PhotonEnergy_keV(input.getIncidentEnergyKeV());
|
||||
ret.PhotonEnergyMultiplayer(input.getEnergyMultiplier());
|
||||
|
||||
ret.FilePrefix(input.getFilePrefix());
|
||||
|
||||
@@ -384,12 +404,15 @@ inline DatasetSettings Convert(const org::openapitools::server::model::Dataset_s
|
||||
if (input.transmissionIsSet())
|
||||
ret.AttenuatorTransmission(input.getTransmission());
|
||||
|
||||
if (input.omegaIsSet()) {
|
||||
ret.OmegaStep(input.getOmega().getStep());
|
||||
ret.OmegaStart(input.getOmega().getStart());
|
||||
if (input.getOmega().getVector().size() == 3) {
|
||||
auto v = input.getOmega().getVector();
|
||||
ret.OmegaAxis(Coord(v[0], v[1], v[2]));
|
||||
if (input.goniometerIsSet()) {
|
||||
ret.Goniometer(GoniometerAxis{
|
||||
.name = input.getGoniometer().getName(),
|
||||
.increment = input.getGoniometer().getStep(),
|
||||
.start = input.getGoniometer().getStart()
|
||||
});
|
||||
if (input.getGoniometer().getVector().size() == 3) {
|
||||
auto v = input.getGoniometer().getVector();
|
||||
ret.RotationAxis(Coord(v[0], v[1], v[2]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,8 +475,21 @@ void JFJochBrokerHttp::status_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetStatus()), response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::wait_till_done_post(Pistache::Http::ResponseWriter &response) {
|
||||
auto state = state_machine.WaitTillMeasurementDone(std::chrono::seconds(5));
|
||||
|
||||
|
||||
void JFJochBrokerHttp::wait_till_done_post(const std::optional<int32_t> &timeout,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
JFJochState state;
|
||||
if (!timeout)
|
||||
state = state_machine.WaitTillMeasurementDone(std::chrono::minutes(1));
|
||||
else if ((timeout.value() > 3600) || (timeout.value() < 0)) {
|
||||
response.send(Pistache::Http::Code::Bad_Request);
|
||||
return;
|
||||
} else if (timeout.value() == 0)
|
||||
state = state_machine.GetState();
|
||||
else
|
||||
state = state_machine.WaitTillMeasurementDone(std::chrono::seconds(timeout.value()));
|
||||
|
||||
switch (state) {
|
||||
case JFJochState::Idle:
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
@@ -649,25 +685,36 @@ void JFJochBrokerHttp::preview_image_tiff_get(Pistache::Http::ResponseWriter &re
|
||||
response.send(Pistache::Http::Code::Not_Found);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::plot_resolution_estimate_histogram_get(Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::ResEstimation, 0, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_internal_generator_image_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_number = 0;
|
||||
auto number_query = request.query().get("number");
|
||||
auto number_query = request.query().get("id");
|
||||
if (number_query)
|
||||
image_number = std::stoi(number_query.value());
|
||||
|
||||
if ((image_number < 0) || (image_number > 127))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "image_number must be in range 0-127");
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "id must be in range 0-127");
|
||||
|
||||
state_machine.LoadInternalGeneratorImage(request.body().data(), request.body().size(), image_number);
|
||||
logger.Info("Internal generator image #{} loaded", image_number);
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
|
||||
void JFJochBrokerHttp::config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
int64_t image_number = 0;
|
||||
auto number_query = request.query().get("id");
|
||||
if (number_query)
|
||||
image_number = std::stoi(number_query.value());
|
||||
|
||||
if ((image_number < 0) || (image_number > 127))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "id must be in range 0-127");
|
||||
|
||||
state_machine.LoadInternalGeneratorImageTIFF(request.body(), image_number);
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::roi_box_get(Pistache::Http::ResponseWriter &response) {
|
||||
ProcessOutput(Convert(state_machine.GetBoxROI()), response);
|
||||
}
|
||||
@@ -783,3 +830,23 @@ void JFJochBrokerHttp::plot_strong_pixel_get(const std::optional<int32_t> &binni
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
GenericPlot(PlotType::StrongPixels, binning, response);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
|
||||
std::string s = state_machine.GetFullPixelMaskTIFF();
|
||||
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) {
|
||||
std::string s = state_machine.GetUserPixelMaskTIFF();
|
||||
response.send(Pistache::Http::Code::Ok, s, Pistache::Http::Mime::MediaType::fromString("image/tiff"));
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) {
|
||||
state_machine.SetUserPixelMask(request.body());
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
void JFJochBrokerHttp::version_get(Pistache::Http::ResponseWriter &response) {
|
||||
response.send(Pistache::Http::Code::Ok, jfjoch_version(), MIME(Text, Plain));
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
#include <pistache/endpoint.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/client.h>
|
||||
#include <pistache/http.h>
|
||||
|
||||
#include "../common/Logger.h"
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "gen/api/DefaultApi.h"
|
||||
#include "pistache/include/pistache/http.h"
|
||||
|
||||
|
||||
class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
Logger logger{"JFJochBroker"};
|
||||
@@ -74,8 +75,6 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
|
||||
void plot_rad_int_per_file_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void plot_resolution_estimate_histogram_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void statistics_calibration_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void statistics_data_collection_get(Pistache::Http::ResponseWriter &response) override;
|
||||
@@ -91,7 +90,7 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
|
||||
void status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void wait_till_done_post(Pistache::Http::ResponseWriter &response) override;
|
||||
void wait_till_done_post(const std::optional<int32_t> &timeoutMs, Pistache::Http::ResponseWriter &response) override;
|
||||
void trigger_post(Pistache::Http::ResponseWriter &response) override;
|
||||
void pedestal_post(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
@@ -119,6 +118,16 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
void xfel_event_code_get(Pistache::Http::ResponseWriter &response) override;
|
||||
void xfel_pulse_id_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_user_mask_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request,
|
||||
Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void GetStaticFile(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception &ex) const noexcept override;
|
||||
|
||||
@@ -134,6 +143,9 @@ class JFJochBrokerHttp : public org::openapitools::server::api::DefaultApi {
|
||||
to_json(j, output);
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
void version_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
public:
|
||||
JFJochBrokerHttp(const DiffractionExperiment& experiment, std::shared_ptr<Pistache::Rest::Router> &rtr);
|
||||
void AddDetectorSetup(const DetectorSetup &setup);
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "JFJochBrokerParser.h"
|
||||
#include "../common/NetworkAddressConvert.h"
|
||||
#include "../frame_serialize/ZMQStream2Pusher.h"
|
||||
#include "../frame_serialize/DumpCBORToFilePusher.h"
|
||||
|
||||
inline bool CHECK_ARRAY(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
@@ -183,6 +185,7 @@ inline int64_t TimeToUs(const std::string &unit) {
|
||||
|
||||
inline std::chrono::microseconds GET_TIME(const nlohmann::json &j, const std::string& tag) {
|
||||
if (j.contains(tag)) {
|
||||
// If no units provided for time, this is always microsecond
|
||||
if (j[tag].is_number())
|
||||
return std::chrono::microseconds (std::lround(j[tag].get<double>() * 1000.0 * 1000.0));
|
||||
else if (j[tag].is_string()) {
|
||||
@@ -283,7 +286,8 @@ DetectorSetup ParseDetectorSetup(const nlohmann::json &j) {
|
||||
setup.UDPInterfaceCount(GET_I64(j, "udp_interface_count", 2))
|
||||
.SensorThickness_um(GET_FLOAT(j, "sensor_thickness_um", 320.0f))
|
||||
.PixelSize_um(GET_FLOAT(j, "pixel_size_um", 75.0f))
|
||||
.SensorMaterial(GET_STR(j, "sensor_material", "Si"));
|
||||
.SensorMaterial(GET_STR(j, "sensor_material", "Si"))
|
||||
.SerialNumber(GET_STR(j, "serial_number",""));
|
||||
|
||||
if (j.contains("tx_delay"))
|
||||
setup.TxDelay(GET_I64_ARR(j, "tx_delay"));
|
||||
@@ -299,39 +303,68 @@ void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochB
|
||||
throw JFJochException(JFJochExceptionCategory::JSON, "Detector setup not found");
|
||||
}
|
||||
|
||||
void ParseImagePusher(const nlohmann::json &input, std::unique_ptr<ImagePusher> &image_pusher) {
|
||||
std::string pusher_type = ParseString(input, "stream_type", "zmq");
|
||||
if (pusher_type == "zmq") {
|
||||
int32_t zmq_send_watermark = ParseInt32(input, "zmq_send_watermark", 100);
|
||||
int32_t zmq_send_buffer_size = ParseInt32(input, "zmq_send_buffer_size", -1);
|
||||
|
||||
auto tmp = std::make_unique<ZMQStream2Pusher>(ParseStringArray(input, "zmq_image_addr"),
|
||||
zmq_send_watermark,
|
||||
zmq_send_buffer_size);
|
||||
|
||||
std::string preview_addr = ParseString(input, "zmq_preview_addr", "");
|
||||
if (!preview_addr.empty())
|
||||
tmp->PreviewSocket(preview_addr);
|
||||
|
||||
if (input.contains("zmq_preview_period"))
|
||||
tmp->PreviewCounterPeriod(GET_TIME(input, "zmq_preview_period"));
|
||||
|
||||
std::string writer_notification_addr = ParseString(input, "zmq_writer_notification_addr", "");
|
||||
if (!writer_notification_addr.empty())
|
||||
tmp->WriterNotificationSocket(writer_notification_addr);
|
||||
|
||||
image_pusher = std::move(tmp);
|
||||
} else if (pusher_type == "dump_cbor") {
|
||||
image_pusher = std::make_unique<DumpCBORToFilePusher>();
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"stream_type allowed: zmq (default), dump_cbor");
|
||||
}
|
||||
|
||||
void ParseFacilityConfiguration(const nlohmann::json &input, const std::string& tag, DiffractionExperiment &experiment) {
|
||||
if (CHECK_OBJECT(input, tag)) {
|
||||
auto j = input[tag];
|
||||
experiment.SourceName(GET_STR(j, "source_name"));
|
||||
experiment.SourceNameShort(GET_STR(j, "source_name_short"));
|
||||
experiment.SourceType(GET_STR(j, "source_type", ""));
|
||||
|
||||
experiment.InstrumentName(GET_STR(j, "instrument_name"));
|
||||
experiment.InstrumentNameShort(GET_STR(j, "instrument_name_short"));
|
||||
|
||||
experiment.PulsedSource(GET_BOOL(j, "pulsed_source", false));
|
||||
|
||||
if (j.contains("omega_axis")) {
|
||||
if (j["omega_axis"].is_array() && (j["omega_axis"].size() == 3))
|
||||
experiment.DefaultOmegaAxis(Coord(j["omega_axis"][0].get<float>(),
|
||||
j["omega_axis"][1].get<float>(),
|
||||
j["omega_axis"][2].get<float>()));
|
||||
if (j.contains("rotation_axis")) {
|
||||
if (j["rotation_axis"].is_array() && (j["rotation_axis"].size() == 3))
|
||||
experiment.DefaultRotationAxis(Coord(j["rotation_axis"][0].get<float>(),
|
||||
j["rotation_axis"][1].get<float>(),
|
||||
j["rotation_axis"][2].get<float>()));
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"omega_axis must be float array of 3");
|
||||
"rotation_axis must be float array of 3");
|
||||
}
|
||||
|
||||
experiment.NeuralNetModelPath(GET_STR(j, "neural_net_model", ""));
|
||||
if (j.contains("pedestal_g0_frames"))
|
||||
experiment.PedestalG0Frames(GET_I64(j, "pedestal_g0_frames"));
|
||||
if (j.contains("pedestal_g1_frames"))
|
||||
experiment.PedestalG1Frames(GET_I64(j, "pedestal_g1_frames"));
|
||||
if (j.contains("pedestal_g2_frames"))
|
||||
experiment.PedestalG2Frames(GET_I64(j, "pedestal_g2_frames"));
|
||||
if (j.contains("detector_trigger_delay_us"))
|
||||
experiment.DetectorDelay(GET_TIME(j, "detector_trigger_delay_us"));
|
||||
if (j.contains("detector_trigger_delay"))
|
||||
experiment.DetectorDelay(GET_TIME(j, "detector_trigger_delay"));
|
||||
|
||||
experiment.FrameTime(GET_TIME(j, "frame_time"), GET_TIME(j, "count_time"));
|
||||
|
||||
experiment.FrameTime(GET_TIME(j, "frame_time_us"), GET_TIME(j, "count_time_us"));
|
||||
if (j.contains("preview_period_us"))
|
||||
experiment.PreviewPeriod(GET_TIME(j, "preview_period_us"));
|
||||
experiment.UseInternalPacketGenerator(GET_BOOL(j, "internal_frame_generator", false));
|
||||
if (experiment.IsUsingInternalPacketGen())
|
||||
experiment.ConversionOnFPGA(false);
|
||||
|
||||
@@ -14,6 +14,7 @@ DetectorGeometry ParseDetectorGeometry(const nlohmann::json &j);
|
||||
DetectorSetup ParseDetectorSetup(const nlohmann::json &j);
|
||||
void ParseDetectorSetup(const nlohmann::json &j, const std::string& tag, JFJochBrokerHttp& broker);
|
||||
void ParseFacilityConfiguration(const nlohmann::json &j, const std::string& tag, DiffractionExperiment &experiment);
|
||||
void ParseImagePusher(const nlohmann::json &j, std::unique_ptr<ImagePusher> &image_pusher);
|
||||
|
||||
void ParseAcquisitionDeviceGroup(const nlohmann::json &input, const std::string& tag, AcquisitionDeviceGroup &aq_devices);
|
||||
std::vector<std::string> ParseStringArray(const nlohmann::json &input, const std::string& tag);
|
||||
|
||||
@@ -5,15 +5,17 @@
|
||||
|
||||
JFJochServices::JFJochServices(Logger &in_logger) : logger(in_logger) {}
|
||||
|
||||
void JFJochServices::Start(const DiffractionExperiment& experiment, const JFCalibration &calibration) {
|
||||
void JFJochServices::Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration) {
|
||||
logger.Info("Measurement start for: {}", experiment.GetFilePrefix());
|
||||
|
||||
if (receiver != nullptr) {
|
||||
logger.Info(" ... receiver start");
|
||||
if (experiment.GetDetectorMode() == DetectorMode::Conversion)
|
||||
receiver->Start(experiment, &calibration);
|
||||
receiver->Start(experiment, pixel_mask, &calibration);
|
||||
else
|
||||
receiver->Start(experiment, nullptr);
|
||||
receiver->Start(experiment, pixel_mask, nullptr);
|
||||
|
||||
if (detector && !experiment.IsUsingInternalPacketGen()) {
|
||||
logger.Info(" ... detector start");
|
||||
|
||||
@@ -23,7 +23,9 @@ public:
|
||||
void On(const DiffractionExperiment& experiment);
|
||||
void Off();
|
||||
void ConfigureDetector(const DiffractionExperiment& experiment);
|
||||
void Start(const DiffractionExperiment& experiment, const JFCalibration &calibration);
|
||||
void Start(const DiffractionExperiment& experiment,
|
||||
const PixelMask &pixel_mask,
|
||||
const JFCalibration &calibration);
|
||||
JFJochServicesOutput Stop();
|
||||
void Cancel();
|
||||
void Trigger();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include "JFJochStateMachine.h"
|
||||
#include "../preview/WriteTIFF.h"
|
||||
#include "../preview/JFJochTIFF.h"
|
||||
|
||||
void ApplyDetectorSettings(DiffractionExperiment& experiment, const DetectorSettings &settings) {
|
||||
auto tmp = experiment;
|
||||
@@ -66,8 +66,10 @@ void ApplyRadialIntegrationSettings(DiffractionExperiment& experiment, const Rad
|
||||
}
|
||||
|
||||
JFJochStateMachine::JFJochStateMachine(JFJochServices &in_services, Logger &in_logger)
|
||||
: services(in_services), logger(in_logger),
|
||||
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()) {
|
||||
: services(in_services),
|
||||
logger(in_logger),
|
||||
data_processing_settings(DiffractionExperiment::DefaultDataProcessingSettings()),
|
||||
pixel_mask(experiment) {
|
||||
|
||||
}
|
||||
|
||||
@@ -126,6 +128,7 @@ void JFJochStateMachine::TakePedestalInternalAll(std::unique_lock<std::mutex> &u
|
||||
}
|
||||
}
|
||||
services.ConfigureDetector(experiment);
|
||||
pixel_mask.LoadDetectorBadPixelMask(calibration->CalculateMask());
|
||||
} catch (const std::exception &e) {
|
||||
logger.Error("Pedestal sequence error {}", e.what());
|
||||
state = JFJochState::Error;
|
||||
@@ -158,7 +161,7 @@ void JFJochStateMachine::TakePedestalInternalG0(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -197,7 +200,7 @@ void JFJochStateMachine::TakePedestalInternalG1(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -236,7 +239,7 @@ void JFJochStateMachine::TakePedestalInternalG2(std::unique_lock<std::mutex> &ul
|
||||
|
||||
state = JFJochState::Pedestal;
|
||||
services.ConfigureDetector(local_experiment);
|
||||
services.Start(local_experiment, *calibration);
|
||||
services.Start(local_experiment, pixel_mask, *calibration);
|
||||
|
||||
services.Trigger();
|
||||
|
||||
@@ -321,12 +324,12 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) {
|
||||
else
|
||||
experiment.StorageCellStart(0);
|
||||
|
||||
experiment.IncrementSeriesID();
|
||||
experiment.IncrementRunNumber();
|
||||
|
||||
try {
|
||||
state = JFJochState::Busy;
|
||||
services.SetSpotFindingSettings(GetSpotFindingSettings());
|
||||
services.Start(experiment, *calibration);
|
||||
services.Start(experiment, pixel_mask, *calibration);
|
||||
|
||||
state = JFJochState::Measuring;
|
||||
measurement = std::async(std::launch::async, &JFJochStateMachine::MeasurementThread, this);
|
||||
@@ -337,12 +340,6 @@ void JFJochStateMachine::Start(const DatasetSettings& settings) {
|
||||
}
|
||||
}
|
||||
|
||||
void JFJochStateMachine::WaitTillMeasurementDone() {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
c.wait(ul, [&] { return !IsRunning(); });
|
||||
}
|
||||
|
||||
void JFJochStateMachine::MeasurementThread() {
|
||||
try {
|
||||
auto tmp_output = services.Stop();
|
||||
@@ -398,10 +395,15 @@ void JFJochStateMachine::SetFullMeasurementOutput(const JFJochServicesOutput &ou
|
||||
MeasurementStatistics tmp{}; // reset last measurement statistics
|
||||
|
||||
tmp.file_prefix = experiment.GetFilePrefix();
|
||||
tmp.run_number = experiment.GetRunNumber();
|
||||
tmp.experiment_group = experiment.GetExperimentGroup();
|
||||
|
||||
tmp.detector_width = experiment.GetXPixelsNum();
|
||||
tmp.detector_height = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
|
||||
tmp.compression_ratio = output.receiver_output.status.compressed_ratio;
|
||||
tmp.collection_efficiency = output.receiver_output.efficiency;
|
||||
@@ -422,10 +424,15 @@ void JFJochStateMachine::ClearAndSetMeasurementStatistics() {
|
||||
MeasurementStatistics tmp{};
|
||||
|
||||
tmp.file_prefix = experiment.GetFilePrefix();
|
||||
tmp.run_number = experiment.GetRunNumber();
|
||||
tmp.experiment_group = experiment.GetExperimentGroup();
|
||||
|
||||
tmp.detector_height = experiment.GetXPixelsNum();
|
||||
tmp.detector_width = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
measurement_statistics = tmp;
|
||||
}
|
||||
|
||||
@@ -441,10 +448,14 @@ std::optional<MeasurementStatistics> JFJochStateMachine::GetMeasurementStatistic
|
||||
MeasurementStatistics tmp;
|
||||
|
||||
tmp.file_prefix = experiment.GetFilePrefix();
|
||||
tmp.run_number = experiment.GetRunNumber();
|
||||
tmp.experiment_group = experiment.GetExperimentGroup();
|
||||
|
||||
tmp.detector_width = experiment.GetXPixelsNum();
|
||||
tmp.detector_height = experiment.GetYPixelsNum();
|
||||
tmp.detector_pixel_depth = experiment.GetPixelDepth();
|
||||
tmp.images_expected = experiment.GetImageNum();
|
||||
tmp.unit_cell = experiment.GetUnitCellString();
|
||||
|
||||
tmp.compression_ratio = rcv_status->compressed_ratio;
|
||||
tmp.images_collected = rcv_status->images_collected;
|
||||
@@ -557,6 +568,7 @@ void JFJochStateMachine::AddDetectorSetup(const DetectorSetup &setup) {
|
||||
experiment.Detector(setup);
|
||||
gain_calibration = setup.GetGainCalibration();
|
||||
current_detector_setup = 0;
|
||||
pixel_mask = PixelMask(setup);
|
||||
}
|
||||
detector_setup.emplace_back(setup);
|
||||
}
|
||||
@@ -594,6 +606,7 @@ void JFJochStateMachine::SelectDetector(int64_t id) {
|
||||
try {
|
||||
experiment.Detector(detector_setup[id]);
|
||||
gain_calibration = detector_setup[id].GetGainCalibration();
|
||||
pixel_mask = PixelMask(detector_setup[id]);
|
||||
state = JFJochState::Inactive;
|
||||
current_detector_setup = id;
|
||||
} catch (JFJochException &e) {
|
||||
@@ -640,6 +653,14 @@ bool JFJochStateMachine::IsRunning() const {
|
||||
}
|
||||
}
|
||||
|
||||
JFJochState JFJochStateMachine::WaitTillMeasurementDone() {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
c.wait(ul, [&] { return !IsRunning(); });
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
JFJochState JFJochStateMachine::WaitTillMeasurementDone(std::chrono::milliseconds timeout) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
@@ -700,6 +721,21 @@ void JFJochStateMachine::LoadInternalGeneratorImage(const void *data, size_t siz
|
||||
services.LoadInternalGeneratorImage(experiment, image, image_number);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::LoadInternalGeneratorImageTIFF(const std::string &s, uint64_t image_number) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException ("Can change internal generator image only when detector in Idle state");
|
||||
|
||||
uint32_t cols, lines;
|
||||
auto v = ReadTIFFFromString16(s, cols, lines);
|
||||
if (((cols == experiment.GetXPixelsNum()) && (lines == experiment.GetYPixelsNum()))
|
||||
|| ((cols == RAW_MODULE_SIZE) && (lines == RAW_MODULE_LINES * experiment.GetModulesNum())))
|
||||
services.LoadInternalGeneratorImage(experiment, v, image_number);
|
||||
else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Image size doesn't match current detector");
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetBoxROI(const std::vector<ROIBox> &input) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
@@ -739,3 +775,33 @@ std::vector<uint64_t> JFJochStateMachine::GetXFELEventCode() const {
|
||||
services.GetXFELEventCode(ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string JFJochStateMachine::GetFullPixelMaskTIFF() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
std::vector v = pixel_mask.GetMask(experiment);
|
||||
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
|
||||
sizeof(uint32_t), false);
|
||||
}
|
||||
|
||||
std::string JFJochStateMachine::GetUserPixelMaskTIFF() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
std::vector v = pixel_mask.GetUserMask(experiment);
|
||||
return WriteTIFFToString(v.data(), experiment.GetXPixelsNum(), experiment.GetYPixelsNum(),
|
||||
sizeof(uint32_t), false);
|
||||
}
|
||||
|
||||
void JFJochStateMachine::SetUserPixelMask(const std::string &s) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
|
||||
if (state != JFJochState::Idle)
|
||||
throw WrongDAQStateException ("User mask can be only modified in Idle state");
|
||||
|
||||
try {
|
||||
uint32_t cols, lines;
|
||||
auto v = ReadTIFFFromString32(s, cols, lines);
|
||||
pixel_mask.LoadUserMask(experiment, v);
|
||||
} catch (const JFJochException &e) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Problem handling user mask " + std::string(e.what()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ struct DetectorList {
|
||||
|
||||
struct MeasurementStatistics {
|
||||
std::string file_prefix;
|
||||
std::string experiment_group;
|
||||
int64_t run_number;
|
||||
|
||||
int64_t images_expected;
|
||||
int64_t images_collected;
|
||||
int64_t images_sent;
|
||||
@@ -56,6 +59,8 @@ struct MeasurementStatistics {
|
||||
|
||||
std::optional<float> bkg_estimate;
|
||||
std::optional<std::pair<float, float>> beam_center_drift_pxl;
|
||||
|
||||
std::string unit_cell;
|
||||
};
|
||||
|
||||
struct DetectorSettings {
|
||||
@@ -96,6 +101,8 @@ class JFJochStateMachine {
|
||||
volatile JFJochState state = JFJochState::Inactive;
|
||||
volatile bool cancel_sequence = false;
|
||||
std::unique_ptr<JFCalibration> calibration;
|
||||
PixelMask pixel_mask;
|
||||
|
||||
std::vector<JFModuleGainCalibration> gain_calibration;
|
||||
std::vector<DetectorSetup> detector_setup;
|
||||
int64_t current_detector_setup;
|
||||
@@ -134,7 +141,7 @@ public:
|
||||
void Pedestal();
|
||||
void Deactivate();
|
||||
void Start(const DatasetSettings& settings);
|
||||
void WaitTillMeasurementDone();
|
||||
JFJochState WaitTillMeasurementDone();
|
||||
JFJochState WaitTillMeasurementDone(std::chrono::milliseconds timeout);
|
||||
void Trigger();
|
||||
|
||||
@@ -170,6 +177,7 @@ public:
|
||||
std::string GetPedestalTIFF(size_t gain_level, size_t sc) const;
|
||||
|
||||
void LoadInternalGeneratorImage(const void *data, size_t size, uint64_t image_number);
|
||||
void LoadInternalGeneratorImageTIFF(const std::string &s, uint64_t image_number);
|
||||
|
||||
// Not thread safe - only for configuration in serial context
|
||||
DiffractionExperiment& NotThreadSafe_Experiment();
|
||||
@@ -185,6 +193,10 @@ public:
|
||||
|
||||
std::vector<uint64_t> GetXFELPulseID() const;
|
||||
std::vector<uint64_t> GetXFELEventCode() const;
|
||||
|
||||
std::string GetFullPixelMaskTIFF() const;
|
||||
std::string GetUserPixelMaskTIFF() const;
|
||||
void SetUserPixelMask(const std::string &v);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -15,11 +15,16 @@ Till this happens, it is recommended to go through example files in the [etc/](.
|
||||
## Setting up a local test for Jungfraujoch
|
||||
For development, it is possible to setup a local installation of Jungfraujoch.
|
||||
This will work without FPGA installed in the computer and allows to test Jungfraujoch software layer, including
|
||||
ZeroMQ streaming and file writing. There are few necessary steps:
|
||||
ZeroMQ streaming and file writing.
|
||||
|
||||
The workflow simulates FPGA behavior, by running high-level synthesis code on the CPU - the performance is therefore
|
||||
very low, as fixed-point calculations have large performance penalty on CPU. In the CPU simulation mode, one can simulate
|
||||
using only a single FPGA device.
|
||||
|
||||
To run the test:
|
||||
|
||||
### Compile Jungfraujoch with frontend
|
||||
```
|
||||
git submodule update --init --recursive
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
@@ -38,6 +43,7 @@ Start writer:
|
||||
cd build/writer
|
||||
./jfjoch_writer tcp://127.0.0.1:5500
|
||||
```
|
||||
|
||||
### Run tests
|
||||
To run test a Python script is provided:
|
||||
```
|
||||
@@ -45,3 +51,7 @@ cd tests/test_data
|
||||
python jfjoch_broker_test.py
|
||||
```
|
||||
The script will initialize Jungfraujoch, import test image and start data collection.
|
||||
|
||||
### Expected result
|
||||
You can observe online data analysis by opening the following web page: [http://localhost:5232](http://localhost:5232).
|
||||
Also in the `build/writer` subdirectory a dataset with images should be written.
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -37,12 +37,16 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Get(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/detector", Routes::bind(&DefaultApi::config_detector_put_handler, this));
|
||||
Routes::Put(*router, base + "/config/internal_generator_image", Routes::bind(&DefaultApi::config_internal_generator_image_put_handler, this));
|
||||
Routes::Put(*router, base + "/config/internal_generator_image.tiff", Routes::bind(&DefaultApi::config_internal_generator_image_tiff_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/mask.tiff", Routes::bind(&DefaultApi::config_mask_tiff_get_handler, this));
|
||||
Routes::Get(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/rad_int", Routes::bind(&DefaultApi::config_rad_int_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/select_detector", Routes::bind(&DefaultApi::config_select_detector_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/spot_finding", Routes::bind(&DefaultApi::config_spot_finding_put_handler, this));
|
||||
Routes::Get(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_get_handler, this));
|
||||
Routes::Put(*router, base + "/config/user_mask.tiff", Routes::bind(&DefaultApi::config_user_mask_tiff_put_handler, this));
|
||||
Routes::Post(*router, base + "/deactivate", Routes::bind(&DefaultApi::deactivate_post_handler, this));
|
||||
Routes::Get(*router, base + "/detector/status", Routes::bind(&DefaultApi::detector_status_get_handler, this));
|
||||
Routes::Post(*router, base + "/initialize", Routes::bind(&DefaultApi::initialize_post_handler, this));
|
||||
@@ -56,7 +60,6 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Get(*router, base + "/plot/rad_int_per_file", Routes::bind(&DefaultApi::plot_rad_int_per_file_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/receiver_delay", Routes::bind(&DefaultApi::plot_receiver_delay_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/receiver_free_send_buffers", Routes::bind(&DefaultApi::plot_receiver_free_send_buffers_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/resolution_estimate_histogram", Routes::bind(&DefaultApi::plot_resolution_estimate_histogram_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/roi_max_count", Routes::bind(&DefaultApi::plot_roi_max_count_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/roi_sum", Routes::bind(&DefaultApi::plot_roi_sum_get_handler, this));
|
||||
Routes::Get(*router, base + "/plot/roi_valid_pixels", Routes::bind(&DefaultApi::plot_roi_valid_pixels_get_handler, this));
|
||||
@@ -76,6 +79,7 @@ void DefaultApi::setupRoutes() {
|
||||
Routes::Get(*router, base + "/statistics/data_collection", Routes::bind(&DefaultApi::statistics_data_collection_get_handler, this));
|
||||
Routes::Get(*router, base + "/status", Routes::bind(&DefaultApi::status_get_handler, this));
|
||||
Routes::Post(*router, base + "/trigger", Routes::bind(&DefaultApi::trigger_post_handler, this));
|
||||
Routes::Get(*router, base + "/version", Routes::bind(&DefaultApi::version_get_handler, this));
|
||||
Routes::Post(*router, base + "/wait_till_done", Routes::bind(&DefaultApi::wait_till_done_post_handler, this));
|
||||
Routes::Get(*router, base + "/xfel/event_code", Routes::bind(&DefaultApi::xfel_event_code_get_handler, this));
|
||||
Routes::Get(*router, base + "/xfel/pulse_id", Routes::bind(&DefaultApi::xfel_pulse_id_get_handler, this));
|
||||
@@ -193,6 +197,45 @@ void DefaultApi::config_internal_generator_image_put_handler(const Pistache::Res
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
try {
|
||||
this->config_internal_generator_image_tiff_put(request, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_mask_tiff_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_rad_int_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
@@ -352,6 +395,45 @@ void DefaultApi::config_spot_finding_put_handler(const Pistache::Rest::Request &
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_user_mask_tiff_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->config_user_mask_tiff_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
try {
|
||||
this->config_user_mask_tiff_put(request, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::deactivate_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
@@ -672,26 +754,6 @@ void DefaultApi::plot_receiver_free_send_buffers_get_handler(const Pistache::Res
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_resolution_estimate_histogram_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->plot_resolution_estimate_histogram_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
@@ -1193,12 +1255,42 @@ void DefaultApi::trigger_post_handler(const Pistache::Rest::Request &, Pistache:
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::wait_till_done_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
void DefaultApi::version_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->wait_till_done_post(response);
|
||||
this->version_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
const std::pair<Pistache::Http::Code, std::string> errorInfo = this->handleOperationException(e);
|
||||
response.send(errorInfo.first, errorInfo.second);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::wait_till_done_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
// Getting the query params
|
||||
auto timeoutQuery = request.query().get("timeout");
|
||||
std::optional<int32_t> timeout;
|
||||
if(timeoutQuery.has_value()){
|
||||
int32_t valueQuery_instance;
|
||||
if(fromStringValue(timeoutQuery.value(), valueQuery_instance)){
|
||||
timeout = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this->wait_till_done_post(timeout, response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -61,12 +61,16 @@ private:
|
||||
void config_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_internal_generator_image_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_rad_int_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_select_detector_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_spot_finding_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void config_user_mask_tiff_put_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void deactivate_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void detector_status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void initialize_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -80,7 +84,6 @@ private:
|
||||
void plot_rad_int_per_file_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_receiver_delay_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_receiver_free_send_buffers_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_resolution_estimate_histogram_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_roi_max_count_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_roi_sum_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void plot_roi_valid_pixels_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -100,6 +103,7 @@ private:
|
||||
void statistics_data_collection_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void trigger_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void version_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void wait_till_done_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void xfel_event_code_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void xfel_pulse_id_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
@@ -151,6 +155,20 @@ private:
|
||||
/// </remarks>
|
||||
virtual void config_internal_generator_image_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Load TIFF image for internal FPGA generator
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Load image for internal FPGA generator. This can only happen in Idle state of the detector. Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates (depending on detector settings).
|
||||
/// </remarks>
|
||||
virtual void config_internal_generator_image_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get full pixel mask of the detector See NXmx standard for meaning of pixel values
|
||||
/// </remarks>
|
||||
virtual void config_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get radial integration configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -196,6 +214,20 @@ private:
|
||||
/// <param name="spotFindingSettings"> (optional)</param>
|
||||
virtual void config_spot_finding_put(const org::openapitools::server::model::Spot_finding_settings &spotFindingSettings, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get user mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Upload user mask of the detector
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should be in `Idle` state. Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions. If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates. In the latter case - module gaps are ignored and don't need to be assigned value. Mask is expected as TIFF (4-byte; unsigned). 0 - good pixel, other value - masked User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration. User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.
|
||||
/// </remarks>
|
||||
virtual void config_user_mask_tiff_put(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Prepare detector to turn off
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -293,13 +325,6 @@ private:
|
||||
/// <param name="binning">Binning of frames for the plot (0 = default binning) (optional, default to 0)</param>
|
||||
virtual void plot_receiver_free_send_buffers_get(const std::optional<int32_t> &binning, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate resolution estimate histogram
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Generate histogram of crystal resolutions from 1.0 to 5.0 A based on ML model
|
||||
/// </remarks>
|
||||
virtual void plot_resolution_estimate_histogram_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Generate plot of ROI max count
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
@@ -444,12 +469,20 @@ private:
|
||||
/// </remarks>
|
||||
virtual void trigger_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void version_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Wait for acquisition done
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a long period of time, the procedure is provided with a timeout of 5 seconds.
|
||||
/// Block execution of external script till initialization, data collection or pedestal is finished. Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software. To not block web server for a indefinite period of time, the procedure is provided with a timeout. Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.
|
||||
/// </remarks>
|
||||
virtual void wait_till_done_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <param name="timeout">Timeout in seconds (0 == immediate response) (optional, default to 60)</param>
|
||||
virtual void wait_till_done_post(const std::optional<int32_t> &timeout, Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Return XFEL event codes for the current data acquisition
|
||||
/// </summary>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -25,12 +25,12 @@ Dataset_settings::Dataset_settings()
|
||||
m_Images_per_triggerIsSet = false;
|
||||
m_Ntrigger = 1L;
|
||||
m_NtriggerIsSet = false;
|
||||
m_Summation = 1L;
|
||||
m_SummationIsSet = false;
|
||||
m_Image_time_us = 0L;
|
||||
m_Image_time_usIsSet = false;
|
||||
m_Beam_x_pxl = 0.0f;
|
||||
m_Beam_y_pxl = 0.0f;
|
||||
m_Detector_distance_mm = 0.0f;
|
||||
m_Photon_energy_keV = 0.0f;
|
||||
m_Incident_energy_keV = 0.0f;
|
||||
m_File_prefix = "";
|
||||
m_File_prefixIsSet = false;
|
||||
m_Images_per_file = 1000L;
|
||||
@@ -38,6 +38,7 @@ Dataset_settings::Dataset_settings()
|
||||
m_Space_group_number = 0L;
|
||||
m_Space_group_numberIsSet = false;
|
||||
m_Sample_name = "";
|
||||
m_Sample_nameIsSet = false;
|
||||
m_Fpga_output = "auto";
|
||||
m_Fpga_outputIsSet = false;
|
||||
m_Compression = "bslz4";
|
||||
@@ -46,15 +47,19 @@ Dataset_settings::Dataset_settings()
|
||||
m_Total_fluxIsSet = false;
|
||||
m_Transmission = 0.0f;
|
||||
m_TransmissionIsSet = false;
|
||||
m_OmegaIsSet = false;
|
||||
m_Header_appendix = "";
|
||||
m_GoniometerIsSet = false;
|
||||
m_Header_appendixIsSet = false;
|
||||
m_Image_appendix = "";
|
||||
m_Image_appendixIsSet = false;
|
||||
m_Photon_energy_multiplier = 1.0f;
|
||||
m_Photon_energy_multiplierIsSet = false;
|
||||
m_Energy_multiplier = 1.0f;
|
||||
m_Energy_multiplierIsSet = false;
|
||||
m_Data_reduction_factor_serialmx = 1.0f;
|
||||
m_Data_reduction_factor_serialmxIsSet = false;
|
||||
m_Run_number = 0L;
|
||||
m_Run_numberIsSet = false;
|
||||
m_Run_name = "";
|
||||
m_Run_nameIsSet = false;
|
||||
m_Experiment_group = "";
|
||||
m_Experiment_groupIsSet = false;
|
||||
m_Unit_cellIsSet = false;
|
||||
|
||||
}
|
||||
@@ -107,21 +112,16 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
|
||||
}
|
||||
|
||||
if (summationIsSet())
|
||||
if (imageTimeUsIsSet())
|
||||
{
|
||||
const int64_t& value = m_Summation;
|
||||
const std::string currentValuePath = _pathPrefix + ".summation";
|
||||
const int64_t& value = m_Image_time_us;
|
||||
const std::string currentValuePath = _pathPrefix + ".imageTimeUs";
|
||||
|
||||
|
||||
if (value < 1ll)
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 1;";
|
||||
}
|
||||
if (value > 256ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 256;";
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -141,9 +141,9 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
|
||||
/* Photon_energy_keV */ {
|
||||
const float& value = m_Photon_energy_keV;
|
||||
const std::string currentValuePath = _pathPrefix + ".photonEnergyKeV";
|
||||
/* Incident_energy_keV */ {
|
||||
const float& value = m_Incident_energy_keV;
|
||||
const std::string currentValuePath = _pathPrefix + ".incidentEnergyKeV";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0))
|
||||
@@ -206,10 +206,10 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
|
||||
}
|
||||
|
||||
if (photonEnergyMultiplierIsSet())
|
||||
if (energyMultiplierIsSet())
|
||||
{
|
||||
const float& value = m_Photon_energy_multiplier;
|
||||
const std::string currentValuePath = _pathPrefix + ".photonEnergyMultiplier";
|
||||
const float& value = m_Energy_multiplier;
|
||||
const std::string currentValuePath = _pathPrefix + ".energyMultiplier";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.015625))
|
||||
@@ -243,7 +243,21 @@ bool Dataset_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (runNumberIsSet())
|
||||
{
|
||||
const int64_t& value = m_Run_number;
|
||||
const std::string currentValuePath = _pathPrefix + ".runNumber";
|
||||
|
||||
|
||||
if (value < 0ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -259,7 +273,7 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!ntriggerIsSet() && !rhs.ntriggerIsSet()) || (ntriggerIsSet() && rhs.ntriggerIsSet() && getNtrigger() == rhs.getNtrigger())) &&
|
||||
|
||||
|
||||
((!summationIsSet() && !rhs.summationIsSet()) || (summationIsSet() && rhs.summationIsSet() && getSummation() == rhs.getSummation())) &&
|
||||
((!imageTimeUsIsSet() && !rhs.imageTimeUsIsSet()) || (imageTimeUsIsSet() && rhs.imageTimeUsIsSet() && getImageTimeUs() == rhs.getImageTimeUs())) &&
|
||||
|
||||
(getBeamXPxl() == rhs.getBeamXPxl())
|
||||
&&
|
||||
@@ -270,7 +284,7 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
(getDetectorDistanceMm() == rhs.getDetectorDistanceMm())
|
||||
&&
|
||||
|
||||
(getPhotonEnergyKeV() == rhs.getPhotonEnergyKeV())
|
||||
(getIncidentEnergyKeV() == rhs.getIncidentEnergyKeV())
|
||||
&&
|
||||
|
||||
|
||||
@@ -282,8 +296,8 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
|
||||
((!spaceGroupNumberIsSet() && !rhs.spaceGroupNumberIsSet()) || (spaceGroupNumberIsSet() && rhs.spaceGroupNumberIsSet() && getSpaceGroupNumber() == rhs.getSpaceGroupNumber())) &&
|
||||
|
||||
(getSampleName() == rhs.getSampleName())
|
||||
&&
|
||||
|
||||
((!sampleNameIsSet() && !rhs.sampleNameIsSet()) || (sampleNameIsSet() && rhs.sampleNameIsSet() && getSampleName() == rhs.getSampleName())) &&
|
||||
|
||||
|
||||
((!fpgaOutputIsSet() && !rhs.fpgaOutputIsSet()) || (fpgaOutputIsSet() && rhs.fpgaOutputIsSet() && getFpgaOutput() == rhs.getFpgaOutput())) &&
|
||||
@@ -298,7 +312,7 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!transmissionIsSet() && !rhs.transmissionIsSet()) || (transmissionIsSet() && rhs.transmissionIsSet() && getTransmission() == rhs.getTransmission())) &&
|
||||
|
||||
|
||||
((!omegaIsSet() && !rhs.omegaIsSet()) || (omegaIsSet() && rhs.omegaIsSet() && getOmega() == rhs.getOmega())) &&
|
||||
((!goniometerIsSet() && !rhs.goniometerIsSet()) || (goniometerIsSet() && rhs.goniometerIsSet() && getGoniometer() == rhs.getGoniometer())) &&
|
||||
|
||||
|
||||
((!headerAppendixIsSet() && !rhs.headerAppendixIsSet()) || (headerAppendixIsSet() && rhs.headerAppendixIsSet() && getHeaderAppendix() == rhs.getHeaderAppendix())) &&
|
||||
@@ -307,12 +321,21 @@ bool Dataset_settings::operator==(const Dataset_settings& rhs) const
|
||||
((!imageAppendixIsSet() && !rhs.imageAppendixIsSet()) || (imageAppendixIsSet() && rhs.imageAppendixIsSet() && getImageAppendix() == rhs.getImageAppendix())) &&
|
||||
|
||||
|
||||
((!photonEnergyMultiplierIsSet() && !rhs.photonEnergyMultiplierIsSet()) || (photonEnergyMultiplierIsSet() && rhs.photonEnergyMultiplierIsSet() && getPhotonEnergyMultiplier() == rhs.getPhotonEnergyMultiplier())) &&
|
||||
((!energyMultiplierIsSet() && !rhs.energyMultiplierIsSet()) || (energyMultiplierIsSet() && rhs.energyMultiplierIsSet() && getEnergyMultiplier() == rhs.getEnergyMultiplier())) &&
|
||||
|
||||
|
||||
((!dataReductionFactorSerialmxIsSet() && !rhs.dataReductionFactorSerialmxIsSet()) || (dataReductionFactorSerialmxIsSet() && rhs.dataReductionFactorSerialmxIsSet() && getDataReductionFactorSerialmx() == rhs.getDataReductionFactorSerialmx())) &&
|
||||
|
||||
|
||||
((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) &&
|
||||
|
||||
|
||||
((!runNameIsSet() && !rhs.runNameIsSet()) || (runNameIsSet() && rhs.runNameIsSet() && getRunName() == rhs.getRunName())) &&
|
||||
|
||||
|
||||
((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) &&
|
||||
|
||||
|
||||
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
|
||||
|
||||
;
|
||||
@@ -330,19 +353,20 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["images_per_trigger"] = o.m_Images_per_trigger;
|
||||
if(o.ntriggerIsSet())
|
||||
j["ntrigger"] = o.m_Ntrigger;
|
||||
if(o.summationIsSet())
|
||||
j["summation"] = o.m_Summation;
|
||||
if(o.imageTimeUsIsSet())
|
||||
j["image_time_us"] = o.m_Image_time_us;
|
||||
j["beam_x_pxl"] = o.m_Beam_x_pxl;
|
||||
j["beam_y_pxl"] = o.m_Beam_y_pxl;
|
||||
j["detector_distance_mm"] = o.m_Detector_distance_mm;
|
||||
j["photon_energy_keV"] = o.m_Photon_energy_keV;
|
||||
j["incident_energy_keV"] = o.m_Incident_energy_keV;
|
||||
if(o.filePrefixIsSet())
|
||||
j["file_prefix"] = o.m_File_prefix;
|
||||
if(o.imagesPerFileIsSet())
|
||||
j["images_per_file"] = o.m_Images_per_file;
|
||||
if(o.spaceGroupNumberIsSet())
|
||||
j["space_group_number"] = o.m_Space_group_number;
|
||||
j["sample_name"] = o.m_Sample_name;
|
||||
if(o.sampleNameIsSet())
|
||||
j["sample_name"] = o.m_Sample_name;
|
||||
if(o.fpgaOutputIsSet())
|
||||
j["fpga_output"] = o.m_Fpga_output;
|
||||
if(o.compressionIsSet())
|
||||
@@ -351,16 +375,22 @@ void to_json(nlohmann::json& j, const Dataset_settings& o)
|
||||
j["total_flux"] = o.m_Total_flux;
|
||||
if(o.transmissionIsSet())
|
||||
j["transmission"] = o.m_Transmission;
|
||||
if(o.omegaIsSet())
|
||||
j["omega"] = o.m_Omega;
|
||||
if(o.goniometerIsSet())
|
||||
j["goniometer"] = o.m_Goniometer;
|
||||
if(o.headerAppendixIsSet())
|
||||
j["header_appendix"] = o.m_Header_appendix;
|
||||
if(o.imageAppendixIsSet())
|
||||
j["image_appendix"] = o.m_Image_appendix;
|
||||
if(o.photonEnergyMultiplierIsSet())
|
||||
j["photon_energy_multiplier"] = o.m_Photon_energy_multiplier;
|
||||
if(o.energyMultiplierIsSet())
|
||||
j["energy_multiplier"] = o.m_Energy_multiplier;
|
||||
if(o.dataReductionFactorSerialmxIsSet())
|
||||
j["data_reduction_factor_serialmx"] = o.m_Data_reduction_factor_serialmx;
|
||||
if(o.runNumberIsSet())
|
||||
j["run_number"] = o.m_Run_number;
|
||||
if(o.runNameIsSet())
|
||||
j["run_name"] = o.m_Run_name;
|
||||
if(o.experimentGroupIsSet())
|
||||
j["experiment_group"] = o.m_Experiment_group;
|
||||
if(o.unitCellIsSet())
|
||||
j["unit_cell"] = o.m_Unit_cell;
|
||||
|
||||
@@ -378,15 +408,15 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("ntrigger").get_to(o.m_Ntrigger);
|
||||
o.m_NtriggerIsSet = true;
|
||||
}
|
||||
if(j.find("summation") != j.end())
|
||||
if(j.find("image_time_us") != j.end())
|
||||
{
|
||||
j.at("summation").get_to(o.m_Summation);
|
||||
o.m_SummationIsSet = true;
|
||||
j.at("image_time_us").get_to(o.m_Image_time_us);
|
||||
o.m_Image_time_usIsSet = true;
|
||||
}
|
||||
j.at("beam_x_pxl").get_to(o.m_Beam_x_pxl);
|
||||
j.at("beam_y_pxl").get_to(o.m_Beam_y_pxl);
|
||||
j.at("detector_distance_mm").get_to(o.m_Detector_distance_mm);
|
||||
j.at("photon_energy_keV").get_to(o.m_Photon_energy_keV);
|
||||
j.at("incident_energy_keV").get_to(o.m_Incident_energy_keV);
|
||||
if(j.find("file_prefix") != j.end())
|
||||
{
|
||||
j.at("file_prefix").get_to(o.m_File_prefix);
|
||||
@@ -402,7 +432,11 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("space_group_number").get_to(o.m_Space_group_number);
|
||||
o.m_Space_group_numberIsSet = true;
|
||||
}
|
||||
j.at("sample_name").get_to(o.m_Sample_name);
|
||||
if(j.find("sample_name") != j.end())
|
||||
{
|
||||
j.at("sample_name").get_to(o.m_Sample_name);
|
||||
o.m_Sample_nameIsSet = true;
|
||||
}
|
||||
if(j.find("fpga_output") != j.end())
|
||||
{
|
||||
j.at("fpga_output").get_to(o.m_Fpga_output);
|
||||
@@ -423,10 +457,10 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("transmission").get_to(o.m_Transmission);
|
||||
o.m_TransmissionIsSet = true;
|
||||
}
|
||||
if(j.find("omega") != j.end())
|
||||
if(j.find("goniometer") != j.end())
|
||||
{
|
||||
j.at("omega").get_to(o.m_Omega);
|
||||
o.m_OmegaIsSet = true;
|
||||
j.at("goniometer").get_to(o.m_Goniometer);
|
||||
o.m_GoniometerIsSet = true;
|
||||
}
|
||||
if(j.find("header_appendix") != j.end())
|
||||
{
|
||||
@@ -438,16 +472,31 @@ void from_json(const nlohmann::json& j, Dataset_settings& o)
|
||||
j.at("image_appendix").get_to(o.m_Image_appendix);
|
||||
o.m_Image_appendixIsSet = true;
|
||||
}
|
||||
if(j.find("photon_energy_multiplier") != j.end())
|
||||
if(j.find("energy_multiplier") != j.end())
|
||||
{
|
||||
j.at("photon_energy_multiplier").get_to(o.m_Photon_energy_multiplier);
|
||||
o.m_Photon_energy_multiplierIsSet = true;
|
||||
j.at("energy_multiplier").get_to(o.m_Energy_multiplier);
|
||||
o.m_Energy_multiplierIsSet = true;
|
||||
}
|
||||
if(j.find("data_reduction_factor_serialmx") != j.end())
|
||||
{
|
||||
j.at("data_reduction_factor_serialmx").get_to(o.m_Data_reduction_factor_serialmx);
|
||||
o.m_Data_reduction_factor_serialmxIsSet = true;
|
||||
}
|
||||
if(j.find("run_number") != j.end())
|
||||
{
|
||||
j.at("run_number").get_to(o.m_Run_number);
|
||||
o.m_Run_numberIsSet = true;
|
||||
}
|
||||
if(j.find("run_name") != j.end())
|
||||
{
|
||||
j.at("run_name").get_to(o.m_Run_name);
|
||||
o.m_Run_nameIsSet = true;
|
||||
}
|
||||
if(j.find("experiment_group") != j.end())
|
||||
{
|
||||
j.at("experiment_group").get_to(o.m_Experiment_group);
|
||||
o.m_Experiment_groupIsSet = true;
|
||||
}
|
||||
if(j.find("unit_cell") != j.end())
|
||||
{
|
||||
j.at("unit_cell").get_to(o.m_Unit_cell);
|
||||
@@ -490,22 +539,22 @@ void Dataset_settings::unsetNtrigger()
|
||||
{
|
||||
m_NtriggerIsSet = false;
|
||||
}
|
||||
int64_t Dataset_settings::getSummation() const
|
||||
int64_t Dataset_settings::getImageTimeUs() const
|
||||
{
|
||||
return m_Summation;
|
||||
return m_Image_time_us;
|
||||
}
|
||||
void Dataset_settings::setSummation(int64_t const value)
|
||||
void Dataset_settings::setImageTimeUs(int64_t const value)
|
||||
{
|
||||
m_Summation = value;
|
||||
m_SummationIsSet = true;
|
||||
m_Image_time_us = value;
|
||||
m_Image_time_usIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::summationIsSet() const
|
||||
bool Dataset_settings::imageTimeUsIsSet() const
|
||||
{
|
||||
return m_SummationIsSet;
|
||||
return m_Image_time_usIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetSummation()
|
||||
void Dataset_settings::unsetImage_time_us()
|
||||
{
|
||||
m_SummationIsSet = false;
|
||||
m_Image_time_usIsSet = false;
|
||||
}
|
||||
float Dataset_settings::getBeamXPxl() const
|
||||
{
|
||||
@@ -531,13 +580,13 @@ void Dataset_settings::setDetectorDistanceMm(float const value)
|
||||
{
|
||||
m_Detector_distance_mm = value;
|
||||
}
|
||||
float Dataset_settings::getPhotonEnergyKeV() const
|
||||
float Dataset_settings::getIncidentEnergyKeV() const
|
||||
{
|
||||
return m_Photon_energy_keV;
|
||||
return m_Incident_energy_keV;
|
||||
}
|
||||
void Dataset_settings::setPhotonEnergyKeV(float const value)
|
||||
void Dataset_settings::setIncidentEnergyKeV(float const value)
|
||||
{
|
||||
m_Photon_energy_keV = value;
|
||||
m_Incident_energy_keV = value;
|
||||
}
|
||||
std::string Dataset_settings::getFilePrefix() const
|
||||
{
|
||||
@@ -597,6 +646,15 @@ std::string Dataset_settings::getSampleName() const
|
||||
void Dataset_settings::setSampleName(std::string const& value)
|
||||
{
|
||||
m_Sample_name = value;
|
||||
m_Sample_nameIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::sampleNameIsSet() const
|
||||
{
|
||||
return m_Sample_nameIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetSample_name()
|
||||
{
|
||||
m_Sample_nameIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getFpgaOutput() const
|
||||
{
|
||||
@@ -666,28 +724,28 @@ void Dataset_settings::unsetTransmission()
|
||||
{
|
||||
m_TransmissionIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Rotation_axis Dataset_settings::getOmega() const
|
||||
org::openapitools::server::model::Rotation_axis Dataset_settings::getGoniometer() const
|
||||
{
|
||||
return m_Omega;
|
||||
return m_Goniometer;
|
||||
}
|
||||
void Dataset_settings::setOmega(org::openapitools::server::model::Rotation_axis const& value)
|
||||
void Dataset_settings::setGoniometer(org::openapitools::server::model::Rotation_axis const& value)
|
||||
{
|
||||
m_Omega = value;
|
||||
m_OmegaIsSet = true;
|
||||
m_Goniometer = value;
|
||||
m_GoniometerIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::omegaIsSet() const
|
||||
bool Dataset_settings::goniometerIsSet() const
|
||||
{
|
||||
return m_OmegaIsSet;
|
||||
return m_GoniometerIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetOmega()
|
||||
void Dataset_settings::unsetGoniometer()
|
||||
{
|
||||
m_OmegaIsSet = false;
|
||||
m_GoniometerIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getHeaderAppendix() const
|
||||
nlohmann::json Dataset_settings::getHeaderAppendix() const
|
||||
{
|
||||
return m_Header_appendix;
|
||||
}
|
||||
void Dataset_settings::setHeaderAppendix(std::string const& value)
|
||||
void Dataset_settings::setHeaderAppendix(nlohmann::json const& value)
|
||||
{
|
||||
m_Header_appendix = value;
|
||||
m_Header_appendixIsSet = true;
|
||||
@@ -700,11 +758,11 @@ void Dataset_settings::unsetHeader_appendix()
|
||||
{
|
||||
m_Header_appendixIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getImageAppendix() const
|
||||
nlohmann::json Dataset_settings::getImageAppendix() const
|
||||
{
|
||||
return m_Image_appendix;
|
||||
}
|
||||
void Dataset_settings::setImageAppendix(std::string const& value)
|
||||
void Dataset_settings::setImageAppendix(nlohmann::json const& value)
|
||||
{
|
||||
m_Image_appendix = value;
|
||||
m_Image_appendixIsSet = true;
|
||||
@@ -717,22 +775,22 @@ void Dataset_settings::unsetImage_appendix()
|
||||
{
|
||||
m_Image_appendixIsSet = false;
|
||||
}
|
||||
float Dataset_settings::getPhotonEnergyMultiplier() const
|
||||
float Dataset_settings::getEnergyMultiplier() const
|
||||
{
|
||||
return m_Photon_energy_multiplier;
|
||||
return m_Energy_multiplier;
|
||||
}
|
||||
void Dataset_settings::setPhotonEnergyMultiplier(float const value)
|
||||
void Dataset_settings::setEnergyMultiplier(float const value)
|
||||
{
|
||||
m_Photon_energy_multiplier = value;
|
||||
m_Photon_energy_multiplierIsSet = true;
|
||||
m_Energy_multiplier = value;
|
||||
m_Energy_multiplierIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::photonEnergyMultiplierIsSet() const
|
||||
bool Dataset_settings::energyMultiplierIsSet() const
|
||||
{
|
||||
return m_Photon_energy_multiplierIsSet;
|
||||
return m_Energy_multiplierIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetPhoton_energy_multiplier()
|
||||
void Dataset_settings::unsetEnergy_multiplier()
|
||||
{
|
||||
m_Photon_energy_multiplierIsSet = false;
|
||||
m_Energy_multiplierIsSet = false;
|
||||
}
|
||||
float Dataset_settings::getDataReductionFactorSerialmx() const
|
||||
{
|
||||
@@ -751,6 +809,57 @@ void Dataset_settings::unsetData_reduction_factor_serialmx()
|
||||
{
|
||||
m_Data_reduction_factor_serialmxIsSet = false;
|
||||
}
|
||||
int64_t Dataset_settings::getRunNumber() const
|
||||
{
|
||||
return m_Run_number;
|
||||
}
|
||||
void Dataset_settings::setRunNumber(int64_t const value)
|
||||
{
|
||||
m_Run_number = value;
|
||||
m_Run_numberIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::runNumberIsSet() const
|
||||
{
|
||||
return m_Run_numberIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetRun_number()
|
||||
{
|
||||
m_Run_numberIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getRunName() const
|
||||
{
|
||||
return m_Run_name;
|
||||
}
|
||||
void Dataset_settings::setRunName(std::string const& value)
|
||||
{
|
||||
m_Run_name = value;
|
||||
m_Run_nameIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::runNameIsSet() const
|
||||
{
|
||||
return m_Run_nameIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetRun_name()
|
||||
{
|
||||
m_Run_nameIsSet = false;
|
||||
}
|
||||
std::string Dataset_settings::getExperimentGroup() const
|
||||
{
|
||||
return m_Experiment_group;
|
||||
}
|
||||
void Dataset_settings::setExperimentGroup(std::string const& value)
|
||||
{
|
||||
m_Experiment_group = value;
|
||||
m_Experiment_groupIsSet = true;
|
||||
}
|
||||
bool Dataset_settings::experimentGroupIsSet() const
|
||||
{
|
||||
return m_Experiment_groupIsSet;
|
||||
}
|
||||
void Dataset_settings::unsetExperiment_group()
|
||||
{
|
||||
m_Experiment_groupIsSet = false;
|
||||
}
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell Dataset_settings::getUnitCell() const
|
||||
{
|
||||
return m_Unit_cell;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -19,6 +19,7 @@
|
||||
#define Dataset_settings_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "Rotation_axis.h"
|
||||
#include <string>
|
||||
#include "Dataset_settings_unit_cell.h"
|
||||
@@ -75,12 +76,12 @@ public:
|
||||
bool ntriggerIsSet() const;
|
||||
void unsetNtrigger();
|
||||
/// <summary>
|
||||
/// FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified. Frame summation factor applies only to conversion mode (assumed as 1 for raw data). In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells (assumed as 1).
|
||||
/// Image time. If not provided (or zero value) the frame time is assumed as default. Image time must be multiple of frame time; max value is 256 * frame_time. In XFEL mode: summation happens for frames collected with multiple triggers. Ignored for storage cells and if raw data are saved.
|
||||
/// </summary>
|
||||
int64_t getSummation() const;
|
||||
void setSummation(int64_t const value);
|
||||
bool summationIsSet() const;
|
||||
void unsetSummation();
|
||||
int64_t getImageTimeUs() const;
|
||||
void setImageTimeUs(int64_t const value);
|
||||
bool imageTimeUsIsSet() const;
|
||||
void unsetImage_time_us();
|
||||
/// <summary>
|
||||
/// /entry/detector/beam_center_x in NXmx Beam center in X direction [pixels]
|
||||
/// </summary>
|
||||
@@ -97,10 +98,10 @@ public:
|
||||
float getDetectorDistanceMm() const;
|
||||
void setDetectorDistanceMm(float const value);
|
||||
/// <summary>
|
||||
/// Used to calculate /entry/beam/incident_wavelength in NXmx Incident photon energy in keV
|
||||
/// Used to calculate /entry/beam/incident_wavelength in NXmx Incident particle (photon, electron) energy in keV
|
||||
/// </summary>
|
||||
float getPhotonEnergyKeV() const;
|
||||
void setPhotonEnergyKeV(float const value);
|
||||
float getIncidentEnergyKeV() const;
|
||||
void setIncidentEnergyKeV(float const value);
|
||||
/// <summary>
|
||||
/// Prefix for filenames. If left empty, no file will be saved.
|
||||
/// </summary>
|
||||
@@ -127,6 +128,8 @@ public:
|
||||
/// </summary>
|
||||
std::string getSampleName() const;
|
||||
void setSampleName(std::string const& value);
|
||||
bool sampleNameIsSet() const;
|
||||
void unsetSample_name();
|
||||
/// <summary>
|
||||
/// FPGA output data type
|
||||
/// </summary>
|
||||
@@ -158,31 +161,31 @@ public:
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Rotation_axis getOmega() const;
|
||||
void setOmega(org::openapitools::server::model::Rotation_axis const& value);
|
||||
bool omegaIsSet() const;
|
||||
void unsetOmega();
|
||||
org::openapitools::server::model::Rotation_axis getGoniometer() const;
|
||||
void setGoniometer(org::openapitools::server::model::Rotation_axis const& value);
|
||||
bool goniometerIsSet() const;
|
||||
void unsetGoniometer();
|
||||
/// <summary>
|
||||
/// Header appendix, added as user_data to start message
|
||||
/// Header appendix, added as user_data/user to start message (can be any valid JSON)
|
||||
/// </summary>
|
||||
std::string getHeaderAppendix() const;
|
||||
void setHeaderAppendix(std::string const& value);
|
||||
nlohmann::json getHeaderAppendix() const;
|
||||
void setHeaderAppendix(nlohmann::json const& value);
|
||||
bool headerAppendixIsSet() const;
|
||||
void unsetHeader_appendix();
|
||||
/// <summary>
|
||||
/// Image appendix, added as user_data to image message
|
||||
/// Image appendix, added as user_data to image message (can be any valid JSON)
|
||||
/// </summary>
|
||||
std::string getImageAppendix() const;
|
||||
void setImageAppendix(std::string const& value);
|
||||
nlohmann::json getImageAppendix() const;
|
||||
void setImageAppendix(nlohmann::json const& value);
|
||||
bool imageAppendixIsSet() const;
|
||||
void unsetImage_appendix();
|
||||
/// <summary>
|
||||
/// For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts
|
||||
/// For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts
|
||||
/// </summary>
|
||||
float getPhotonEnergyMultiplier() const;
|
||||
void setPhotonEnergyMultiplier(float const value);
|
||||
bool photonEnergyMultiplierIsSet() const;
|
||||
void unsetPhoton_energy_multiplier();
|
||||
float getEnergyMultiplier() const;
|
||||
void setEnergyMultiplier(float const value);
|
||||
bool energyMultiplierIsSet() const;
|
||||
void unsetEnergy_multiplier();
|
||||
/// <summary>
|
||||
/// Rate at which non-indexed images are accepted to be forwarded to writer. Value of 1.0 (default) means that all images are written. Values below zero mean that non-indexed images will be accepted with a given probability.
|
||||
/// </summary>
|
||||
@@ -191,6 +194,27 @@ public:
|
||||
bool dataReductionFactorSerialmxIsSet() const;
|
||||
void unsetData_reduction_factor_serialmx();
|
||||
/// <summary>
|
||||
/// Number of run within an experimental session. Transferred over CBOR stream as \"series ID\", though not saved in HDF5 file. It is highly recommended to keep this number unique for each data collection during experimental series. If not provided, the number will be automatically incremented.
|
||||
/// </summary>
|
||||
int64_t getRunNumber() const;
|
||||
void setRunNumber(int64_t const value);
|
||||
bool runNumberIsSet() const;
|
||||
void unsetRun_number();
|
||||
/// <summary>
|
||||
/// Unique ID of run. Transferred over CBOR stream as \"unique series ID\", though not saved in HDF5 file. It is highly recommended to keep this name unique for each data collection during experimental series. If not provided, the name will be automatically generated as number + colon + file_prefix.
|
||||
/// </summary>
|
||||
std::string getRunName() const;
|
||||
void setRunName(std::string const& value);
|
||||
bool runNameIsSet() const;
|
||||
void unsetRun_name();
|
||||
/// <summary>
|
||||
/// Name of group owning the data (e.g. p-group or proposal number). Transferred over CBOR stream, though not saved in HDF5 file.
|
||||
/// </summary>
|
||||
std::string getExperimentGroup() const;
|
||||
void setExperimentGroup(std::string const& value);
|
||||
bool experimentGroupIsSet() const;
|
||||
void unsetExperiment_group();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell getUnitCell() const;
|
||||
@@ -205,15 +229,15 @@ protected:
|
||||
bool m_Images_per_triggerIsSet;
|
||||
int64_t m_Ntrigger;
|
||||
bool m_NtriggerIsSet;
|
||||
int64_t m_Summation;
|
||||
bool m_SummationIsSet;
|
||||
int64_t m_Image_time_us;
|
||||
bool m_Image_time_usIsSet;
|
||||
float m_Beam_x_pxl;
|
||||
|
||||
float m_Beam_y_pxl;
|
||||
|
||||
float m_Detector_distance_mm;
|
||||
|
||||
float m_Photon_energy_keV;
|
||||
float m_Incident_energy_keV;
|
||||
|
||||
std::string m_File_prefix;
|
||||
bool m_File_prefixIsSet;
|
||||
@@ -222,7 +246,7 @@ protected:
|
||||
int64_t m_Space_group_number;
|
||||
bool m_Space_group_numberIsSet;
|
||||
std::string m_Sample_name;
|
||||
|
||||
bool m_Sample_nameIsSet;
|
||||
std::string m_Fpga_output;
|
||||
bool m_Fpga_outputIsSet;
|
||||
std::string m_Compression;
|
||||
@@ -231,16 +255,22 @@ protected:
|
||||
bool m_Total_fluxIsSet;
|
||||
float m_Transmission;
|
||||
bool m_TransmissionIsSet;
|
||||
org::openapitools::server::model::Rotation_axis m_Omega;
|
||||
bool m_OmegaIsSet;
|
||||
std::string m_Header_appendix;
|
||||
org::openapitools::server::model::Rotation_axis m_Goniometer;
|
||||
bool m_GoniometerIsSet;
|
||||
nlohmann::json m_Header_appendix;
|
||||
bool m_Header_appendixIsSet;
|
||||
std::string m_Image_appendix;
|
||||
nlohmann::json m_Image_appendix;
|
||||
bool m_Image_appendixIsSet;
|
||||
float m_Photon_energy_multiplier;
|
||||
bool m_Photon_energy_multiplierIsSet;
|
||||
float m_Energy_multiplier;
|
||||
bool m_Energy_multiplierIsSet;
|
||||
float m_Data_reduction_factor_serialmx;
|
||||
bool m_Data_reduction_factor_serialmxIsSet;
|
||||
int64_t m_Run_number;
|
||||
bool m_Run_numberIsSet;
|
||||
std::string m_Run_name;
|
||||
bool m_Run_nameIsSet;
|
||||
std::string m_Experiment_group;
|
||||
bool m_Experiment_groupIsSet;
|
||||
org::openapitools::server::model::Dataset_settings_unit_cell m_Unit_cell;
|
||||
bool m_Unit_cellIsSet;
|
||||
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Dataset_settings_roi_sum_area.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Dataset_settings_roi_sum_area::Dataset_settings_roi_sum_area()
|
||||
{
|
||||
m_X_min = 0L;
|
||||
m_X_max = 0L;
|
||||
m_Y_min = 0L;
|
||||
m_Y_max = 0L;
|
||||
|
||||
}
|
||||
|
||||
void Dataset_settings_roi_sum_area::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Dataset_settings_roi_sum_area::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Dataset_settings_roi_sum_area::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Dataset_settings_roi_sum_area" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Dataset_settings_roi_sum_area::operator==(const Dataset_settings_roi_sum_area& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
(getXMin() == rhs.getXMin())
|
||||
&&
|
||||
|
||||
(getXMax() == rhs.getXMax())
|
||||
&&
|
||||
|
||||
(getYMin() == rhs.getYMin())
|
||||
&&
|
||||
|
||||
(getYMax() == rhs.getYMax())
|
||||
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Dataset_settings_roi_sum_area::operator!=(const Dataset_settings_roi_sum_area& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Dataset_settings_roi_sum_area& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
j["x_min"] = o.m_X_min;
|
||||
j["x_max"] = o.m_X_max;
|
||||
j["y_min"] = o.m_Y_min;
|
||||
j["y_max"] = o.m_Y_max;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Dataset_settings_roi_sum_area& o)
|
||||
{
|
||||
j.at("x_min").get_to(o.m_X_min);
|
||||
j.at("x_max").get_to(o.m_X_max);
|
||||
j.at("y_min").get_to(o.m_Y_min);
|
||||
j.at("y_max").get_to(o.m_Y_max);
|
||||
|
||||
}
|
||||
|
||||
int64_t Dataset_settings_roi_sum_area::getXMin() const
|
||||
{
|
||||
return m_X_min;
|
||||
}
|
||||
void Dataset_settings_roi_sum_area::setXMin(int64_t const value)
|
||||
{
|
||||
m_X_min = value;
|
||||
}
|
||||
int64_t Dataset_settings_roi_sum_area::getXMax() const
|
||||
{
|
||||
return m_X_max;
|
||||
}
|
||||
void Dataset_settings_roi_sum_area::setXMax(int64_t const value)
|
||||
{
|
||||
m_X_max = value;
|
||||
}
|
||||
int64_t Dataset_settings_roi_sum_area::getYMin() const
|
||||
{
|
||||
return m_Y_min;
|
||||
}
|
||||
void Dataset_settings_roi_sum_area::setYMin(int64_t const value)
|
||||
{
|
||||
m_Y_min = value;
|
||||
}
|
||||
int64_t Dataset_settings_roi_sum_area::getYMax() const
|
||||
{
|
||||
return m_Y_max;
|
||||
}
|
||||
void Dataset_settings_roi_sum_area::setYMax(int64_t const value)
|
||||
{
|
||||
m_Y_max = value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Dataset_settings_roi_sum_area.h
|
||||
*
|
||||
* Rectangle for ROI summation
|
||||
*/
|
||||
|
||||
#ifndef Dataset_settings_roi_sum_area_H_
|
||||
#define Dataset_settings_roi_sum_area_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Rectangle for ROI summation
|
||||
/// </summary>
|
||||
class Dataset_settings_roi_sum_area
|
||||
{
|
||||
public:
|
||||
Dataset_settings_roi_sum_area();
|
||||
virtual ~Dataset_settings_roi_sum_area() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Dataset_settings_roi_sum_area& rhs) const;
|
||||
bool operator!=(const Dataset_settings_roi_sum_area& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Dataset_settings_roi_sum_area members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getXMin() const;
|
||||
void setXMin(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getXMax() const;
|
||||
void setXMax(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getYMin() const;
|
||||
void setYMin(int64_t const value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getYMax() const;
|
||||
void setYMax(int64_t const value);
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Dataset_settings_roi_sum_area& o);
|
||||
friend void from_json(const nlohmann::json& j, Dataset_settings_roi_sum_area& o);
|
||||
protected:
|
||||
int64_t m_X_min;
|
||||
|
||||
int64_t m_X_max;
|
||||
|
||||
int64_t m_Y_min;
|
||||
|
||||
int64_t m_Y_max;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Dataset_settings_roi_sum_area_H_ */
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -23,6 +23,10 @@ Measurement_statistics::Measurement_statistics()
|
||||
{
|
||||
m_File_prefix = "";
|
||||
m_File_prefixIsSet = false;
|
||||
m_Run_number = 0L;
|
||||
m_Run_numberIsSet = false;
|
||||
m_Experiment_group = "";
|
||||
m_Experiment_groupIsSet = false;
|
||||
m_Images_expected = 0L;
|
||||
m_Images_expectedIsSet = false;
|
||||
m_Images_collected = 0L;
|
||||
@@ -51,6 +55,8 @@ Measurement_statistics::Measurement_statistics()
|
||||
m_Detector_pixel_depthIsSet = false;
|
||||
m_Bkg_estimate = 0.0f;
|
||||
m_Bkg_estimateIsSet = false;
|
||||
m_Unit_cell = "";
|
||||
m_Unit_cellIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,7 +79,7 @@ bool Measurement_statistics::validate(std::stringstream& msg, const std::string&
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Measurement_statistics" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
if (collectionEfficiencyIsSet())
|
||||
{
|
||||
const float& value = m_Collection_efficiency;
|
||||
@@ -106,7 +112,7 @@ bool Measurement_statistics::validate(std::stringstream& msg, const std::string&
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -119,6 +125,12 @@ bool Measurement_statistics::operator==(const Measurement_statistics& rhs) const
|
||||
((!filePrefixIsSet() && !rhs.filePrefixIsSet()) || (filePrefixIsSet() && rhs.filePrefixIsSet() && getFilePrefix() == rhs.getFilePrefix())) &&
|
||||
|
||||
|
||||
((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) &&
|
||||
|
||||
|
||||
((!experimentGroupIsSet() && !rhs.experimentGroupIsSet()) || (experimentGroupIsSet() && rhs.experimentGroupIsSet() && getExperimentGroup() == rhs.getExperimentGroup())) &&
|
||||
|
||||
|
||||
((!imagesExpectedIsSet() && !rhs.imagesExpectedIsSet()) || (imagesExpectedIsSet() && rhs.imagesExpectedIsSet() && getImagesExpected() == rhs.getImagesExpected())) &&
|
||||
|
||||
|
||||
@@ -158,7 +170,10 @@ bool Measurement_statistics::operator==(const Measurement_statistics& rhs) const
|
||||
((!detectorPixelDepthIsSet() && !rhs.detectorPixelDepthIsSet()) || (detectorPixelDepthIsSet() && rhs.detectorPixelDepthIsSet() && getDetectorPixelDepth() == rhs.getDetectorPixelDepth())) &&
|
||||
|
||||
|
||||
((!bkgEstimateIsSet() && !rhs.bkgEstimateIsSet()) || (bkgEstimateIsSet() && rhs.bkgEstimateIsSet() && getBkgEstimate() == rhs.getBkgEstimate()))
|
||||
((!bkgEstimateIsSet() && !rhs.bkgEstimateIsSet()) || (bkgEstimateIsSet() && rhs.bkgEstimateIsSet() && getBkgEstimate() == rhs.getBkgEstimate())) &&
|
||||
|
||||
|
||||
((!unitCellIsSet() && !rhs.unitCellIsSet()) || (unitCellIsSet() && rhs.unitCellIsSet() && getUnitCell() == rhs.getUnitCell()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -173,6 +188,10 @@ void to_json(nlohmann::json& j, const Measurement_statistics& o)
|
||||
j = nlohmann::json();
|
||||
if(o.filePrefixIsSet())
|
||||
j["file_prefix"] = o.m_File_prefix;
|
||||
if(o.runNumberIsSet())
|
||||
j["run_number"] = o.m_Run_number;
|
||||
if(o.experimentGroupIsSet())
|
||||
j["experiment_group"] = o.m_Experiment_group;
|
||||
if(o.imagesExpectedIsSet())
|
||||
j["images_expected"] = o.m_Images_expected;
|
||||
if(o.imagesCollectedIsSet())
|
||||
@@ -201,6 +220,8 @@ void to_json(nlohmann::json& j, const Measurement_statistics& o)
|
||||
j["detector_pixel_depth"] = o.m_Detector_pixel_depth;
|
||||
if(o.bkgEstimateIsSet())
|
||||
j["bkg_estimate"] = o.m_Bkg_estimate;
|
||||
if(o.unitCellIsSet())
|
||||
j["unit_cell"] = o.m_Unit_cell;
|
||||
|
||||
}
|
||||
|
||||
@@ -211,6 +232,16 @@ void from_json(const nlohmann::json& j, Measurement_statistics& o)
|
||||
j.at("file_prefix").get_to(o.m_File_prefix);
|
||||
o.m_File_prefixIsSet = true;
|
||||
}
|
||||
if(j.find("run_number") != j.end())
|
||||
{
|
||||
j.at("run_number").get_to(o.m_Run_number);
|
||||
o.m_Run_numberIsSet = true;
|
||||
}
|
||||
if(j.find("experiment_group") != j.end())
|
||||
{
|
||||
j.at("experiment_group").get_to(o.m_Experiment_group);
|
||||
o.m_Experiment_groupIsSet = true;
|
||||
}
|
||||
if(j.find("images_expected") != j.end())
|
||||
{
|
||||
j.at("images_expected").get_to(o.m_Images_expected);
|
||||
@@ -281,6 +312,11 @@ void from_json(const nlohmann::json& j, Measurement_statistics& o)
|
||||
j.at("bkg_estimate").get_to(o.m_Bkg_estimate);
|
||||
o.m_Bkg_estimateIsSet = true;
|
||||
}
|
||||
if(j.find("unit_cell") != j.end())
|
||||
{
|
||||
j.at("unit_cell").get_to(o.m_Unit_cell);
|
||||
o.m_Unit_cellIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -301,6 +337,40 @@ void Measurement_statistics::unsetFile_prefix()
|
||||
{
|
||||
m_File_prefixIsSet = false;
|
||||
}
|
||||
int64_t Measurement_statistics::getRunNumber() const
|
||||
{
|
||||
return m_Run_number;
|
||||
}
|
||||
void Measurement_statistics::setRunNumber(int64_t const value)
|
||||
{
|
||||
m_Run_number = value;
|
||||
m_Run_numberIsSet = true;
|
||||
}
|
||||
bool Measurement_statistics::runNumberIsSet() const
|
||||
{
|
||||
return m_Run_numberIsSet;
|
||||
}
|
||||
void Measurement_statistics::unsetRun_number()
|
||||
{
|
||||
m_Run_numberIsSet = false;
|
||||
}
|
||||
std::string Measurement_statistics::getExperimentGroup() const
|
||||
{
|
||||
return m_Experiment_group;
|
||||
}
|
||||
void Measurement_statistics::setExperimentGroup(std::string const& value)
|
||||
{
|
||||
m_Experiment_group = value;
|
||||
m_Experiment_groupIsSet = true;
|
||||
}
|
||||
bool Measurement_statistics::experimentGroupIsSet() const
|
||||
{
|
||||
return m_Experiment_groupIsSet;
|
||||
}
|
||||
void Measurement_statistics::unsetExperiment_group()
|
||||
{
|
||||
m_Experiment_groupIsSet = false;
|
||||
}
|
||||
int64_t Measurement_statistics::getImagesExpected() const
|
||||
{
|
||||
return m_Images_expected;
|
||||
@@ -539,6 +609,23 @@ void Measurement_statistics::unsetBkg_estimate()
|
||||
{
|
||||
m_Bkg_estimateIsSet = false;
|
||||
}
|
||||
std::string Measurement_statistics::getUnitCell() const
|
||||
{
|
||||
return m_Unit_cell;
|
||||
}
|
||||
void Measurement_statistics::setUnitCell(std::string const& value)
|
||||
{
|
||||
m_Unit_cell = value;
|
||||
m_Unit_cellIsSet = true;
|
||||
}
|
||||
bool Measurement_statistics::unitCellIsSet() const
|
||||
{
|
||||
return m_Unit_cellIsSet;
|
||||
}
|
||||
void Measurement_statistics::unsetUnit_cell()
|
||||
{
|
||||
m_Unit_cellIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -66,6 +66,20 @@ public:
|
||||
bool filePrefixIsSet() const;
|
||||
void unsetFile_prefix();
|
||||
/// <summary>
|
||||
/// Number of data collection run. This can be either automatically incremented or provided externally for each data collection.
|
||||
/// </summary>
|
||||
int64_t getRunNumber() const;
|
||||
void setRunNumber(int64_t const value);
|
||||
bool runNumberIsSet() const;
|
||||
void unsetRun_number();
|
||||
/// <summary>
|
||||
/// Name of group owning the data (e.g. p-group or proposal number).
|
||||
/// </summary>
|
||||
std::string getExperimentGroup() const;
|
||||
void setExperimentGroup(std::string const& value);
|
||||
bool experimentGroupIsSet() const;
|
||||
void unsetExperiment_group();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getImagesExpected() const;
|
||||
@@ -163,12 +177,23 @@ public:
|
||||
void setBkgEstimate(float const value);
|
||||
bool bkgEstimateIsSet() const;
|
||||
void unsetBkg_estimate();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getUnitCell() const;
|
||||
void setUnitCell(std::string const& value);
|
||||
bool unitCellIsSet() const;
|
||||
void unsetUnit_cell();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Measurement_statistics& o);
|
||||
friend void from_json(const nlohmann::json& j, Measurement_statistics& o);
|
||||
protected:
|
||||
std::string m_File_prefix;
|
||||
bool m_File_prefixIsSet;
|
||||
int64_t m_Run_number;
|
||||
bool m_Run_numberIsSet;
|
||||
std::string m_Experiment_group;
|
||||
bool m_Experiment_groupIsSet;
|
||||
int64_t m_Images_expected;
|
||||
bool m_Images_expectedIsSet;
|
||||
int64_t m_Images_collected;
|
||||
@@ -197,6 +222,8 @@ protected:
|
||||
bool m_Detector_pixel_depthIsSet;
|
||||
float m_Bkg_estimate;
|
||||
bool m_Bkg_estimateIsSet;
|
||||
std::string m_Unit_cell;
|
||||
bool m_Unit_cellIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Plot_request.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Plot_request::Plot_request()
|
||||
{
|
||||
m_Binning = 0L;
|
||||
m_BinningIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Plot_request::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Plot_request::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Plot_request::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Plot_request" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Plot_request::operator==(const Plot_request& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!binningIsSet() && !rhs.binningIsSet()) || (binningIsSet() && rhs.binningIsSet() && getBinning() == rhs.getBinning()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Plot_request::operator!=(const Plot_request& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Plot_request& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
if(o.binningIsSet())
|
||||
j["binning"] = o.m_Binning;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Plot_request& o)
|
||||
{
|
||||
if(j.find("binning") != j.end())
|
||||
{
|
||||
j.at("binning").get_to(o.m_Binning);
|
||||
o.m_BinningIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int64_t Plot_request::getBinning() const
|
||||
{
|
||||
return m_Binning;
|
||||
}
|
||||
void Plot_request::setBinning(int64_t const value)
|
||||
{
|
||||
m_Binning = value;
|
||||
m_BinningIsSet = true;
|
||||
}
|
||||
bool Plot_request::binningIsSet() const
|
||||
{
|
||||
return m_BinningIsSet;
|
||||
}
|
||||
void Plot_request::unsetBinning()
|
||||
{
|
||||
m_BinningIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Plot_request.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Plot_request_H_
|
||||
#define Plot_request_H_
|
||||
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Plot_request
|
||||
{
|
||||
public:
|
||||
Plot_request();
|
||||
virtual ~Plot_request() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Plot_request& rhs) const;
|
||||
bool operator!=(const Plot_request& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Plot_request members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getBinning() const;
|
||||
void setBinning(int64_t const value);
|
||||
bool binningIsSet() const;
|
||||
void unsetBinning();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Plot_request& o);
|
||||
friend void from_json(const nlohmann::json& j, Plot_request& o);
|
||||
protected:
|
||||
int64_t m_Binning;
|
||||
bool m_BinningIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Plot_request_H_ */
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -26,10 +26,14 @@ Preview_settings::Preview_settings()
|
||||
m_Show_spotsIsSet = false;
|
||||
m_Show_roi = false;
|
||||
m_Show_roiIsSet = false;
|
||||
m_Jpeg_quality = 0L;
|
||||
m_Jpeg_quality = 100L;
|
||||
m_Jpeg_qualityIsSet = false;
|
||||
m_Show_indexed = false;
|
||||
m_Show_indexedIsSet = false;
|
||||
m_Show_user_mask = false;
|
||||
m_Show_user_maskIsSet = false;
|
||||
m_Resolution_ring = 0.1f;
|
||||
m_Resolution_ringIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +94,26 @@ bool Preview_settings::validate(std::stringstream& msg, const std::string& pathP
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (resolutionRingIsSet())
|
||||
{
|
||||
const float& value = m_Resolution_ring;
|
||||
const std::string currentValuePath = _pathPrefix + ".resolutionRing";
|
||||
|
||||
|
||||
if (value < static_cast<float>(0.1))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 0.1;";
|
||||
}
|
||||
if (value > static_cast<float>(100.0))
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be less than or equal to 100.0;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -112,7 +135,13 @@ bool Preview_settings::operator==(const Preview_settings& rhs) const
|
||||
((!jpegQualityIsSet() && !rhs.jpegQualityIsSet()) || (jpegQualityIsSet() && rhs.jpegQualityIsSet() && getJpegQuality() == rhs.getJpegQuality())) &&
|
||||
|
||||
|
||||
((!showIndexedIsSet() && !rhs.showIndexedIsSet()) || (showIndexedIsSet() && rhs.showIndexedIsSet() && isShowIndexed() == rhs.isShowIndexed()))
|
||||
((!showIndexedIsSet() && !rhs.showIndexedIsSet()) || (showIndexedIsSet() && rhs.showIndexedIsSet() && isShowIndexed() == rhs.isShowIndexed())) &&
|
||||
|
||||
|
||||
((!showUserMaskIsSet() && !rhs.showUserMaskIsSet()) || (showUserMaskIsSet() && rhs.showUserMaskIsSet() && isShowUserMask() == rhs.isShowUserMask())) &&
|
||||
|
||||
|
||||
((!resolutionRingIsSet() && !rhs.resolutionRingIsSet()) || (resolutionRingIsSet() && rhs.resolutionRingIsSet() && getResolutionRing() == rhs.getResolutionRing()))
|
||||
|
||||
;
|
||||
}
|
||||
@@ -134,6 +163,10 @@ void to_json(nlohmann::json& j, const Preview_settings& o)
|
||||
j["jpeg_quality"] = o.m_Jpeg_quality;
|
||||
if(o.showIndexedIsSet())
|
||||
j["show_indexed"] = o.m_Show_indexed;
|
||||
if(o.showUserMaskIsSet())
|
||||
j["show_user_mask"] = o.m_Show_user_mask;
|
||||
if(o.resolutionRingIsSet())
|
||||
j["resolution_ring"] = o.m_Resolution_ring;
|
||||
|
||||
}
|
||||
|
||||
@@ -160,6 +193,16 @@ void from_json(const nlohmann::json& j, Preview_settings& o)
|
||||
j.at("show_indexed").get_to(o.m_Show_indexed);
|
||||
o.m_Show_indexedIsSet = true;
|
||||
}
|
||||
if(j.find("show_user_mask") != j.end())
|
||||
{
|
||||
j.at("show_user_mask").get_to(o.m_Show_user_mask);
|
||||
o.m_Show_user_maskIsSet = true;
|
||||
}
|
||||
if(j.find("resolution_ring") != j.end())
|
||||
{
|
||||
j.at("resolution_ring").get_to(o.m_Resolution_ring);
|
||||
o.m_Resolution_ringIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -239,6 +282,40 @@ void Preview_settings::unsetShow_indexed()
|
||||
{
|
||||
m_Show_indexedIsSet = false;
|
||||
}
|
||||
bool Preview_settings::isShowUserMask() const
|
||||
{
|
||||
return m_Show_user_mask;
|
||||
}
|
||||
void Preview_settings::setShowUserMask(bool const value)
|
||||
{
|
||||
m_Show_user_mask = value;
|
||||
m_Show_user_maskIsSet = true;
|
||||
}
|
||||
bool Preview_settings::showUserMaskIsSet() const
|
||||
{
|
||||
return m_Show_user_maskIsSet;
|
||||
}
|
||||
void Preview_settings::unsetShow_user_mask()
|
||||
{
|
||||
m_Show_user_maskIsSet = false;
|
||||
}
|
||||
float Preview_settings::getResolutionRing() const
|
||||
{
|
||||
return m_Resolution_ring;
|
||||
}
|
||||
void Preview_settings::setResolutionRing(float const value)
|
||||
{
|
||||
m_Resolution_ring = value;
|
||||
m_Resolution_ringIsSet = true;
|
||||
}
|
||||
bool Preview_settings::resolutionRingIsSet() const
|
||||
{
|
||||
return m_Resolution_ringIsSet;
|
||||
}
|
||||
void Preview_settings::unsetResolution_ring()
|
||||
{
|
||||
m_Resolution_ringIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -90,6 +90,20 @@ public:
|
||||
void setShowIndexed(bool const value);
|
||||
bool showIndexedIsSet() const;
|
||||
void unsetShow_indexed();
|
||||
/// <summary>
|
||||
/// Show user mask
|
||||
/// </summary>
|
||||
bool isShowUserMask() const;
|
||||
void setShowUserMask(bool const value);
|
||||
bool showUserMaskIsSet() const;
|
||||
void unsetShow_user_mask();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getResolutionRing() const;
|
||||
void setResolutionRing(float const value);
|
||||
bool resolutionRingIsSet() const;
|
||||
void unsetResolution_ring();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Preview_settings& o);
|
||||
friend void from_json(const nlohmann::json& j, Preview_settings& o);
|
||||
@@ -104,6 +118,10 @@ protected:
|
||||
bool m_Jpeg_qualityIsSet;
|
||||
bool m_Show_indexed;
|
||||
bool m_Show_indexedIsSet;
|
||||
bool m_Show_user_mask;
|
||||
bool m_Show_user_maskIsSet;
|
||||
float m_Resolution_ring;
|
||||
bool m_Resolution_ringIsSet;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -21,6 +21,8 @@ namespace org::openapitools::server::model
|
||||
|
||||
Rotation_axis::Rotation_axis()
|
||||
{
|
||||
m_Name = "omega";
|
||||
m_NameIsSet = false;
|
||||
m_Step = 0.0f;
|
||||
m_Start = 0.0f;
|
||||
m_StartIsSet = false;
|
||||
@@ -47,6 +49,20 @@ bool Rotation_axis::validate(std::stringstream& msg, const std::string& pathPref
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Rotation_axis" : pathPrefix;
|
||||
|
||||
|
||||
if (nameIsSet())
|
||||
{
|
||||
const std::string& value = m_Name;
|
||||
const std::string currentValuePath = _pathPrefix + ".name";
|
||||
|
||||
|
||||
if (value.length() < 1)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be at least 1 characters long;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (vectorIsSet())
|
||||
{
|
||||
@@ -87,6 +103,9 @@ bool Rotation_axis::operator==(const Rotation_axis& rhs) const
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!nameIsSet() && !rhs.nameIsSet()) || (nameIsSet() && rhs.nameIsSet() && getName() == rhs.getName())) &&
|
||||
|
||||
(getStep() == rhs.getStep())
|
||||
&&
|
||||
|
||||
@@ -107,6 +126,8 @@ bool Rotation_axis::operator!=(const Rotation_axis& rhs) const
|
||||
void to_json(nlohmann::json& j, const Rotation_axis& o)
|
||||
{
|
||||
j = nlohmann::json();
|
||||
if(o.nameIsSet())
|
||||
j["name"] = o.m_Name;
|
||||
j["step"] = o.m_Step;
|
||||
if(o.startIsSet())
|
||||
j["start"] = o.m_Start;
|
||||
@@ -117,6 +138,11 @@ void to_json(nlohmann::json& j, const Rotation_axis& o)
|
||||
|
||||
void from_json(const nlohmann::json& j, Rotation_axis& o)
|
||||
{
|
||||
if(j.find("name") != j.end())
|
||||
{
|
||||
j.at("name").get_to(o.m_Name);
|
||||
o.m_NameIsSet = true;
|
||||
}
|
||||
j.at("step").get_to(o.m_Step);
|
||||
if(j.find("start") != j.end())
|
||||
{
|
||||
@@ -131,6 +157,23 @@ void from_json(const nlohmann::json& j, Rotation_axis& o)
|
||||
|
||||
}
|
||||
|
||||
std::string Rotation_axis::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void Rotation_axis::setName(std::string const& value)
|
||||
{
|
||||
m_Name = value;
|
||||
m_NameIsSet = true;
|
||||
}
|
||||
bool Rotation_axis::nameIsSet() const
|
||||
{
|
||||
return m_NameIsSet;
|
||||
}
|
||||
void Rotation_axis::unsetName()
|
||||
{
|
||||
m_NameIsSet = false;
|
||||
}
|
||||
float Rotation_axis::getStep() const
|
||||
{
|
||||
return m_Step;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -19,6 +19,7 @@
|
||||
#define Rotation_axis_H_
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -58,6 +59,13 @@ public:
|
||||
/////////////////////////////////////////////
|
||||
/// Rotation_axis members
|
||||
|
||||
/// <summary>
|
||||
/// Name of rotation axis (e.g., omega, phi)
|
||||
/// </summary>
|
||||
std::string getName() const;
|
||||
void setName(std::string const& value);
|
||||
bool nameIsSet() const;
|
||||
void unsetName();
|
||||
/// <summary>
|
||||
/// Angle step in degrees
|
||||
/// </summary>
|
||||
@@ -81,6 +89,8 @@ public:
|
||||
friend void to_json(nlohmann::json& j, const Rotation_axis& o);
|
||||
friend void from_json(const nlohmann::json& j, Rotation_axis& o);
|
||||
protected:
|
||||
std::string m_Name;
|
||||
bool m_NameIsSet;
|
||||
float m_Step;
|
||||
|
||||
float m_Start;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -23,6 +23,10 @@ Spot_finding_settings::Spot_finding_settings()
|
||||
{
|
||||
m_Enable = true;
|
||||
m_Indexing = true;
|
||||
m_Filter_powder_rings = false;
|
||||
m_Filter_powder_ringsIsSet = false;
|
||||
m_Min_spot_count_powder_ring = 0L;
|
||||
m_Min_spot_count_powder_ringIsSet = false;
|
||||
m_Signal_to_noise_threshold = 0.0f;
|
||||
m_Photon_count_threshold = 0L;
|
||||
m_Min_pix_per_spot = 0L;
|
||||
@@ -52,7 +56,21 @@ bool Spot_finding_settings::validate(std::stringstream& msg, const std::string&
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Spot_finding_settings" : pathPrefix;
|
||||
|
||||
|
||||
|
||||
if (minSpotCountPowderRingIsSet())
|
||||
{
|
||||
const int64_t& value = m_Min_spot_count_powder_ring;
|
||||
const std::string currentValuePath = _pathPrefix + ".minSpotCountPowderRing";
|
||||
|
||||
|
||||
if (value < 5ll)
|
||||
{
|
||||
success = false;
|
||||
msg << currentValuePath << ": must be greater than or equal to 5;";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Signal_to_noise_threshold */ {
|
||||
const float& value = m_Signal_to_noise_threshold;
|
||||
@@ -142,6 +160,12 @@ bool Spot_finding_settings::operator==(const Spot_finding_settings& rhs) const
|
||||
(isIndexing() == rhs.isIndexing())
|
||||
&&
|
||||
|
||||
|
||||
((!filterPowderRingsIsSet() && !rhs.filterPowderRingsIsSet()) || (filterPowderRingsIsSet() && rhs.filterPowderRingsIsSet() && isFilterPowderRings() == rhs.isFilterPowderRings())) &&
|
||||
|
||||
|
||||
((!minSpotCountPowderRingIsSet() && !rhs.minSpotCountPowderRingIsSet()) || (minSpotCountPowderRingIsSet() && rhs.minSpotCountPowderRingIsSet() && getMinSpotCountPowderRing() == rhs.getMinSpotCountPowderRing())) &&
|
||||
|
||||
(getSignalToNoiseThreshold() == rhs.getSignalToNoiseThreshold())
|
||||
&&
|
||||
|
||||
@@ -176,6 +200,10 @@ void to_json(nlohmann::json& j, const Spot_finding_settings& o)
|
||||
j = nlohmann::json();
|
||||
j["enable"] = o.m_Enable;
|
||||
j["indexing"] = o.m_Indexing;
|
||||
if(o.filterPowderRingsIsSet())
|
||||
j["filter_powder_rings"] = o.m_Filter_powder_rings;
|
||||
if(o.minSpotCountPowderRingIsSet())
|
||||
j["min_spot_count_powder_ring"] = o.m_Min_spot_count_powder_ring;
|
||||
j["signal_to_noise_threshold"] = o.m_Signal_to_noise_threshold;
|
||||
j["photon_count_threshold"] = o.m_Photon_count_threshold;
|
||||
j["min_pix_per_spot"] = o.m_Min_pix_per_spot;
|
||||
@@ -190,6 +218,16 @@ void from_json(const nlohmann::json& j, Spot_finding_settings& o)
|
||||
{
|
||||
j.at("enable").get_to(o.m_Enable);
|
||||
j.at("indexing").get_to(o.m_Indexing);
|
||||
if(j.find("filter_powder_rings") != j.end())
|
||||
{
|
||||
j.at("filter_powder_rings").get_to(o.m_Filter_powder_rings);
|
||||
o.m_Filter_powder_ringsIsSet = true;
|
||||
}
|
||||
if(j.find("min_spot_count_powder_ring") != j.end())
|
||||
{
|
||||
j.at("min_spot_count_powder_ring").get_to(o.m_Min_spot_count_powder_ring);
|
||||
o.m_Min_spot_count_powder_ringIsSet = true;
|
||||
}
|
||||
j.at("signal_to_noise_threshold").get_to(o.m_Signal_to_noise_threshold);
|
||||
j.at("photon_count_threshold").get_to(o.m_Photon_count_threshold);
|
||||
j.at("min_pix_per_spot").get_to(o.m_Min_pix_per_spot);
|
||||
@@ -216,6 +254,40 @@ void Spot_finding_settings::setIndexing(bool const value)
|
||||
{
|
||||
m_Indexing = value;
|
||||
}
|
||||
bool Spot_finding_settings::isFilterPowderRings() const
|
||||
{
|
||||
return m_Filter_powder_rings;
|
||||
}
|
||||
void Spot_finding_settings::setFilterPowderRings(bool const value)
|
||||
{
|
||||
m_Filter_powder_rings = value;
|
||||
m_Filter_powder_ringsIsSet = true;
|
||||
}
|
||||
bool Spot_finding_settings::filterPowderRingsIsSet() const
|
||||
{
|
||||
return m_Filter_powder_ringsIsSet;
|
||||
}
|
||||
void Spot_finding_settings::unsetFilter_powder_rings()
|
||||
{
|
||||
m_Filter_powder_ringsIsSet = false;
|
||||
}
|
||||
int64_t Spot_finding_settings::getMinSpotCountPowderRing() const
|
||||
{
|
||||
return m_Min_spot_count_powder_ring;
|
||||
}
|
||||
void Spot_finding_settings::setMinSpotCountPowderRing(int64_t const value)
|
||||
{
|
||||
m_Min_spot_count_powder_ring = value;
|
||||
m_Min_spot_count_powder_ringIsSet = true;
|
||||
}
|
||||
bool Spot_finding_settings::minSpotCountPowderRingIsSet() const
|
||||
{
|
||||
return m_Min_spot_count_powder_ringIsSet;
|
||||
}
|
||||
void Spot_finding_settings::unsetMin_spot_count_powder_ring()
|
||||
{
|
||||
m_Min_spot_count_powder_ringIsSet = false;
|
||||
}
|
||||
float Spot_finding_settings::getSignalToNoiseThreshold() const
|
||||
{
|
||||
return m_Signal_to_noise_threshold;
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Jungfraujoch
|
||||
* Jungfraujoch Broker Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.1
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0_rc.11
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
@@ -58,16 +58,30 @@ public:
|
||||
/// Spot_finding_settings members
|
||||
|
||||
/// <summary>
|
||||
/// Enable spot finding
|
||||
/// Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection. Even if disabled spot finding information will still be send and written, though always with zero spots.
|
||||
/// </summary>
|
||||
bool isEnable() const;
|
||||
void setEnable(bool const value);
|
||||
/// <summary>
|
||||
/// Enable indexing
|
||||
/// Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
/// </summary>
|
||||
bool isIndexing() const;
|
||||
void setIndexing(bool const value);
|
||||
/// <summary>
|
||||
/// Filter spots which form powder rings (e.g., ice rings)
|
||||
/// </summary>
|
||||
bool isFilterPowderRings() const;
|
||||
void setFilterPowderRings(bool const value);
|
||||
bool filterPowderRingsIsSet() const;
|
||||
void unsetFilter_powder_rings();
|
||||
/// <summary>
|
||||
/// Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.
|
||||
/// </summary>
|
||||
int64_t getMinSpotCountPowderRing() const;
|
||||
void setMinSpotCountPowderRing(int64_t const value);
|
||||
bool minSpotCountPowderRingIsSet() const;
|
||||
void unsetMin_spot_count_powder_ring();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
float getSignalToNoiseThreshold() const;
|
||||
@@ -110,6 +124,10 @@ protected:
|
||||
|
||||
bool m_Indexing;
|
||||
|
||||
bool m_Filter_powder_rings;
|
||||
bool m_Filter_powder_ringsIsSet;
|
||||
int64_t m_Min_spot_count_powder_ring;
|
||||
bool m_Min_spot_count_powder_ringIsSet;
|
||||
float m_Signal_to_noise_threshold;
|
||||
|
||||
int64_t m_Photon_count_threshold;
|
||||
|
||||
@@ -2,7 +2,9 @@ openapi: 3.0.3
|
||||
info:
|
||||
title: Jungfraujoch
|
||||
description: Jungfraujoch Broker Web API
|
||||
version: 1.0.1
|
||||
version: 1.0.0_rc.11
|
||||
contact:
|
||||
email: filip.leonarski@psi.ch
|
||||
components:
|
||||
schemas:
|
||||
rotation_axis:
|
||||
@@ -11,6 +13,11 @@ components:
|
||||
required:
|
||||
- step
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
default: omega
|
||||
minLength: 1
|
||||
description: Name of rotation axis (e.g., omega, phi)
|
||||
step:
|
||||
type: number
|
||||
format: float
|
||||
@@ -37,8 +44,7 @@ components:
|
||||
- beam_x_pxl
|
||||
- beam_y_pxl
|
||||
- detector_distance_mm
|
||||
- photon_energy_keV
|
||||
- sample_name
|
||||
- incident_energy_keV
|
||||
properties:
|
||||
images_per_trigger:
|
||||
type: integer
|
||||
@@ -56,17 +62,16 @@ components:
|
||||
minimum: 1
|
||||
description: |
|
||||
Number of TTL trigger that the detector is expected to receive during data collection
|
||||
summation:
|
||||
image_time_us:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 1
|
||||
maximum: 256
|
||||
default: 1
|
||||
minimum: 0
|
||||
description: |
|
||||
FPGA frame summation. For summation above two 32-bit pixel format will be used, unless explicitly specified.
|
||||
Frame summation factor applies only to conversion mode (assumed as 1 for raw data).
|
||||
Image time.
|
||||
If not provided (or zero value) the frame time is assumed as default.
|
||||
Image time must be multiple of frame time; max value is 256 * frame_time.
|
||||
In XFEL mode: summation happens for frames collected with multiple triggers.
|
||||
Ignored for storage cells (assumed as 1).
|
||||
Ignored for storage cells and if raw data are saved.
|
||||
beam_x_pxl:
|
||||
type: number
|
||||
format: float
|
||||
@@ -86,13 +91,13 @@ components:
|
||||
description:
|
||||
/entry/detector/distance in NXmx
|
||||
Detector distance [mm]
|
||||
photon_energy_keV:
|
||||
incident_energy_keV:
|
||||
type: number
|
||||
format: float
|
||||
minimum: 0
|
||||
description: |
|
||||
Used to calculate /entry/beam/incident_wavelength in NXmx
|
||||
Incident photon energy in keV
|
||||
Incident particle (photon, electron) energy in keV
|
||||
file_prefix:
|
||||
type: string
|
||||
default: ""
|
||||
@@ -111,6 +116,7 @@ components:
|
||||
maximum: 194
|
||||
sample_name:
|
||||
type: string
|
||||
default: ""
|
||||
description: |
|
||||
/entry/sample/name in NXmx
|
||||
Sample name
|
||||
@@ -148,21 +154,19 @@ components:
|
||||
description: |
|
||||
/entry/instrument/attenuator/attenuator_transmission
|
||||
Transmission of attenuator (filter) [no units]
|
||||
omega:
|
||||
goniometer:
|
||||
$ref: "#/components/schemas/rotation_axis"
|
||||
header_appendix:
|
||||
type: string
|
||||
description: Header appendix, added as user_data to start message
|
||||
description: Header appendix, added as user_data/user to start message (can be any valid JSON)
|
||||
image_appendix:
|
||||
type: string
|
||||
description: Image appendix, added as user_data to image message
|
||||
photon_energy_multiplier:
|
||||
description: Image appendix, added as user_data to image message (can be any valid JSON)
|
||||
energy_multiplier:
|
||||
type: number
|
||||
format: float
|
||||
default: 1.0
|
||||
minimum: 0.015625
|
||||
maximum: 4.0
|
||||
description: For JUNGFRAU conversion it is possible to multiply energy by a given factor to get fractional/multiplied photon counts
|
||||
description: For JUNGFRAU conversion it is possible to multiply incident energy by a given factor to get fractional/multiplied particle counts
|
||||
data_reduction_factor_serialmx:
|
||||
type: number
|
||||
format: float
|
||||
@@ -173,6 +177,27 @@ components:
|
||||
Rate at which non-indexed images are accepted to be forwarded to writer.
|
||||
Value of 1.0 (default) means that all images are written.
|
||||
Values below zero mean that non-indexed images will be accepted with a given probability.
|
||||
run_number:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 0
|
||||
description: |
|
||||
Number of run within an experimental session.
|
||||
Transferred over CBOR stream as "series ID", though not saved in HDF5 file.
|
||||
It is highly recommended to keep this number unique for each data collection during experimental series.
|
||||
If not provided, the number will be automatically incremented.
|
||||
run_name:
|
||||
type: string
|
||||
description: |
|
||||
Unique ID of run.
|
||||
Transferred over CBOR stream as "unique series ID", though not saved in HDF5 file.
|
||||
It is highly recommended to keep this name unique for each data collection during experimental series.
|
||||
If not provided, the name will be automatically generated as number + colon + file_prefix.
|
||||
experiment_group:
|
||||
type: string
|
||||
description: |
|
||||
Name of group owning the data (e.g. p-group or proposal number).
|
||||
Transferred over CBOR stream, though not saved in HDF5 file.
|
||||
unit_cell:
|
||||
type: object
|
||||
description: Units of angstrom and degree
|
||||
@@ -235,7 +260,7 @@ components:
|
||||
powerchip:
|
||||
type: string
|
||||
description: Power on of ASICs
|
||||
enum: ["On", "Off", "Partial"]
|
||||
enum: ["PowerOn", "PowerOff", "Partial"]
|
||||
server_version:
|
||||
type: string
|
||||
description: Detector server (on read-out boards) version
|
||||
@@ -333,11 +358,23 @@ components:
|
||||
enable:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Enable spot finding
|
||||
description: |
|
||||
Enable spot finding. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
Even if disabled spot finding information will still be send and written, though always with zero spots.
|
||||
indexing:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Enable indexing
|
||||
description: |
|
||||
Enable indexing. This is temporary setting, i.e. can be changed anytime during data collection.
|
||||
filter_powder_rings:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Filter spots which form powder rings (e.g., ice rings)
|
||||
min_spot_count_powder_ring:
|
||||
type: integer
|
||||
format: int64
|
||||
minimum: 5
|
||||
description: Minimum number of spots to consider a thin resolution shell (0.01 A^-1) a powder ring and filter out.
|
||||
signal_to_noise_threshold:
|
||||
type: number
|
||||
format: float
|
||||
@@ -447,6 +484,15 @@ components:
|
||||
properties:
|
||||
file_prefix:
|
||||
type: string
|
||||
run_number:
|
||||
type: integer
|
||||
format: int64
|
||||
description: |
|
||||
Number of data collection run. This can be either automatically incremented or provided externally for each data collection.
|
||||
experiment_group:
|
||||
type: string
|
||||
description: |
|
||||
Name of group owning the data (e.g. p-group or proposal number).
|
||||
images_expected:
|
||||
type: integer
|
||||
format: int64
|
||||
@@ -500,6 +546,8 @@ components:
|
||||
bkg_estimate:
|
||||
type: number
|
||||
format: float
|
||||
unit_cell:
|
||||
type: string
|
||||
broker_status:
|
||||
type: object
|
||||
required:
|
||||
@@ -618,12 +666,23 @@ components:
|
||||
type: integer
|
||||
description: "Quality of JPEG image (100 - highest; 0 - lowest)"
|
||||
format: int64
|
||||
default: 100
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
show_indexed:
|
||||
type: boolean
|
||||
description: "Preview indexed images only"
|
||||
|
||||
default: false
|
||||
show_user_mask:
|
||||
type: boolean
|
||||
description: "Show user mask"
|
||||
default: false
|
||||
resolution_ring:
|
||||
type: number
|
||||
format: float
|
||||
default: 0.1
|
||||
minimum: 0.1
|
||||
maximum: 100.0
|
||||
error_message:
|
||||
type: object
|
||||
required:
|
||||
@@ -794,22 +853,37 @@ paths:
|
||||
/wait_till_done:
|
||||
post:
|
||||
summary: Wait for acquisition done
|
||||
parameters:
|
||||
- in: query
|
||||
name: timeout
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
default: 60
|
||||
minimum: 0
|
||||
maximum: 3600
|
||||
description: Timeout in seconds (0 == immediate response)
|
||||
description: |
|
||||
Block execution of external script till initialization, data collection or pedestal is finished.
|
||||
Running this command does not affect (cancel) running data collection, it is only to ensure synchronous execution of other software.
|
||||
|
||||
To not block web server for a long period of time, the procedure is provided with a timeout of 5 seconds.
|
||||
To not block web server for a indefinite period of time, the procedure is provided with a timeout.
|
||||
Extending timeout is possible, but requires to ensure safety that client will not close the connection and retry the connection.
|
||||
responses:
|
||||
"200":
|
||||
description: Detector in `Idle` state, another data collection can start immediately
|
||||
"400":
|
||||
description: Timeout parameter out of bounds
|
||||
"500":
|
||||
description: Error within Jungfraujoch code - see output message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/error_message'
|
||||
"502":
|
||||
description: Detector is inactive mode
|
||||
"504":
|
||||
description: 5 second timeout reached, need to restart operation
|
||||
description: Timeout reached, need to restart operation
|
||||
|
||||
/trigger:
|
||||
post:
|
||||
@@ -961,9 +1035,9 @@ paths:
|
||||
Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates
|
||||
(depending on detector settings).
|
||||
parameters:
|
||||
- name: number
|
||||
- name: id
|
||||
in: query
|
||||
description: Image number to upload
|
||||
description: Image id to upload
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
@@ -986,6 +1060,38 @@ paths:
|
||||
schema:
|
||||
type: string
|
||||
description: Exception error
|
||||
/config/internal_generator_image.tiff:
|
||||
put:
|
||||
summary: Load TIFF image for internal FPGA generator
|
||||
description: |
|
||||
Load image for internal FPGA generator. This can only happen in Idle state of the detector.
|
||||
Requires TIFF with 16-bit integer numbers of size of detector in raw/converted coordinates
|
||||
(depending on detector settings).
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: Image ID to upload
|
||||
required: false
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
maximum: 127
|
||||
requestBody:
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
"200":
|
||||
description: Everything OK
|
||||
"400":
|
||||
description: Input parsing or validation error
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
description: Exception error
|
||||
/config/select_detector:
|
||||
put:
|
||||
summary: Select detector
|
||||
@@ -1441,17 +1547,6 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/plots'
|
||||
/plot/resolution_estimate_histogram:
|
||||
get:
|
||||
summary: Generate resolution estimate histogram
|
||||
description: Generate histogram of crystal resolutions from 1.0 to 5.0 A based on ML model
|
||||
responses:
|
||||
"200":
|
||||
description: Everything OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/plots'
|
||||
/plot/rad_int:
|
||||
get:
|
||||
summary: Generate radial integration profile
|
||||
@@ -1569,6 +1664,63 @@ paths:
|
||||
format: binary
|
||||
"404":
|
||||
description: No preview image recorded so far
|
||||
/config/mask.tiff:
|
||||
get:
|
||||
summary: Get mask of the detector
|
||||
description: |
|
||||
Get full pixel mask of the detector
|
||||
See NXmx standard for meaning of pixel values
|
||||
responses:
|
||||
"200":
|
||||
description: Pixel mask in TIFF format (4 byte; unsigned)
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
/config/user_mask.tiff:
|
||||
get:
|
||||
summary: Get user mask of the detector
|
||||
description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked"
|
||||
responses:
|
||||
"200":
|
||||
description: User mask in TIFF format (4 byte; unsigned)
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
put:
|
||||
summary: Upload user mask of the detector
|
||||
description: |
|
||||
Should be in `Idle` state.
|
||||
Upload user mask of the detector - this is for example to account for beam stop shadow or misbehaving regions.
|
||||
If detector is conversion mode the mask can be both in raw (1024x512; stacked modules) or converted coordinates.
|
||||
In the latter case - module gaps are ignored and don't need to be assigned value.
|
||||
Mask is expected as TIFF (4-byte; unsigned).
|
||||
0 - good pixel, other value - masked
|
||||
User mask is stored in NXmx pixel mask (bit 8), as well as used in spot finding and azimuthal integration.
|
||||
User mask is not automatically applied - i.e. pixels with user mask will have a valid pixel value in the images.
|
||||
requestBody:
|
||||
content:
|
||||
application/octet-stream:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
responses:
|
||||
"200":
|
||||
description: All good
|
||||
content:
|
||||
image/tiff:
|
||||
schema:
|
||||
type: string
|
||||
format: binary
|
||||
"500":
|
||||
description: Error within Jungfraujoch code - see output message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/error_message'
|
||||
/preview/pedestal.tiff:
|
||||
get:
|
||||
parameters:
|
||||
@@ -1593,4 +1745,14 @@ paths:
|
||||
type: string
|
||||
format: binary
|
||||
"404":
|
||||
description: No calibration recorded so far
|
||||
description: No calibration recorded so far
|
||||
/version:
|
||||
get:
|
||||
responses:
|
||||
"200":
|
||||
description: Release number of Jungfraujoch
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
example: 1.0.0
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Using OpenAPI licensed with Apache License 2.0
|
||||
|
||||
#include <vector>
|
||||
#include <signal.h>
|
||||
#include <csignal>
|
||||
#include <fstream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "JFJochBrokerHttp.h"
|
||||
|
||||
#include "JFJochBrokerParser.h"
|
||||
#include "../frame_serialize/ZMQStream2PusherGroup.h"
|
||||
#include "../frame_serialize/DumpCBORToFilePusher.h"
|
||||
|
||||
static Pistache::Http::Endpoint *httpEndpoint;
|
||||
|
||||
@@ -73,8 +71,6 @@ int main (int argc, char **argv) {
|
||||
std::unique_ptr<JFJochReceiverService> receiver;
|
||||
std::unique_ptr<ImagePusher> image_pusher;
|
||||
|
||||
ZMQContext context;
|
||||
|
||||
DiffractionExperiment experiment;
|
||||
experiment.MaskChipEdges(true).MaskModuleEdges(true);
|
||||
|
||||
@@ -83,19 +79,7 @@ int main (int argc, char **argv) {
|
||||
if (aq_devices.size() > 0) {
|
||||
experiment.DataStreams(aq_devices.size());
|
||||
|
||||
std::string pusher_type = ParseString(input, "stream_type", "zmq");
|
||||
if (pusher_type == "zmq") {
|
||||
int32_t zmq_send_watermark = ParseInt32(input, "zmq_send_watermark", 100);
|
||||
int32_t zmq_send_buffer_size = ParseInt32(input, "zmq_send_buffer_size", -1);
|
||||
|
||||
image_pusher = std::make_unique<ZMQStream2PusherGroup>(ParseStringArray(input, "zmq_image_addr"),
|
||||
zmq_send_watermark,
|
||||
zmq_send_buffer_size);
|
||||
} else if (pusher_type == "dump_cbor") {
|
||||
image_pusher = std::make_unique<DumpCBORToFilePusher>();
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"stream_type allowed: zmq (default), dump_cbor");
|
||||
ParseImagePusher(input, image_pusher);
|
||||
|
||||
int32_t send_buffer_size_MiB = ParseInt32(input, "send_buffer_size_MiB", 2048);
|
||||
receiver = std::make_unique<JFJochReceiverService>(aq_devices, logger, *image_pusher, send_buffer_size_MiB);
|
||||
@@ -111,9 +95,9 @@ int main (int argc, char **argv) {
|
||||
|
||||
logger.Info("Source {} Instrument {} Default rotation axis {:.2f},{:.2f},{:.2f}",
|
||||
experiment.GetSourceName(), experiment.GetInstrumentName(),
|
||||
experiment.GetDefaultOmegaAxis().x,
|
||||
experiment.GetDefaultOmegaAxis().y,
|
||||
experiment.GetDefaultOmegaAxis().z);
|
||||
experiment.GetDefaultRotationAxis().x,
|
||||
experiment.GetDefaultRotationAxis().y,
|
||||
experiment.GetDefaultRotationAxis().z);
|
||||
|
||||
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(http_port));
|
||||
|
||||
|
||||
Submodule broker/pistache deleted from 51553b92cc
File diff suppressed because one or more lines are too long
@@ -1,27 +0,0 @@
|
||||
#From: https://github.com/zeromq/cppzmq/
|
||||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_LIBZMQ QUIET libzmq)
|
||||
|
||||
set(ZeroMQ_VERSION ${PC_LIBZMQ_VERSION})
|
||||
find_library(ZeroMQ_LIBRARY NAMES libzmq.so libzmq.dylib libzmq.dll
|
||||
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
||||
find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
|
||||
PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})
|
||||
|
||||
if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
|
||||
set(ZeroMQ_FOUND ON)
|
||||
endif()
|
||||
|
||||
if (TARGET libzmq)
|
||||
# avoid errors defining targets twice
|
||||
return()
|
||||
endif()
|
||||
|
||||
add_library(libzmq SHARED IMPORTED)
|
||||
set_property(TARGET libzmq PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq PROPERTY IMPORTED_LOCATION ${ZeroMQ_LIBRARY})
|
||||
|
||||
add_library(libzmq-static STATIC IMPORTED ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq-static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${PC_LIBZMQ_INCLUDE_DIRS})
|
||||
set_property(TARGET libzmq-static PROPERTY IMPORTED_LOCATION ${ZeroMQ_STATIC_LIBRARY})
|
||||
@@ -16,19 +16,26 @@ EXECUTE_PROCESS(COMMAND
|
||||
OUTPUT_VARIABLE GIT_DATE
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
MESSAGE(STATUS "Git SHA1: ${GIT_SHA1}")
|
||||
MESSAGE(STATUS "Git date: ${GIT_DATE}")
|
||||
FILE(STRINGS ../VERSION PACKAGE_VERSION)
|
||||
MESSAGE(STATUS "Jungfraujoch git SHA1: ${GIT_SHA1}")
|
||||
MESSAGE(STATUS "Jungfraujoch git date: ${GIT_DATE}")
|
||||
MESSAGE(STATUS "Jungfraujoch version: ${PACKAGE_VERSION}")
|
||||
|
||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/GitInfo.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp" @ONLY)
|
||||
|
||||
ADD_LIBRARY( JFJochCommon STATIC
|
||||
ADD_LIBRARY(JFJochLogger STATIC
|
||||
Logger.cpp Logger.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp GitInfo.h
|
||||
)
|
||||
|
||||
ADD_LIBRARY(JFJochZMQ STATIC ZMQWrappers.cpp ZMQWrappers.h)
|
||||
|
||||
ADD_LIBRARY(JFJochCommon STATIC
|
||||
Coord.cpp Coord.h
|
||||
DiffractionExperiment.cpp DiffractionExperiment.h
|
||||
RawToConvertedGeometry.h
|
||||
JFJochException.h
|
||||
Definitions.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/GitInfo.cpp GitInfo.h
|
||||
ThreadSafeFIFO.h
|
||||
DiffractionSpot.cpp DiffractionSpot.h
|
||||
StatusVector.h
|
||||
@@ -43,7 +50,6 @@ ADD_LIBRARY( JFJochCommon STATIC
|
||||
RawToConvertedGeometryCore.h
|
||||
Plot.h
|
||||
../fpga/pcie_driver/jfjoch_fpga.h
|
||||
ZMQWrappers.cpp ZMQWrappers.h
|
||||
DatasetSettings.cpp DatasetSettings.h
|
||||
ROIMap.cpp ROIMap.h
|
||||
ROIElement.cpp ROIElement.h
|
||||
@@ -55,7 +61,9 @@ ADD_LIBRARY( JFJochCommon STATIC
|
||||
PixelMask.cpp PixelMask.h
|
||||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochCommon Compression JFCalibration "$<BUILD_INTERFACE:libzmq-static>" -lrt)
|
||||
TARGET_LINK_LIBRARIES(JFJochCommon JFJochLogger Compression JFCalibration -lrt)
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochZMQ "$<BUILD_INTERFACE:libzmq-static>")
|
||||
|
||||
IF (CMAKE_CUDA_COMPILER)
|
||||
TARGET_SOURCES(JFJochCommon PRIVATE CUDAWrapper.cu )
|
||||
|
||||
@@ -17,8 +17,11 @@ int32_t get_gpu_count() {
|
||||
void set_gpu(int32_t dev_id) {
|
||||
auto dev_count = get_gpu_count();
|
||||
|
||||
if ((dev_id < 0) || (dev_id >= dev_count))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Device ID cannot be negative");
|
||||
// Ignore if no GPU present
|
||||
if (dev_count > 0) {
|
||||
if ((dev_id < 0) || (dev_id >= dev_count))
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Device ID cannot be negative");
|
||||
|
||||
cuda_err(cudaSetDevice(dev_id));
|
||||
}
|
||||
cuda_err(cudaSetDevice(dev_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,10 @@ DatasetSettings::DatasetSettings() {
|
||||
file_prefix = "test";
|
||||
ntrigger = 1;
|
||||
images_per_trigger = 1;
|
||||
summation = 1;
|
||||
fpga_pixel_output = FPGAPixelOutput::Auto;
|
||||
space_group_number = 0; // not set
|
||||
compression = CompressionAlgorithm::BSHUF_LZ4;
|
||||
photon_energy_multiplier = 1.0f;
|
||||
omega_start = 0.0f;
|
||||
images_per_file = 1000;
|
||||
data_reduction_factor_serialmx = 1.0;
|
||||
}
|
||||
@@ -151,40 +149,34 @@ DatasetSettings &DatasetSettings::TotalFlux(const std::optional<float> &input) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::OmegaStep(const std::optional<float> &input) {
|
||||
DatasetSettings &DatasetSettings::Goniometer(const std::optional<GoniometerAxis> &input) {
|
||||
if (input) {
|
||||
check_finite("Omega step", input.value());
|
||||
check_finite("Rotation angle increment", input->increment);
|
||||
if (input->increment == 0.0f)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Angle increment cannot be zero");
|
||||
check_finite("Rotation angle start", input->start);
|
||||
goniometer = input;
|
||||
}
|
||||
|
||||
if (input && (input == 0.0f))
|
||||
omega_step.reset();
|
||||
else
|
||||
omega_step = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::OmegaStart(float input) {
|
||||
check_finite("Omega start", input);
|
||||
omega_start = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::OmegaAxis(const std::optional<Coord> &c) {
|
||||
DatasetSettings &DatasetSettings::RotationAxis(const std::optional<Coord> &c) {
|
||||
if (c) {
|
||||
if (c->Length() == 0.0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Cannot use empty vector for omega");
|
||||
omega_rotation_axis = c->Normalize();
|
||||
rotation_axis = c->Normalize();
|
||||
} else
|
||||
omega_rotation_axis = c;
|
||||
rotation_axis = c;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::HeaderAppendix(const std::string &input) {
|
||||
DatasetSettings &DatasetSettings::HeaderAppendix(const nlohmann::json &input) {
|
||||
header_appendix = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::ImageAppendix(const std::string &input) {
|
||||
DatasetSettings &DatasetSettings::ImageAppendix(const nlohmann::json &input) {
|
||||
image_appendix = input;
|
||||
return *this;
|
||||
}
|
||||
@@ -198,13 +190,6 @@ DatasetSettings &DatasetSettings::PhotonEnergyMultiplayer(float input) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::Summation(int64_t input) {
|
||||
check_min("Summation", input, 1);
|
||||
check_max("Summation", input, MAX_FPGA_SUMMATION);
|
||||
summation = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::FPGAOutputMode(FPGAPixelOutput input) {
|
||||
switch (input) {
|
||||
case FPGAPixelOutput::Auto:
|
||||
@@ -228,23 +213,19 @@ std::optional<float> DatasetSettings::GetTotalFlux() const {
|
||||
return total_flux;
|
||||
}
|
||||
|
||||
std::optional<float> DatasetSettings::GetOmegaStep() const {
|
||||
return omega_step;
|
||||
std::optional<GoniometerAxis> DatasetSettings::GetGoniometer() const {
|
||||
return goniometer;
|
||||
}
|
||||
|
||||
float DatasetSettings::GetOmegaStart() const {
|
||||
return omega_start;
|
||||
std::optional<Coord> DatasetSettings::GetRotationAxis() const {
|
||||
return rotation_axis;
|
||||
}
|
||||
|
||||
std::optional<Coord> DatasetSettings::GetOmegaAxis() const {
|
||||
return omega_rotation_axis;
|
||||
}
|
||||
|
||||
std::string DatasetSettings::GetHeaderAppendix() const {
|
||||
const nlohmann::json& DatasetSettings::GetHeaderAppendix() const {
|
||||
return header_appendix;
|
||||
}
|
||||
|
||||
std::string DatasetSettings::GetImageAppendix() const {
|
||||
const nlohmann::json& DatasetSettings::GetImageAppendix() const {
|
||||
return image_appendix;
|
||||
}
|
||||
|
||||
@@ -260,10 +241,6 @@ int64_t DatasetSettings::GetSpaceGroupNumber() const {
|
||||
return space_group_number;
|
||||
}
|
||||
|
||||
int64_t DatasetSettings::GetSummation() const {
|
||||
return summation;
|
||||
}
|
||||
|
||||
FPGAPixelOutput DatasetSettings::GetFPGAOutputMode() const {
|
||||
return fpga_pixel_output;
|
||||
}
|
||||
@@ -332,3 +309,49 @@ DatasetSettings &DatasetSettings::DataReductionFactorSerialMX(float input) {
|
||||
float DatasetSettings::GetDataReductionFactorSerialMX() const {
|
||||
return data_reduction_factor_serialmx;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::RunNumber(const std::optional<uint64_t> &input) {
|
||||
if (input) {
|
||||
check_min("Run number", input, 0);
|
||||
check_max("Run number", input, INT64_MAX);
|
||||
}
|
||||
run_number = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings & DatasetSettings::RunName(const std::optional<std::string> &input) {
|
||||
if (input && input.value().empty())
|
||||
run_name = {};
|
||||
else
|
||||
run_name = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::ExperimentGroup(const std::string &input) {
|
||||
group = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::optional<uint64_t> DatasetSettings::GetRunNumber() const {
|
||||
return run_number;
|
||||
}
|
||||
|
||||
std::optional<std::string> DatasetSettings::GetRunName() const {
|
||||
return run_name;
|
||||
}
|
||||
|
||||
std::string DatasetSettings::GetExperimentGroup() const {
|
||||
return group;
|
||||
}
|
||||
|
||||
std::optional<std::chrono::microseconds> DatasetSettings::GetImageTime() const {
|
||||
return image_time;
|
||||
}
|
||||
|
||||
DatasetSettings &DatasetSettings::ImageTime(const std::optional<std::chrono::microseconds> input) {
|
||||
if (input && (input.value().count() == 0))
|
||||
image_time = {};
|
||||
else
|
||||
image_time = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ class DatasetSettings {
|
||||
int64_t ntrigger;
|
||||
|
||||
FPGAPixelOutput fpga_pixel_output;
|
||||
int64_t summation;
|
||||
|
||||
float beam_x_pxl;
|
||||
float beam_y_pxl;
|
||||
@@ -40,14 +39,18 @@ class DatasetSettings {
|
||||
|
||||
std::optional<float> total_flux;
|
||||
std::optional<float> attenuator_transmission;
|
||||
std::optional<float> omega_step;
|
||||
float omega_start;
|
||||
std::string image_appendix;
|
||||
std::string header_appendix;
|
||||
std::optional<GoniometerAxis> goniometer;
|
||||
nlohmann::json image_appendix;
|
||||
nlohmann::json header_appendix;
|
||||
|
||||
std::optional<Coord> omega_rotation_axis;
|
||||
std::optional<Coord> rotation_axis;
|
||||
|
||||
float data_reduction_factor_serialmx;
|
||||
|
||||
std::optional<std::chrono::microseconds> image_time;
|
||||
std::optional<uint64_t> run_number;
|
||||
std::optional<std::string> run_name;
|
||||
std::string group;
|
||||
public:
|
||||
|
||||
DatasetSettings();
|
||||
@@ -65,28 +68,28 @@ public:
|
||||
DatasetSettings& SampleName(std::string input);
|
||||
DatasetSettings& AttenuatorTransmission(const std::optional<float> &input);
|
||||
DatasetSettings& TotalFlux(const std::optional<float> &input);
|
||||
DatasetSettings& OmegaStep(const std::optional<float> &input);
|
||||
DatasetSettings& OmegaStart(float input);
|
||||
DatasetSettings& OmegaAxis(const std::optional<Coord> &c);
|
||||
DatasetSettings& HeaderAppendix(const std::string& input);
|
||||
DatasetSettings& ImageAppendix(const std::string& input);
|
||||
DatasetSettings& Goniometer(const std::optional<GoniometerAxis>& input);
|
||||
DatasetSettings& RotationAxis(const std::optional<Coord> &c);
|
||||
DatasetSettings& HeaderAppendix(const nlohmann::json& input);
|
||||
DatasetSettings& ImageAppendix(const nlohmann::json& input);
|
||||
DatasetSettings& PhotonEnergyMultiplayer(float input);
|
||||
DatasetSettings& Summation(int64_t input);
|
||||
DatasetSettings& FPGAOutputMode(FPGAPixelOutput input);
|
||||
DatasetSettings& ImagesPerFile(int64_t input);
|
||||
DatasetSettings& DataReductionFactorSerialMX(float input);
|
||||
DatasetSettings& RunNumber(const std::optional<uint64_t> &run_number);
|
||||
DatasetSettings& RunName(const std::optional<std::string> &input);
|
||||
DatasetSettings& ExperimentGroup(const std::string &group);
|
||||
DatasetSettings& ImageTime(const std::optional<std::chrono::microseconds> input);
|
||||
|
||||
std::optional<float> GetAttenuatorTransmission() const;
|
||||
std::optional<float> GetTotalFlux() const;
|
||||
std::optional<float> GetOmegaStep() const;
|
||||
float GetOmegaStart() const;
|
||||
std::optional<Coord> GetOmegaAxis() const;
|
||||
std::string GetHeaderAppendix() const;
|
||||
std::string GetImageAppendix() const;
|
||||
std::optional<GoniometerAxis> GetGoniometer() const;
|
||||
std::optional<Coord> GetRotationAxis() const;
|
||||
const nlohmann::json& GetHeaderAppendix() const;
|
||||
const nlohmann::json& GetImageAppendix() const;
|
||||
float GetPhotonEnergyMultiplier() const;
|
||||
std::optional<UnitCell> GetUnitCell() const;
|
||||
int64_t GetSpaceGroupNumber() const;
|
||||
int64_t GetSummation() const;
|
||||
FPGAPixelOutput GetFPGAOutputMode() const;
|
||||
std::string GetSampleName() const;
|
||||
float GetPhotonEnergy_keV() const;
|
||||
@@ -104,6 +107,11 @@ public:
|
||||
int64_t GetImageNumPerTrigger() const;
|
||||
int64_t GetImagesPerFile() const;
|
||||
float GetDataReductionFactorSerialMX() const;
|
||||
|
||||
std::optional<uint64_t> GetRunNumber() const;
|
||||
std::optional<std::string> GetRunName() const;
|
||||
std::string GetExperimentGroup() const;
|
||||
std::optional<std::chrono::microseconds> GetImageTime() const;
|
||||
};
|
||||
|
||||
#endif //JUNGFRAUJOCH_DATASETSETTINGS_H
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
#define CONVERTED_MODULE_SIZE (CONVERTED_MODULE_LINES * CONVERTED_MODULE_COLS)
|
||||
#define JUNGFRAU_PACKET_SIZE_BYTES (8192)
|
||||
|
||||
#define MIN_COUNT_TIME_IN_US 5
|
||||
#define MIN_FRAME_TIME_HALF_SPEED_IN_US 1000
|
||||
#define MIN_FRAME_TIME_FULL_SPEED_IN_US 470
|
||||
#define MAX_FRAME_TIME 2000
|
||||
|
||||
#define MAX_COUNT_TIME_IN_US 1980
|
||||
#define MIN_COUNT_TIME_IN_US 3
|
||||
|
||||
#define MIN_STORAGE_CELL_DELAY_IN_NS 2100
|
||||
#define READOUT_TIME_IN_US 20
|
||||
|
||||
|
||||
@@ -148,3 +148,12 @@ void DetectorSetup::SetTrimFiles(const std::vector<std::string> &filenames) {
|
||||
const std::vector<std::string> &DetectorSetup::GetTrimFileNames() const {
|
||||
return trim_file_names;
|
||||
}
|
||||
|
||||
std::string DetectorSetup::GetSerialNumber() const {
|
||||
return serial_number;
|
||||
}
|
||||
|
||||
DetectorSetup &DetectorSetup::SerialNumber(const std::string &input) {
|
||||
serial_number = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ enum class DetectorType {EIGER, JUNGFRAU};
|
||||
|
||||
class DetectorSetup {
|
||||
std::string description;
|
||||
std::string serial_number;
|
||||
DetectorGeometry geometry;
|
||||
std::vector<std::string> det_modules_hostname;
|
||||
std::vector<std::string> gain_file_names;
|
||||
@@ -41,6 +42,7 @@ public:
|
||||
DetectorSetup& SensorThickness_um(float input);
|
||||
DetectorSetup& PixelSize_um(float input);
|
||||
DetectorSetup& HighVoltage(int32_t input);
|
||||
DetectorSetup& SerialNumber(const std::string &input);
|
||||
|
||||
[[nodiscard]] DetectorType GetDetectorType() const;
|
||||
[[nodiscard]] const DetectorGeometry& GetGeometry() const;
|
||||
@@ -56,6 +58,7 @@ public:
|
||||
[[nodiscard]] const std::vector<std::string> &GetGainFileNames() const;
|
||||
[[nodiscard]] const std::vector<std::string> &GetTrimFileNames() const;
|
||||
[[nodiscard]] int32_t GetHighVoltage() const;
|
||||
[[nodiscard]] std::string GetSerialNumber() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "JFJochException.h"
|
||||
#include "RawToConvertedGeometry.h"
|
||||
#include "../fpga/pcie_driver/jfjoch_fpga.h"
|
||||
#include "../include/spdlog/fmt/fmt.h"
|
||||
#include "GitInfo.h"
|
||||
|
||||
using namespace std::literals::chrono_literals;
|
||||
|
||||
@@ -28,8 +30,6 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup)
|
||||
internal_fpga_packet_generator = false;
|
||||
internal_fpga_packet_generator_images = 1;
|
||||
|
||||
debug_pixel_mask = false;
|
||||
|
||||
ndatastreams = 1;
|
||||
|
||||
frame_time = std::chrono::microseconds(MIN_FRAME_TIME_HALF_SPEED_IN_US);
|
||||
@@ -67,6 +67,8 @@ DiffractionExperiment::DiffractionExperiment(const DetectorSetup& det_setup)
|
||||
mode = DetectorMode::Conversion;
|
||||
|
||||
max_spot_count = MAX_SPOT_COUNT;
|
||||
|
||||
summation = 1;
|
||||
}
|
||||
|
||||
// setter functions
|
||||
@@ -101,10 +103,13 @@ DiffractionExperiment &DiffractionExperiment::NumTriggers(int64_t input) {
|
||||
DiffractionExperiment &DiffractionExperiment::FrameTime(std::chrono::microseconds in_frame_time,
|
||||
std::chrono::microseconds in_count_time) {
|
||||
check_min("Frame time (us)", in_frame_time.count(), MIN_FRAME_TIME_FULL_SPEED_IN_US);
|
||||
check_max("Frame time (us)", in_frame_time.count(), MAX_FRAME_TIME);
|
||||
check_max("Count time (us)", in_count_time.count(), in_frame_time.count() - READOUT_TIME_IN_US);
|
||||
if (in_count_time.count() != 0) {
|
||||
check_min("Count time (us)", in_count_time.count(), MIN_COUNT_TIME_IN_US);
|
||||
check_max("Count time (us)", in_count_time.count(), MAX_COUNT_TIME_IN_US);
|
||||
} else {
|
||||
check_max("Count time (us)", in_frame_time.count() - READOUT_TIME_IN_US,
|
||||
MAX_COUNT_TIME_IN_US);
|
||||
}
|
||||
|
||||
frame_time = in_frame_time;
|
||||
@@ -597,6 +602,20 @@ std::optional<UnitCell> DiffractionExperiment::GetUnitCell() const {
|
||||
return dataset.GetUnitCell();
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetUnitCellString() const {
|
||||
auto uc = dataset.GetUnitCell();
|
||||
if (uc.has_value()) {
|
||||
return fmt::format("{:.1f}, {:.1f}, {:.1f}, {:.1f}, {:.1f} {:.1f}",
|
||||
uc.value().a,
|
||||
uc.value().b,
|
||||
uc.value().c,
|
||||
uc.value().alpha,
|
||||
uc.value().beta,
|
||||
uc.value().gamma);
|
||||
} else
|
||||
return "-";
|
||||
}
|
||||
|
||||
Coord DiffractionExperiment::LabCoord(float detector_x, float detector_y) const {
|
||||
// Assumes planar detector, 90 deg towards beam
|
||||
return {(detector_x - GetBeamX_pxl()) * GetPixelSize_mm() ,
|
||||
@@ -669,6 +688,7 @@ void DiffractionExperiment::CheckDataProcessingSettings(const SpotFindingSetting
|
||||
check_min("Spot finding low resolution limit", settings.low_resolution_limit, 1.0);
|
||||
check_max("Spot finding low resolution limit", settings.low_resolution_limit, 50.0);
|
||||
}
|
||||
check_min("min spot count for powder ring detection", settings.min_spot_count_powder_ring, 5);
|
||||
check_min("indexing tolerance", settings.indexing_tolerance, 0.0);
|
||||
check_max("indexing tolerance", settings.indexing_tolerance, 1.0);
|
||||
}
|
||||
@@ -715,6 +735,7 @@ void DiffractionExperiment::FillMessage(StartMessage &message) const {
|
||||
|
||||
message.source_name = GetSourceName();
|
||||
message.source_name_short = GetSourceNameShort();
|
||||
message.source_type = GetSourceType();
|
||||
|
||||
message.instrument_name = GetInstrumentName();
|
||||
message.instrument_name_short = GetInstrumentNameShort();
|
||||
@@ -724,19 +745,26 @@ void DiffractionExperiment::FillMessage(StartMessage &message) const {
|
||||
message.countrate_correction_enabled = false;
|
||||
message.flatfield_enabled = false;
|
||||
|
||||
if (GetOmegaStep())
|
||||
message.omega = GoniometerAxis{.increment = GetOmegaStep().value(), .start = GetOmegaStart(),
|
||||
.axis = {GetOmegaAxis().x, GetOmegaAxis().y, GetOmegaAxis().z}};
|
||||
else
|
||||
message.omega = GoniometerAxis{.increment = 0.0f};
|
||||
auto goniometer = dataset.GetGoniometer();
|
||||
if (goniometer) {
|
||||
message.goniometer = goniometer;
|
||||
message.rotation_axis[0] = GetRotationAxis().x;
|
||||
message.rotation_axis[1] = GetRotationAxis().y;
|
||||
message.rotation_axis[2] = GetRotationAxis().z;
|
||||
}
|
||||
|
||||
message.series_id = GetSeriesID();
|
||||
message.series_unique_id = GetSeriesIDString();
|
||||
message.run_number = GetRunNumber();
|
||||
message.run_name = GetRunName();
|
||||
|
||||
message.gain_file_names = detector.GetGainFileNames();
|
||||
|
||||
for (const auto &[x, y]: roi_mask.GetROINameMap())
|
||||
message.roi_names.emplace_back(x);
|
||||
|
||||
message.data_reduction_factor_serialmx = GetDataReductionFactorSerialMX();
|
||||
message.experiment_group = dataset.GetExperimentGroup();
|
||||
message.jfjoch_release = jfjoch_version();
|
||||
message.detector_serial_number = detector.GetSerialNumber();
|
||||
}
|
||||
|
||||
float DiffractionExperiment::GetPixelSize_mm() const {
|
||||
@@ -753,6 +781,11 @@ DiffractionExperiment &DiffractionExperiment::SourceNameShort(std::string input)
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::SourceType(std::string input) {
|
||||
source_type = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::InstrumentName(std::string input) {
|
||||
instrument_name = input;
|
||||
return *this;
|
||||
@@ -771,6 +804,10 @@ std::string DiffractionExperiment::GetSourceNameShort() const {
|
||||
return source_name_short;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetSourceType() const {
|
||||
return source_type;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetInstrumentName() const {
|
||||
return instrument_name;
|
||||
}
|
||||
@@ -848,7 +885,9 @@ std::chrono::nanoseconds DiffractionExperiment::GetStorageCellDelay() const {
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::Summation(int64_t input) {
|
||||
dataset.Summation(input);
|
||||
check_min("Summation factor", input, 1);
|
||||
check_max("Summation factor", input, MAX_FPGA_SUMMATION);
|
||||
summation = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -864,7 +903,7 @@ int64_t DiffractionExperiment::GetSummation() const {
|
||||
if (GetStorageCellNumber() > 1)
|
||||
return 1;
|
||||
else
|
||||
return dataset.GetSummation();
|
||||
return summation;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,22 +972,13 @@ std::optional<float> DiffractionExperiment::GetTotalFlux() const {
|
||||
return dataset.GetTotalFlux();
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::OmegaStep(const std::optional<float> &input) {
|
||||
dataset.OmegaStep(input);
|
||||
DiffractionExperiment &DiffractionExperiment::Goniometer(const std::optional<GoniometerAxis> &input) {
|
||||
dataset.Goniometer(input);
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::OmegaStart(float input) {
|
||||
dataset.OmegaStart(input);
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::optional<float> DiffractionExperiment::GetOmegaStep() const {
|
||||
return dataset.GetOmegaStep();
|
||||
}
|
||||
|
||||
float DiffractionExperiment::GetOmegaStart() const {
|
||||
return dataset.GetOmegaStart();
|
||||
std::optional<GoniometerAxis> DiffractionExperiment::GetGoniometer() const {
|
||||
return dataset.GetGoniometer();
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::UsingGainHG0(bool input) {
|
||||
@@ -969,63 +999,64 @@ bool DiffractionExperiment::IsUsingGainHG0() const {
|
||||
return use_gain_hg0;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::HeaderAppendix(const std::string &input) {
|
||||
DiffractionExperiment &DiffractionExperiment::HeaderAppendix(const nlohmann::json &input) {
|
||||
dataset.HeaderAppendix(input);
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::ImageAppendix(const std::string &input) {
|
||||
DiffractionExperiment &DiffractionExperiment::ImageAppendix(const nlohmann::json &input) {
|
||||
dataset.ImageAppendix(input);
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetHeaderAppendix() const {
|
||||
const nlohmann::json& DiffractionExperiment::GetHeaderAppendix() const {
|
||||
return dataset.GetHeaderAppendix();
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetImageAppendix() const {
|
||||
const nlohmann::json& DiffractionExperiment::GetImageAppendix() const {
|
||||
return dataset.GetImageAppendix();
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::OmegaAxis(const Coord &c) {
|
||||
dataset.OmegaAxis(c);
|
||||
DiffractionExperiment &DiffractionExperiment::RotationAxis(const std::optional<Coord> &c) {
|
||||
dataset.RotationAxis(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::OmegaAxis() {
|
||||
dataset.OmegaAxis({});
|
||||
return *this;
|
||||
}
|
||||
|
||||
Coord DiffractionExperiment::GetOmegaAxis() const {
|
||||
auto tmp = dataset.GetOmegaAxis();
|
||||
Coord DiffractionExperiment::GetRotationAxis() const {
|
||||
auto tmp = dataset.GetRotationAxis();
|
||||
if (tmp)
|
||||
return tmp.value();
|
||||
else
|
||||
return default_omega_axis;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::DefaultOmegaAxis(const Coord &c) {
|
||||
DiffractionExperiment &DiffractionExperiment::DefaultRotationAxis(const Coord &c) {
|
||||
if (c.Length() == 0.0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Cannot use empty vector for omega axis");
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Cannot use empty vector for goniometer axis");
|
||||
|
||||
default_omega_axis = c.Normalize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Coord DiffractionExperiment::GetDefaultOmegaAxis() const {
|
||||
Coord DiffractionExperiment::GetDefaultRotationAxis() const {
|
||||
return default_omega_axis;
|
||||
}
|
||||
|
||||
uint64_t DiffractionExperiment::GetSeriesID() const {
|
||||
uint64_t DiffractionExperiment::GetRunNumber() const {
|
||||
if (dataset.GetRunNumber())
|
||||
return dataset.GetRunNumber().value();
|
||||
return series_id;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetSeriesIDString() const {
|
||||
return std::to_string(series_id) + ": " + dataset.GetFilePrefix();
|
||||
std::string DiffractionExperiment::GetRunName() const {
|
||||
auto run_name = dataset.GetRunName();
|
||||
if (run_name)
|
||||
return run_name.value();
|
||||
else
|
||||
return std::to_string(series_id) + ":" + dataset.GetFilePrefix();
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::IncrementSeriesID() {
|
||||
DiffractionExperiment &DiffractionExperiment::IncrementRunNumber() {
|
||||
series_id++;
|
||||
return *this;
|
||||
}
|
||||
@@ -1052,6 +1083,7 @@ bool DiffractionExperiment::IsConversionOnFPGA() const {
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::DetectorDelay(std::chrono::nanoseconds input) {
|
||||
check_min("Detector delay (us)", input.count(), 0);
|
||||
detector_delay = input;
|
||||
return *this;
|
||||
}
|
||||
@@ -1064,15 +1096,6 @@ const DetectorSetup &DiffractionExperiment::GetDetectorSetup() const {
|
||||
return detector;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::NeuralNetModelPath(const std::string &input) {
|
||||
neural_net_model_path = input;
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetNeuralNetModelPath() const {
|
||||
return neural_net_model_path;
|
||||
}
|
||||
|
||||
DiffractionExperiment &DiffractionExperiment::PulsedSource(bool input) {
|
||||
pulsed_source = input;
|
||||
return *this;
|
||||
@@ -1120,6 +1143,19 @@ int64_t DiffractionExperiment::GetInternalPacketGeneratorImages() const {
|
||||
DiffractionExperiment &DiffractionExperiment::ImportDatasetSettings(const DatasetSettings &input) {
|
||||
auto tmp = dataset;
|
||||
dataset = input;
|
||||
|
||||
auto image_time = input.GetImageTime();
|
||||
if (image_time) {
|
||||
if (image_time->count() % GetFrameTime().count() != 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Image time must be multiple of frame time");
|
||||
if (GetFrameTime().count() == 0)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Frame time cannot be zero");
|
||||
this->Summation(image_time.value() / GetFrameTime());
|
||||
} else
|
||||
summation = 1;
|
||||
|
||||
if (GetFrameNum() >= MAX_FRAMES) {
|
||||
dataset = tmp;
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
@@ -1177,3 +1213,7 @@ DiffractionExperiment &DiffractionExperiment::DataReductionFactorSerialMX(float
|
||||
dataset.DataReductionFactorSerialMX(input);
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string DiffractionExperiment::GetExperimentGroup() const {
|
||||
return dataset.GetExperimentGroup();
|
||||
}
|
||||
|
||||
@@ -78,19 +78,17 @@ class DiffractionExperiment {
|
||||
|
||||
std::string source_name;
|
||||
std::string source_name_short;
|
||||
std::string source_type;
|
||||
std::string instrument_name;
|
||||
std::string instrument_name_short;
|
||||
bool pulsed_source;
|
||||
|
||||
bool debug_pixel_mask;
|
||||
Coord default_omega_axis;
|
||||
|
||||
bool conversion_on_fpga;
|
||||
|
||||
uint64_t series_id;
|
||||
|
||||
std::string neural_net_model_path;
|
||||
|
||||
bool rad_int_solid_angle_corr;
|
||||
bool rad_int_polarization_corr;
|
||||
float rad_int_polarization_factor{};
|
||||
@@ -100,6 +98,10 @@ class DiffractionExperiment {
|
||||
ROIMap roi_mask;
|
||||
|
||||
int64_t max_spot_count;
|
||||
|
||||
int64_t summation;
|
||||
|
||||
std::string detector_update_zmq_addr;
|
||||
public:
|
||||
// Public methods are atomic
|
||||
DiffractionExperiment();
|
||||
@@ -135,16 +137,16 @@ public:
|
||||
DiffractionExperiment& StorageCellStart(int64_t input = 15);
|
||||
|
||||
DiffractionExperiment& SourceName(std::string input);
|
||||
DiffractionExperiment& SourceType(std::string input);
|
||||
DiffractionExperiment& SourceNameShort(std::string input);
|
||||
DiffractionExperiment& InstrumentName(std::string input);
|
||||
DiffractionExperiment& InstrumentNameShort(std::string input);
|
||||
DiffractionExperiment& DefaultOmegaAxis(const Coord &c);
|
||||
DiffractionExperiment& DefaultRotationAxis(const Coord &c);
|
||||
|
||||
DiffractionExperiment& UsingGainHG0(bool input);
|
||||
DiffractionExperiment& FixedGainG1(bool input);
|
||||
DiffractionExperiment& IncrementSeriesID();
|
||||
DiffractionExperiment& IncrementRunNumber();
|
||||
DiffractionExperiment& ConversionOnFPGA(bool input);
|
||||
DiffractionExperiment& NeuralNetModelPath(const std::string& input);
|
||||
DiffractionExperiment& PulsedSource(bool input);
|
||||
|
||||
DiffractionExperiment& ImagesPerTrigger(int64_t input);
|
||||
@@ -160,12 +162,10 @@ public:
|
||||
DiffractionExperiment& SampleName(std::string input);
|
||||
DiffractionExperiment& AttenuatorTransmission(const std::optional<float> &input);
|
||||
DiffractionExperiment& TotalFlux(const std::optional<float> &input);
|
||||
DiffractionExperiment& OmegaStep(const std::optional<float> &input);
|
||||
DiffractionExperiment& OmegaStart(float input);
|
||||
DiffractionExperiment& OmegaAxis(const Coord &c);
|
||||
DiffractionExperiment& OmegaAxis();
|
||||
DiffractionExperiment& HeaderAppendix(const std::string& input);
|
||||
DiffractionExperiment& ImageAppendix(const std::string& input);
|
||||
DiffractionExperiment& Goniometer(const std::optional<GoniometerAxis> &input);
|
||||
DiffractionExperiment& RotationAxis(const std::optional<Coord> &c);
|
||||
DiffractionExperiment& HeaderAppendix(const nlohmann::json& input);
|
||||
DiffractionExperiment& ImageAppendix(const nlohmann::json& input);
|
||||
DiffractionExperiment& PhotonEnergyMultiplayer(float input);
|
||||
DiffractionExperiment& Summation(int64_t input);
|
||||
DiffractionExperiment& FPGAOutputMode(FPGAPixelOutput input);
|
||||
@@ -256,6 +256,7 @@ public:
|
||||
|
||||
float GetPixelSize_mm() const;
|
||||
std::string GetSourceName() const;
|
||||
std::string GetSourceType() const;
|
||||
std::string GetSourceNameShort() const;
|
||||
std::string GetInstrumentName() const;
|
||||
std::string GetInstrumentNameShort() const;
|
||||
@@ -272,17 +273,16 @@ public:
|
||||
|
||||
int64_t GetUDPInterfaceCount() const;
|
||||
std::vector<DetectorModuleConfig> GetDetectorModuleConfig(const std::vector<AcquisitionDeviceNetConfig>& net_config) const;
|
||||
Coord GetDefaultOmegaAxis() const;
|
||||
Coord GetDefaultRotationAxis() const;
|
||||
|
||||
bool IsFixedGainG1() const;
|
||||
bool IsUsingGainHG0() const;
|
||||
|
||||
uint64_t GetSeriesID() const;
|
||||
std::string GetSeriesIDString() const;
|
||||
uint64_t GetRunNumber() const;
|
||||
std::string GetRunName() const;
|
||||
bool IsConversionOnFPGA() const;
|
||||
|
||||
const DetectorSetup& GetDetectorSetup() const;
|
||||
std::string GetNeuralNetModelPath() const;
|
||||
|
||||
bool IsPulsedSource() const;
|
||||
|
||||
@@ -292,13 +292,14 @@ public:
|
||||
|
||||
std::optional<float> GetAttenuatorTransmission() const;
|
||||
std::optional<float> GetTotalFlux() const;
|
||||
std::optional<float> GetOmegaStep() const;
|
||||
float GetOmegaStart() const;
|
||||
Coord GetOmegaAxis() const;
|
||||
std::string GetHeaderAppendix() const;
|
||||
std::string GetImageAppendix() const;
|
||||
std::optional<GoniometerAxis> GetGoniometer() const;
|
||||
|
||||
Coord GetRotationAxis() const;
|
||||
const nlohmann::json& GetHeaderAppendix() const;
|
||||
const nlohmann::json& GetImageAppendix() const;
|
||||
float GetPhotonEnergyMultiplier() const;
|
||||
std::optional<UnitCell> GetUnitCell() const;
|
||||
std::string GetUnitCellString() const;
|
||||
int64_t GetSpaceGroupNumber() const;
|
||||
bool GetSaveCalibration() const;
|
||||
int64_t GetSummation() const;
|
||||
@@ -324,6 +325,7 @@ public:
|
||||
int64_t GetImagesPerFile() const;
|
||||
|
||||
float GetDataReductionFactorSerialMX() const;
|
||||
std::string GetExperimentGroup() const;
|
||||
};
|
||||
|
||||
#endif //DIFFRACTIONEXPERIMENT_H
|
||||
|
||||
@@ -9,3 +9,7 @@ std::string jfjoch_git_sha1() {
|
||||
std::string jfjoch_git_date() {
|
||||
return "@GIT_DATE@";
|
||||
}
|
||||
|
||||
std::string jfjoch_version() {
|
||||
return "@PACKAGE_VERSION@";
|
||||
}
|
||||
@@ -7,5 +7,6 @@
|
||||
|
||||
std::string jfjoch_git_sha1();
|
||||
std::string jfjoch_git_date();
|
||||
std::string jfjoch_version();
|
||||
|
||||
#endif //JUNGFRAUJOCH_GITINFO_H
|
||||
|
||||
@@ -16,7 +16,10 @@ Logger::Logger(const std::string &service_name, const std::string &file_name) {
|
||||
sinks.push_back(std::make_shared<spdlog::sinks::daily_file_sink_mt>(file_name, 23, 59));
|
||||
|
||||
spdlog_logger = std::make_shared<spdlog::logger>(service_name, std::begin(sinks), std::end(sinks));
|
||||
spdlog_logger->info("Git sha {} ({})", jfjoch_git_sha1().substr(0, 6), jfjoch_git_date());
|
||||
if (jfjoch_git_sha1().empty())
|
||||
spdlog_logger->info("Version {}", jfjoch_version());
|
||||
else
|
||||
spdlog_logger->info("Version {} (git {} {})", jfjoch_version(), jfjoch_git_sha1().substr(0, 6), jfjoch_git_date());
|
||||
}
|
||||
|
||||
void Logger::ErrorException(const std::exception &e) {
|
||||
|
||||
@@ -46,15 +46,6 @@ NUMAHWPolicy::NUMAHWPolicy(const std::string &policy) : name(policy) {
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Unknown NUMA policy");
|
||||
}
|
||||
|
||||
NUMAHWPolicy::NUMAHWPolicy(const NUMAHWPolicy &other) : bindings(other.bindings), name(other.name), curr_thread(0) {}
|
||||
|
||||
NUMAHWPolicy &NUMAHWPolicy::operator=(const NUMAHWPolicy &other) {
|
||||
bindings = other.bindings;
|
||||
name = other.name;
|
||||
curr_thread = 0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
NUMABinding NUMAHWPolicy::GetBinding(uint32_t thread) {
|
||||
if (bindings.empty())
|
||||
return NUMABinding{.cpu_node = -1, .mem_node = -1, .gpu = -1};
|
||||
@@ -62,14 +53,6 @@ NUMABinding NUMAHWPolicy::GetBinding(uint32_t thread) {
|
||||
return bindings.at(thread % bindings.size());
|
||||
}
|
||||
|
||||
NUMABinding NUMAHWPolicy::GetBinding() {
|
||||
return GetBinding(curr_thread++);
|
||||
}
|
||||
|
||||
void NUMAHWPolicy::Bind() {
|
||||
Bind(GetBinding());
|
||||
}
|
||||
|
||||
void NUMAHWPolicy::Bind(uint32_t thread) {
|
||||
Bind(GetBinding(thread));
|
||||
}
|
||||
|
||||
@@ -17,19 +17,14 @@ struct NUMABinding {
|
||||
class NUMAHWPolicy {
|
||||
std::string name;
|
||||
std::vector<NUMABinding> bindings;
|
||||
std::atomic<uint32_t> curr_thread = 0;
|
||||
public:
|
||||
NUMAHWPolicy() = default;
|
||||
explicit NUMAHWPolicy(const std::string& policy);
|
||||
NUMAHWPolicy(const NUMAHWPolicy& other);
|
||||
NUMAHWPolicy& operator=(const NUMAHWPolicy& other);
|
||||
NUMABinding GetBinding(uint32_t thread);
|
||||
NUMABinding GetBinding(); // round-robin
|
||||
|
||||
const std::string &GetName() const;
|
||||
|
||||
void Bind(uint32_t thread);
|
||||
void Bind(); // round-robin
|
||||
static void Bind(const NUMABinding &binding);
|
||||
static void RunOnNode(int32_t cpu_node);
|
||||
static void MemOnNode(int32_t mem_node);
|
||||
|
||||
@@ -12,7 +12,7 @@ PixelMask::PixelMask(const DetectorSetup &detector)
|
||||
PixelMask::PixelMask(const DiffractionExperiment& experiment)
|
||||
: PixelMask(experiment.GetDetectorSetup()) {}
|
||||
|
||||
void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask, uint8_t bit) {
|
||||
void PixelMask::LoadMask(const std::vector<uint32_t> &input_mask, uint8_t bit) {
|
||||
if (input_mask.size() != mask.size())
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Input match doesn't fit the detector ");
|
||||
@@ -25,7 +25,11 @@ void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment) {
|
||||
void PixelMask::LoadDetectorBadPixelMask(const std::vector<uint32_t> &input_mask) {
|
||||
LoadMask(input_mask, ErrorPixelBit);
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment, bool conv) const {
|
||||
std::vector<uint32_t> mask_out = mask;
|
||||
|
||||
// apply edge mask
|
||||
@@ -39,7 +43,7 @@ std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment
|
||||
|| (line == RAW_MODULE_LINES - 1)
|
||||
|| (col == 0)
|
||||
|| (col == RAW_MODULE_COLS - 1))
|
||||
mask_out[pixel] |= (1 << 30);
|
||||
mask_out[pixel] |= (1 << ModuleEdgePixelBit);
|
||||
}
|
||||
|
||||
if (experiment.GetMaskChipEdges()) {
|
||||
@@ -47,33 +51,39 @@ std::vector<uint32_t> PixelMask::GetMask(const DiffractionExperiment &experiment
|
||||
|| (col == 511) || (col == 512)
|
||||
|| (col == 767) || (col == 768)
|
||||
|| (line == 255) || (line== 256))
|
||||
mask_out[pixel] |= (1 << 31);
|
||||
mask_out[pixel] |= (1 << ChipGapPixelBit);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (experiment.GetDetectorMode() == DetectorMode::Conversion) {
|
||||
std::vector<uint32_t> tmp(experiment.GetPixelsNum(), 1); // nonfuctional areas (i.e. gaps) are filled with 1
|
||||
if (conv && (experiment.GetDetectorMode() == DetectorMode::Conversion)) {
|
||||
std::vector<uint32_t> tmp(experiment.GetPixelsNum(), 1<<ModuleGapPixelBit); // nonfunctional areas (i.e. gaps) are filled with 1
|
||||
RawToConvertedGeometry<uint32_t, uint32_t>(experiment, tmp.data(), mask_out.data());
|
||||
return tmp;
|
||||
} else
|
||||
return mask_out;
|
||||
}
|
||||
|
||||
std::vector<uint32_t> PixelMask::GetUserMask(const DiffractionExperiment &experiment, bool conv) const {
|
||||
std::vector<uint32_t> ret = GetMask(experiment, conv);
|
||||
for (auto &i: ret)
|
||||
i = ((i & (1 << UserMaskedPixelBit)) != 0) ? 1 : 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void PixelMask::LoadUserMask(const DiffractionExperiment &experiment,
|
||||
const std::vector<uint32_t> &in_mask,
|
||||
uint8_t bit) {
|
||||
const std::vector<uint32_t> &in_mask) {
|
||||
if (experiment.GetModulesNum() != nmodules)
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Mismatch in module size");
|
||||
|
||||
if (in_mask.size() == nmodules * RAW_MODULE_SIZE) {
|
||||
LoadDetectorBadPixelMask(in_mask, bit);
|
||||
LoadMask(in_mask, UserMaskedPixelBit);
|
||||
} else if (in_mask.size() == experiment.GetPixelsNum()) {
|
||||
std::vector<uint32_t> raw_mask(nmodules * RAW_MODULE_SIZE);
|
||||
ConvertedToRawGeometry(experiment, raw_mask.data(), in_mask.data());
|
||||
LoadDetectorBadPixelMask(in_mask, bit);
|
||||
LoadMask(raw_mask, UserMaskedPixelBit);
|
||||
} else
|
||||
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
|
||||
"Size of input user mask invalid");
|
||||
|
||||
@@ -9,12 +9,21 @@
|
||||
class PixelMask {
|
||||
size_t nmodules;
|
||||
std::vector<uint32_t> mask;
|
||||
void LoadMask(const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
public:
|
||||
// NXmx bits
|
||||
constexpr static const uint8_t ModuleGapPixelBit = 0;
|
||||
constexpr static const uint8_t ErrorPixelBit = 1;
|
||||
constexpr static const uint8_t UserMaskedPixelBit = 8;
|
||||
constexpr static const uint8_t ChipGapPixelBit = 31;
|
||||
constexpr static const uint8_t ModuleEdgePixelBit = 30;
|
||||
|
||||
PixelMask(const DetectorSetup& detector);
|
||||
PixelMask(const DiffractionExperiment& experiment);
|
||||
void LoadUserMask(const DiffractionExperiment& experiment, const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
void LoadDetectorBadPixelMask(const std::vector<uint32_t>& mask, uint8_t bit);
|
||||
std::vector<uint32_t> GetMask(const DiffractionExperiment& experiment);
|
||||
void LoadUserMask(const DiffractionExperiment& experiment, const std::vector<uint32_t>& mask);
|
||||
void LoadDetectorBadPixelMask(const std::vector<uint32_t>& mask);
|
||||
std::vector<uint32_t> GetMask(const DiffractionExperiment& experiment, bool conv = true) const;
|
||||
std::vector<uint32_t> GetUserMask(const DiffractionExperiment& experiment, bool conv = true) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -7,9 +7,12 @@
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
enum class PlotType {BkgEstimate, RadInt, RadIntPerTimePoint, SpotCount, IndexingRate, IndexingRatePerTimePoint,
|
||||
ErrorPixels, ImageCollectionEfficiency, ReceiverDelay, ReceiverFreeSendBuf, StrongPixels,
|
||||
ROISum, ROIMaxCount, ROIPixels, ResEstimation};
|
||||
enum class PlotType {
|
||||
BkgEstimate, RadInt, RadIntPerTimePoint, SpotCount, SpotCountInRings,
|
||||
IndexingRate, IndexingRatePerTimePoint,
|
||||
ErrorPixels, ImageCollectionEfficiency, ReceiverDelay, ReceiverFreeSendBuf, StrongPixels,
|
||||
ROISum, ROIMaxCount, ROIPixels
|
||||
};
|
||||
|
||||
struct PlotRequest {
|
||||
PlotType type;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
|
||||
#include "Plot.h"
|
||||
|
||||
@@ -37,6 +38,11 @@ template <class T> class StatusVector {
|
||||
return ret;
|
||||
}
|
||||
public:
|
||||
void AddElement(uint32_t id, std::optional<T> val) {
|
||||
if (val.has_value())
|
||||
AddElement(id, val.value());
|
||||
}
|
||||
|
||||
void AddElement(uint32_t id, T val) {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (id >= content.size()) {
|
||||
|
||||
@@ -8,8 +8,7 @@ ZMQContext::ZMQContext() {
|
||||
|
||||
// Default is to have 2 I/O threads per ZMQ context
|
||||
if (zmq_ctx_set(context, ZMQ_IO_THREADS, 2) != 0)
|
||||
throw JFJochException(JFJochExceptionCategory::ZeroMQ,
|
||||
"Cannot set number of I/O threads");
|
||||
throw JFJochException(JFJochExceptionCategory::ZeroMQ, "Cannot set number of I/O threads");
|
||||
}
|
||||
|
||||
ZMQContext &ZMQContext::NumThreads(int32_t threads) {
|
||||
@@ -27,7 +26,7 @@ void *ZMQContext::GetContext() const {
|
||||
return context;
|
||||
}
|
||||
|
||||
ZMQSocket::ZMQSocket(ZMQContext &context, ZMQSocketType in_socket_type) : socket_type(in_socket_type) {
|
||||
ZMQSocket::ZMQSocket(ZMQSocketType in_socket_type) : socket_type(in_socket_type) {
|
||||
socket = zmq_socket(context.GetContext(), static_cast<int>(socket_type));
|
||||
|
||||
if (socket == nullptr)
|
||||
|
||||
@@ -42,14 +42,15 @@ public:
|
||||
|
||||
class ZMQSocket {
|
||||
std::mutex m;
|
||||
ZMQContext context;
|
||||
ZMQSocketType socket_type;
|
||||
void *socket;
|
||||
void SetSocketOption(int32_t option_name, int32_t value);
|
||||
public:
|
||||
ZMQSocket(ZMQSocket &socket) = delete;
|
||||
const ZMQSocket& operator=(ZMQSocket &socket) = delete;
|
||||
ZMQSocket(ZMQContext &context, ZMQSocketType socket_type);
|
||||
~ZMQSocket();
|
||||
explicit ZMQSocket(ZMQSocketType socket_type);
|
||||
~ZMQSocket();
|
||||
void Connect(const std::string& addr);
|
||||
void Disconnect(const std::string& addr);
|
||||
void Bind(const std::string& addr);
|
||||
|
||||
@@ -4,8 +4,8 @@ ADD_LIBRARY(Compression STATIC
|
||||
bitshuffle/bitshuffle.c
|
||||
bitshuffle/bitshuffle_core.c
|
||||
bitshuffle/iochain.c
|
||||
bitshuffle_hperf/src/bitshuffle.c
|
||||
bitshuffle_hperf/src/bitshuffle.h
|
||||
bitshuffle_hperf/bitshuffle.c
|
||||
bitshuffle_hperf/bitshuffle.h
|
||||
JFJochZstdCompressor.cpp
|
||||
JFJochZstdCompressor.h
|
||||
JFJochCompressor.cpp
|
||||
@@ -14,10 +14,7 @@ ADD_LIBRARY(Compression STATIC
|
||||
MaxCompressedSize.cpp
|
||||
MaxCompressedSize.h)
|
||||
|
||||
SET(ZSTD_LEGACY_SUPPORT OFF)
|
||||
SET(ZSTD_MULTITHREAD_SUPPORT OFF)
|
||||
|
||||
TARGET_COMPILE_DEFINITIONS(Compression PUBLIC -DZSTD_SUPPORT -DUSE_ZSTD)
|
||||
TARGET_LINK_LIBRARIES(Compression libzstd_static)
|
||||
TARGET_INCLUDE_DIRECTORIES(Compression PUBLIC . zstd/lib)
|
||||
ADD_SUBDIRECTORY(zstd/build/cmake)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdexcept>
|
||||
#include <cstring>
|
||||
#include <bitshuffle/bitshuffle_internals.h>
|
||||
#include <bitshuffle_hperf/src/bitshuffle.h>
|
||||
#include <bitshuffle_hperf/bitshuffle.h>
|
||||
#include <zstd.h>
|
||||
#include <lz4/lz4.h>
|
||||
|
||||
|
||||
Submodule compression/bitshuffle_hperf deleted from 7be5b2005f
202
compression/bitshuffle_hperf/LICENSE-APACHE
Normal file
202
compression/bitshuffle_hperf/LICENSE-APACHE
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2023 Kal Conley
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
1728
compression/bitshuffle_hperf/bitshuffle.c
Normal file
1728
compression/bitshuffle_hperf/bitshuffle.c
Normal file
File diff suppressed because it is too large
Load Diff
68
compression/bitshuffle_hperf/bitshuffle.h
Normal file
68
compression/bitshuffle_hperf/bitshuffle.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* SPDX-License-Identifier: MIT OR Apache-2.0 */
|
||||
/* Copyright (c) 2023 Kal Conley
|
||||
*/
|
||||
#ifndef BITSHUFFLE_H_
|
||||
#define BITSHUFFLE_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Transpose bits for compression.
|
||||
*
|
||||
* This function performs Bitshuffle transposition of a single block. The block
|
||||
* size in bytes is given by the product of `size` and `elem_size`.
|
||||
*
|
||||
* If required, the `scratch` argument must point to a buffer that the function
|
||||
* uses for scratch purposes. The size of this buffer is given by the block
|
||||
* size.
|
||||
*
|
||||
* On success, the function returns 0; otherwise, -1 is returned to indicate an
|
||||
* error. In case of error, the memory pointed to by `out` and `scratch` is left
|
||||
* unmodified.
|
||||
*
|
||||
* Pointer arguments of this function have C99 `restrict` semantics. If the
|
||||
* `out`, `in`, or `scratch` buffers overlap, the behavior is undefined.
|
||||
*
|
||||
* Errors
|
||||
* ------
|
||||
* The function returns -1 to indicate an error if:
|
||||
*
|
||||
* - The `scratch` argument is `NULL` and a scratch buffer is required for the
|
||||
* specified element size.
|
||||
* - The `size` argument is not a multiple of 8.
|
||||
*/
|
||||
int bitshuf_encode_block(char* out, const char* in, char* scratch, size_t size, size_t elem_size);
|
||||
|
||||
/* Untranspose bits after decompression.
|
||||
*
|
||||
* This function performs the inverse of `bitshuf_encode_block()`.
|
||||
*
|
||||
* If required, the `scratch` argument must point to a buffer that the function
|
||||
* uses for scratch purposes. The size of this buffer is given by the block
|
||||
* size.
|
||||
*
|
||||
* On success, the function returns 0; otherwise, -1 is returned to indicate an
|
||||
* error. In case of error, the memory pointed to by `out` and `scratch` is left
|
||||
* unmodified.
|
||||
*
|
||||
* Pointer arguments of this function have C99 `restrict` semantics. If the
|
||||
* `out`, `in`, or `scratch` buffers overlap, the behavior is undefined.
|
||||
*
|
||||
* Errors
|
||||
* ------
|
||||
* The function returns -1 to indicate an error if:
|
||||
*
|
||||
* - The `scratch` argument is `NULL` and a scratch buffer is required for the
|
||||
* specified element size.
|
||||
* - The `size` argument is not a multiple of 8.
|
||||
*/
|
||||
int bitshuf_decode_block(char* out, const char* in, char* scratch, size_t size, size_t elem_size);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* BITSHUFFLE_H_ */
|
||||
Submodule compression/zstd deleted from 794ea1b0af
@@ -1,7 +1,2 @@
|
||||
ADD_SUBDIRECTORY(slsDetectorPackage)
|
||||
INSTALL(TARGETS sls_detector_put sls_detector_get RUNTIME)
|
||||
|
||||
ADD_LIBRARY(JFJochDetector STATIC DetectorWrapper.cpp DetectorWrapper.h)
|
||||
TARGET_LINK_LIBRARIES(JFJochDetector JFJochCommon slsSupportShared slsDetectorShared)
|
||||
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochDetector JFJochCommon slsDetectorStatic slsSupportStatic)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user