Files
Jungfraujoch/broker/jfjoch_api.yaml
T
leonarski_fandClaude Opus 5 61a7c91b90 Ice: detect it on two channels, and only handle it when it is there
The per-image ice score was read off the PLAIN azimuthal profile. That profile is a
per-ring mean, so a few strong Bragg reflections landing in a ring's q bin lift it
exactly as ice would. Measured over 37 rotation crystals, that did not merely add
noise - it INVERTED the metric: the two highest-scoring crystals had no ice at all
(4.23 and 4.06), while a clean control read 1.57. A decoy null - the identical
statistic evaluated at q positions where hexagonal ice cannot be - reaches 1.51 at its
99th percentile and 2.70 at its maximum, so that metric cannot support any absolute
threshold whatsoever.

The adaptive spot finder already computes the right input for its own threshold: a
sigma-clipped per-resolution-ring background, in the same bins. A powder ring is
azimuthally smooth and survives the clip; Bragg peaks do not. On the clipped profile
the clean population tightens to 1.00-1.22 and the crystals with confirmed ice sit at
2.08-2.37, against a decoy null that never exceeds 1.29.

That channel is blind to one thing: ice in large crystallites diffracts as DISCRETE
spots and leaves the radial profile flat. So a second channel counts found spots on the
rings against the same q width of ice-free flanks beside them. The two barely overlap -
the smooth-ice crystals read 2.1-2.4 / ~1.0 and the textured ones ~1.1 / 3.8-17.6,
while a clean crystal reads 1.04 on both.

Both are then used as a GATE (--ice-min-score 1.5, --ice-min-spot-ratio 2.0, both
calibrated on the battery, 0 disables): the eleven fixed hexagonal bands cover 16-26 %
of the unique reflections at typical resolutions whether or not the crystal has ice, so
flagging, the exclusion from the scale fit and the merge-time CC1/2 ring mask are now
all skipped when neither channel sees any. The gate is applied in the full pipeline and
in --scale, which reads the stored per-image values back out of the _process.h5.

Also fixes the merge-time mask's control: the shoulder now excludes reflections that
are themselves on an ice ring. The rings are not evenly spaced - 1.947/1.916/1.882 A
sit 0.05-0.06 apart in q - so for those three the [w,3w) shoulder landed squarely on
the neighbours and the test compared ice against ice. Measured, that is the only thing
this changes: it removes firings on those three rings and leaves every other firing's
CC pair identical to three decimals.

And the online ice half-width, which was 0.02 in the API against 0.03 offline, so the
same data got a narrower band online than the measured ~0.06 ring FWHM justifies.

Battery (37 rotation crystals, against the previous behaviour): space groups 34/37 in
both and NO crystal's space group changes; 6 crystals gain unique reflections, 1 loses.
Best of them gains 7082 unique reflections with R_meas 16.0 -> 14.3, CC1/2 95.9 -> 97.3
and ISa 13.7 -> 19.0; another goes R_meas 54.9 -> 42.9, CC1/2 84.0 -> 90.4, ISa
3.9 -> 5.5; a third reaches CC1/2 99.4 from 95.7 at an unchanged reflection count. The
one crystal that loses reflections improves on both R_meas and CC1/2.

Not done here: the ScanResult/API/plot-type/frontend/viewer layers for the new
spot_count_ice_control (they need the OpenAPI regeneration). Message, CBOR, HDF5
write/read and the receiver plots are.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 16:17:23 +02:00

3707 lines
124 KiB
YAML

openapi: 3.0.3
info:
title: Jungfraujoch
description: |
API to control Jungfraujoch developed by the Paul Scherrer Institute (Switzerland).
Jungfraujoch is a data acquisition and analysis system for pixel array detectors, primarly PSI JUNGFRAU.
Jungfraujoch uses FPGA boards to acquire data at high data rates.
# License Clarification
While this API definition is licensed under GPL-3.0, **the GPL copyleft provisions do not apply**
when this file is used solely to generate OpenAPI clients or when implementing applications that
interact with the API. Generated client code and applications using this API definition are not
subject to the GPL license requirements and may be distributed under terms of your choosing.
This exception is similar in spirit to the Linux Kernel's approach to userspace API headers and
the GCC Runtime Library Exception. The Linux Kernel developers have explicitly stated that
user programs that merely use the kernel interfaces (syscalls, ioctl definitions, etc.) are not
derivative works of the kernel and are not subject to the terms of the GPL.
This exception is intended to allow wider use of this API specification without imposing GPL
requirements on applications that merely interact with the API, regardless of whether they
communicate through network calls or other mechanisms.
version: 1.0.0-rc.161
contact:
name: Filip Leonarski (Paul Scherrer Institute)
email: filip.leonarski@psi.ch
license:
name: GPL-3.0
url: https://www.gnu.org/licenses/gpl-3.0.html
servers:
- url: http://localhost:5232
description: Test Jungfraujoch system
components:
parameters:
binning:
in: query
name: binning
required: false
schema:
default: 1
type: integer
description: Binning of frames for the plot (0 = default binning)
experimental_coord:
in: query
name: experimental_coord
required: false
schema:
type: boolean
default: false
description: |
If measurement has goniometer axis defined, plot X-axis will represent rotation angle
If measurement has grid scan defined, plot X-axis and Y-axis will represent grid position, Z will be used as the final value
For still measurement the number is ignored
azint_unit:
in: query
name: azint_unit
required: false
schema:
type: string
enum:
- "Q_recipA"
- "d_A"
- "two_theta_deg"
default: "Q_recipA"
description: |
Unit used for azim int.
fill_value:
in: query
name: fill
required: false
schema:
type: number
format: float
description: |
Fill value for elements that were missed during data collection
plot_type:
in: query
name: type
required: true
description: Type of requested plot
schema:
type: string
enum:
- bkg_estimate
- azint
- azint_1d
- spot_count
- spot_count_low_res
- spot_count_indexed
- spot_count_ice
- indexing_rate
- indexing_lattice_count
- indexing_unit_cell_length
- indexing_unit_cell_angle
- profile_radius
- mosaicity
- b_factor
- error_pixels
- saturated_pixels
- image_collection_efficiency
- receiver_delay
- receiver_free_send_buf
- strong_pixels
- roi_sum
- roi_mean
- roi_max_count
- roi_pixels
- roi_weighted_x
- roi_weighted_y
- packets_received
- max_pixel_value
- resolution_estimate
- pixel_sum
- processing_time
- beam_center_x
- beam_center_y
- integrated_reflections
- image_scale_factor
- image_scale_cc
- compression_ratio
- ice_ring_score
roi:
in: query
name: roi
required: false
schema:
type: string
minLength: 1
description: Name of ROI for which plot is requested
image_id:
in: query
name: id
required: false
schema:
type: integer
format: int64
default: -1
minimum: -2
description: "Image ID in the image buffer. Special values: -1 - last image in the buffer, -2: last indexed image in the buffer"
saturation:
in: query
name: saturation
required: false
schema:
type: number
format: float
minimum: -32767
maximum: 32767
description: "Saturation value to set contrast in the preview image; if not provided, then autocontrast procedure is used"
background:
in: query
name: background
required: false
schema:
type: number
format: float
default: 0
minimum: -32767
maximum: 32767
description: "Background value to set contrast in the preview image"
show_spots:
in: query
name: show_spots
schema:
type: boolean
default: true
description: "Show spot finding results on the image"
show_predictions:
in: query
name: show_predictions
schema:
type: boolean
default: false
description: "Show Bragg spot predictions on the image (if available for the image)"
show_beam_center:
in: query
name: show_beam_center
schema:
type: boolean
default: true
description: "Show beam center on the image"
show_roi:
in: query
name: show_roi
schema:
type: boolean
default: false
description: "Show ROI areas on the image"
jpeg_quality:
in: query
name: jpeg_quality
description: "Quality of JPEG image (100 - highest; 0 - lowest)"
schema:
type: integer
format: int64
default: 100
minimum: 0
maximum: 100
show_user_mask:
in: query
name: show_user_mask
schema:
type: boolean
default: false
description: "Show user mask"
resolution_ring:
in: query
name: show_res_ring
description: "Show resolution ring, provided in Angstrom"
schema:
type: number
format: float
default: 0.1
minimum: 0.1
maximum: 100.0
resolution_estimate:
in: query
name: show_res_est
description: "Show resolution estimation as a ring"
schema:
type: boolean
default: false
color_scale:
in: query
name: color
description: "Color scale for preview image"
schema:
type: string
enum:
- "indigo"
- "viridis"
- "bw"
- "wb"
- "green"
- "heat"
- "magma"
- "inferno"
default: "indigo"
schemas:
grid_scan:
description: Definition of a grid scan (mutually exclusive with `rotation_axis`)
type: object
required:
- n_fast
- step_x_um
- step_y_um
properties:
n_fast:
type: integer
format: int64
minimum: 1
example: 20
description: Number of elements in the fast direction
step_x_um:
type: number
format: float
example: 5.0
description: |
Step in grid along the fast direction. Can be negative.
Positive number: left to right
Negative number: right to left
step_y_um:
type: number
format: float
example: -3.0
description: |
Step in grid along the slow direction. Can be negative.
Positive number: top to bottom
Negative number: bottom to top
vertical:
type: boolean
default: false
description: |
If disabled: fast direction = X, slow direction = Y
If enabled: fast direction = Y, slow direction = X
snake:
type: boolean
default: false
description: |
Flip fast direction for every second row
rotation_axis:
description: Definition of a crystal rotation axis
type: object
required:
- step
- vector
properties:
name:
type: string
default: omega
minLength: 1
description: Name of rotation axis (e.g., omega, phi)
step:
type: number
format: float
example: 0.1
description: Angle step (per image) in degrees
start:
type: number
format: float
example: 50
description: Start angle in degrees
default: 0
vector:
type: array
description: Rotation axis
example: [ 1, 0, 0 ]
items:
type: number
format: float
minItems: 3
maxItems: 3
helical_step_um:
type: array
description: Translation (per image) for helical scan
example: [ -5, -2, 0 ]
items:
type: number
format: float
minItems: 3
maxItems: 3
screening_wedge_deg:
type: number
format: float
description: Wedge angle value; used if rotation per image is smaller than increment between images (so particularly in screening)
indexing_algorithm:
type: string
description: |
Selection of an indexing algorithm used by Jungfraujoch
enum:
- "FFBIDX"
- "FFT"
- "FFTW"
- "Auto"
- "None"
default: "FFBIDX"
geom_refinement_algorithm:
type: string
description: |
Selection of an post-indexing least-square diffraction geometry refinement algorithm used by Jungfraujoch.
BeamCenter - This option is refining both beam center and lattice (restricted to a chosen/detected Bravais lattice).
OrientationOnly - This option is refining only orientation of the lattice.
Flex - Tries all per-image refinements and keeps whichever indexes the most spots, letting the pipeline decide (the rugnux flex mode).
enum:
- "BeamCenter"
- "OrientationOnly"
- "Flex"
- "None"
integration_model:
type: string
description: |
Bragg spot integration model.
ProfileGaussian - profile fit with a measured-width Gaussian (Kabsch-style), the default; more
accurate intensities than box summation.
ProfileEmpirical - profile fit with a per-resolution-shell empirical profile learned from strong spots.
BoxSum - classical uniform box summation minus a ring-mean background; the simpler, faster fallback.
enum:
- "ProfileGaussian"
- "ProfileEmpirical"
- "BoxSum"
default: "ProfileGaussian"
dataset_settings:
type: object
required:
- beam_x_pxl
- beam_y_pxl
- detector_distance_mm
- incident_energy_keV
properties:
images_per_trigger:
type: integer
format: int64
minimum: 1
default: 1
description: |
For standard synchrotron data collection - this is number of images collected per one TTL trigger
For XFEL (pulsed source) - this number is ignored and set to 1
For storage cell mode - this number is ignored and set to number of storage cells
ntrigger:
type: integer
format: int64
default: 1
minimum: 1
description: |
Number of TTL trigger that the detector is expected to receive during data collection
image_time_us:
type: integer
format: int64
minimum: 0
description: |
Image time.
If not provided (or zero value) the frame time is assumed as default.
For JUNGFRAU image time must be multiple of frame time and 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.
beam_x_pxl:
type: number
format: float
description: |
/entry/detector/beam_center_x in NXmx
Beam center in X direction [pixels]
beam_y_pxl:
type: number
format: float
description: |
/entry/detector/beam_center_y in NXmx
Beam center in X direction [pixels]
detector_distance_mm:
type: number
format: float
minimum: 0
description:
/entry/detector/distance in NXmx
Detector distance [mm]
incident_energy_keV:
type: number
format: float
minimum: 0.001
maximum: 500.0
description: |
Used to calculate /entry/beam/incident_wavelength in NXmx
Incident particle (photon, electron) energy in keV
file_prefix:
type: string
default: ""
description: Prefix for filenames. If left empty, no file will be saved.
images_per_file:
type: integer
format: int64
minimum: 0
default: 1000
description: Number of files in a single HDF5 data file (0 = write all images to a single data file).
space_group_number:
type: integer
format: int64
minimum: 1
maximum: 194
description: Number of space group for the crystal. Currently used solely as metadata, not relevant for image processing done in Jungfraujoch.
sample_name:
type: string
default: ""
description: |
/entry/sample/name in NXmx
Sample name
compression:
type: string
enum: [
"bslz4",
"bszstd",
"bszstd_rle",
"bszstd_rlehuf",
"none"
]
default: "bslz4"
description: |
Compression type for the images transferred over ZeroMQ and saved to HDF5 file.
total_flux:
type: number
format: float
description: |
/entry/beam/total_flux in NXmx
Flux incident on beam plane in photons per second. In other words this is the flux integrated over area. [photons/s]
transmission:
type: number
format: float
minimum: 0.0
maximum: 1.0
description: |
/entry/instrument/attenuator/attenuator_transmission
Transmission of attenuator (filter) [no units]
goniometer:
$ref: "#/components/schemas/rotation_axis"
grid_scan:
$ref: "#/components/schemas/grid_scan"
header_appendix:
description: |
Header appendix, added as user_data/user to start ZeroMQ message (can be any valid JSON)
In general, it is not saved in HDF5 file.
However, if values are placed in "hdf5" object, `jfjoch_writer` will write them in /entry/user of the HDF5 file.
This applies solely to string and number (double floating-point). No arrays/sub-objects is allowed.
For example {"hdf5": {"val1":1, "val2":"xyz"}}, will write /entry/user/val1 and /entry/user/val2.
image_appendix:
description: |
Image appendix, added as user_data to image ZeroMQ message (can be any valid JSON)
Not saved in HDF5 file
data_reduction_factor_serialmx:
type: number
format: float
default: 1.0
minimum: 0.0
maximum: 1.0
description: |
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.
pixel_value_low_threshold:
type: integer
format: int64
minimum: 0
description: |
Set all counts lower than the value to zero.
When the value is set, negative numbers other than error pixel value are always set to zero.
Setting to zero is equivalent to turning the option off.
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.
poisson_compression:
type: integer
format: int64
minimum: 0
maximum: 16
description: |
Enable lossy compression of pixel values that preserves Poisson statistics.
Requires to provide a numerical factor SQ.
Pixel value P will be transformed to round(sqrt(P) * SQ), with rounding to the closest integer.
Compression is turned off if the value is missing or it is set to zero.
write_nxmx_hdf5_master:
type: boolean
default: true
description: |
Write NXmx formatted HDF5 master file. Recommended to use for macromolecular crystallography experiments
and to turn off for other experiments.
save_calibration:
type: boolean
description: |
Forward image calibration (at the moment pedestal and pedestal RMS for JUNGFRAU) using the ZeroMQ stream to writer.
If parameter is not provided calibration will be saved only if more than 4 images are recorded.
polarization_factor:
type: number
description: Polarization factor for integration; 1.0 is horizontal polarization; -1.0 is vertical polarization
format: float
minimum: -1.0
maximum: 1.0
ring_current_mA:
type: number
format: float
description: Ring current at the beginning of the data collection
minimum: 0.0
sample_temperature_K:
type: number
format: float
description: Sample temperature in Kelvin
minimum: 0.0
poni_rot1_rad:
type: number
description: PONI angle rot1 (see PyFAI documentation for details) in radians
format: float
minimum: -6.28318530718
maximum: 6.28318530718
default: 0.0
poni_rot2_rad:
type: number
description: PONI angle rot2 (see PyFAI documentation for details) in radians
format: float
minimum: -6.28318530718
maximum: 6.28318530718
default: 0.0
poni_rot3_rad:
type: number
description: PONI angle rot3 (see PyFAI documentation for details) in radians
format: float
minimum: -6.28318530718
maximum: 6.28318530718
default: 0.0
unit_cell:
$ref: '#/components/schemas/unit_cell'
spot_finding:
type: boolean
description: Enable spot finding and save spots
default: true
smargon:
type: object
description: |
Geometry of Smargon goniometer at SLS 2.0 / MX beamlines.
Assuming that Smargon is used as static positioner and not moving during the scan, allowing to reconstruct geometry.
required:
- phi_deg
- chi_deg
properties:
phi_deg:
type: number
format: float
description: Phi angle in degrees
chi_deg:
minimum: 0.0
maximum: 90.0
type: number
format: float
description: Chi angle in degrees
phi_axis:
type: array
description: Phi rotation axis
default: [ 1, 0, 0 ]
example: [ 1, 0, 0 ]
items:
type: number
format: float
minItems: 3
maxItems: 3
chi_axis:
type: array
description: Chi rotation axis
default: [ 0, 0, 1 ]
example: [ 0, 0, 1 ]
items:
type: number
format: float
minItems: 3
maxItems: 3
max_spot_count:
type: integer
minimum: 10
maximum: 2000
default: 250
description: Maximum number of spots that are saved/used for indexing; spots with highest intensity are selected
detect_ice_rings:
type: boolean
description: Flag spots as ice rings and reduce their effect on indexing
async_start:
type: boolean
default: false
description: When set to true, `/start` will not wait for detector and Jungfraujoch to be ready for the measurement.
xray_fluorescence_spectrum:
type: object
required:
- energy_eV
- data
properties:
energy_eV:
type: array
items:
type: number
format: float
description: X-ray fluorescence scan energy for each measurement point
data:
type: array
items:
type: number
format: float
description: X-ray fluorescence scan result in arbitrary units; must be exactly the same length, as energy_eV
crystal_lattice:
type: array
items:
type: number
format: float
minItems: 9
maxItems: 9
description: |
Real-space crystal lattice 3D vectors in Angstrom.
Order is 1st vector (x,y,z), 2nd vector (x,y,z) and 3rd vector (x,y,z)
unit_cell:
type: object
description: Unit cell parameters. Necessary to run indexing. Units of angstrom and degree
required:
- a
- b
- c
- alpha
- beta
- gamma
properties:
a:
type: number
format: float
example: 37
minimum: 0
b:
type: number
format: float
example: 37
minimum: 0
c:
type: number
format: float
example: 78
minimum: 0
alpha:
type: number
format: float
example: 90
minimum: 0
maximum: 360
beta:
type: number
format: float
example: 90
minimum: 0
maximum: 360
gamma:
type: number
format: float
example: 90
minimum: 0
maximum: 360
file_writer_format:
type: string
enum:
- "NXmxOnlyData"
- "NXmxLegacy"
- "NXmxVDS"
- "NXmxIntegrated"
- "CBF"
- "TIFF"
- "NoFileWritten"
default: "NXmxLegacy"
description: |
NoFileWritten - no files are written at all
NXmxOnlyData - only data files are written, no master file
NXmxLegacy - legacy format with soft links to data files in the master file; necessary for DECTRIS Albula 4.0 and DECTRIS Neggia
NXmxVDS - newer format with virtual dataset linking data files in the master file, also includes better metadata handling
NXmxIntegrated - single HDF5 per dataset
CBF - DEPRECATED, no longer supported; kept for back compatibility only. Requests using this value are rejected. Only HDF5 formats are written.
TIFF - DEPRECATED, no longer supported; kept for back compatibility only. Requests using this value are rejected. Only HDF5 formats are written.
file_writer_settings:
type: object
properties:
overwrite:
type: boolean
default: false
description: |
Inform jfjoch_write to overwrite existing files. Otherwise files would be saved with .h5.{timestamp}.tmp suffix.
format:
$ref: '#/components/schemas/file_writer_format'
pixel_mask_statistics:
type: object
properties:
user_mask:
description: Number of pixels masked using the user mask
type: integer
format: int64
minimum: 0
too_high_pedestal_rms:
description: Number of pixels with G0 pedestal RMS higher than provided threshold
type: integer
format: int64
minimum: 0
wrong_gain:
description: Number of pixels that show wrong gain level during the pedestal procedure
type: integer
format: int64
minimum: 0
image_buffer_status:
type: object
required:
- image_numbers
- total_slots
- in_preparation_slots
- in_sending_slots
- available_slots
- max_image_number
- min_image_number
properties:
min_image_number:
type: integer
format: int64
minimum: 0
description: Smallest image number available in the buffer
max_image_number:
type: integer
format: int64
minimum: 0
description: Largest image number available in the buffer
image_numbers:
type: array
description: Image numbers currently present in the buffer.
items:
type: integer
format: int64
total_slots:
type: integer
format: int64
description: |
Number of slots in the image buffer. This number, compared to number of images in data collection and
frame rate will determine "retention" rate of the image buffer.
available_slots:
type: integer
format: int64
description: Slots available for the data collection
in_preparation_slots:
type: integer
format: int64
description: |
Number of slots in the image buffer that are currently in preparation for sending.
in_sending_slots:
type: integer
format: int64
description: |
Number of slots in the image buffer that are currently sending/writing data.
current_counter:
type: integer
format: int64
description: |
Counter of changes in the image buffer - either new start message or new image added.
For optimization one can only load new images/datasets from the HTTP if this value changes.
Counter is optional as it was not implemented in older versions to avoid breaking change
image_format_settings:
type: object
required:
- summation
- jungfrau_conversion
- geometry_transform
- mask_chip_edges
- mask_module_edges
- apply_mask
properties:
summation:
type: boolean
description: |
Enable summation of images to a given image_time
If disabled images are saved according to original detector speed, but image count is adjusted
geometry_transform:
type: boolean
description: |
Place module read-out into their location on composed detector and extend multipixels
jungfrau_conversion:
type: boolean
description: |
Convert pixel value in ADU to photon counts/energy
Only affects JUNGFRAU detector
jungfrau_conversion_factor_keV:
type: number
format: float
minimum: 0.001
maximum: 500.0
description: |
Used to convert energy deposited into pixel to counts
If not provided incident_energy_keV is used
bit_depth_image:
type: integer
format: int64
enum: [8, 16, 32]
description: |
Bit depth of resulting image (it doesn't affect the detector read-out value)
If not provided value is adjusted automatically
signed_output:
type: boolean
description: |
Controls if pixels have signed output
If not provided value is adjusted automatically
mask_module_edges:
type: boolean
default: true
description: |
Mask 1 pixel on the module boundary
mask_chip_edges:
type: boolean
default: true
description: |
Mask multipixels on chip boundary
jungfrau_mask_pixels_without_g0:
type: boolean
default: true
description: |
JUNGFRAU: mask pixels that don't operate in G0, but do operate in G1 and G1.
This should be turned off for cases, where detector is operated at room temperature with long exposure time.
apply_mask:
type: boolean
default: false
description: |
Masked pixels are set to special value in the images produced by Jungfraujoch
jungfrau_pedestal_g0_rms_limit:
type: integer
format: int64
default: 100
minimum: 0
description: Pixels with pedestal G0 RMS above the threshold are marked as masked pixels
detector_power_state:
type: string
description: Power on of ASICs
enum: [ "PowerOn", "PowerOff", "Partial" ]
detector_state:
type: string
description: Current state of the detector
enum: [ "Idle", "Waiting", "Busy", "Error", "Not connected"]
detector_status:
type: object
required:
- state
- powerchip
- server_version
- number_of_triggers_left
- fpga_temp_degC
- high_voltage_V
properties:
state:
$ref: '#/components/schemas/detector_state'
powerchip:
$ref: '#/components/schemas/detector_power_state'
server_version:
type: string
description: Detector server (on read-out boards) version
number_of_triggers_left:
type: integer
format: int64
description: Remaining triggers to the detector (max of all modules)
fpga_temp_degC:
type: array
description: Temperature of detector FPGAs
items:
type: integer
format: int64
high_voltage_V:
type: array
description: High voltage for detector modules
items:
type: integer
format: int64
detector_timing:
type: string
enum: [auto, trigger, burst, gated]
default: trigger
detector_settings:
type: object
required:
- frame_time_us
properties:
frame_time_us:
type: integer
description: |
Interval between consecutive frames.
This is internal frame time for the JUNGFRAU detector, image time has to be integer multiply of this number.
For EIGER detector this is default frame time, not used otherwise
format: int64
minimum: 1
count_time_us:
type: integer
description: |
Integration time of the detector.
If not provided count time will be set to maximum value for a given frame time.
format: int64
internal_frame_generator:
type: boolean
default: false
description: Use internal frame generator in FPGA instead of getting data from a real detector
internal_frame_generator_images:
type: integer
format: int64
default: 1
minimum: 1
maximum: 64
description: Number of images stored in the internal frame generator.
detector_trigger_delay_ns:
type: integer
format: int64
minimum: 0
default: 0
description: Delay between TTL trigger and acquisition start [ns]
timing:
$ref: '#/components/schemas/detector_timing'
eiger_threshold_keV:
type: number
format: float
minimum: 1.0
maximum: 100.0
description: |
Threshold for the PSI EIGER detector and all DECTRIS detectors.
If value is provided, it will be used for all subsequent acquisitions, irrespective of beam energy.
If value is not provided, threshold will be determined on start of acquisition as half of incident energy.
This might lead to increased start time.
eiger_bit_depth:
type: integer
format: int64
enum: [ 8, 16, 32 ]
description: |
Bit depth of PSI EIGER read-out. This is
If value is not provided, depth will be determined based on the image time:
* Exposure time < 500 microseconds depth of 8 bit will be used,
* 500 <= exposure time < 2622 microseconds depth of 16 bit will be used
* Exposure time >= 2622 microseconds depth of 32 bit will be used.
jungfrau_pedestal_g0_frames:
type: integer
format: int64
default: 2000
minimum: 0
jungfrau_pedestal_g1_frames:
type: integer
format: int64
default: 300
minimum: 0
jungfrau_pedestal_g2_frames:
type: integer
format: int64
default: 300
minimum: 0
jungfrau_pedestal_min_image_count:
type: integer
format: int64
default: 128
minimum: 32
description: Minimum number of collected images for pedestal to consider it viable
jungfrau_storage_cell_count:
type: integer
format: int64
default: 1
minimum: 1
maximum: 16
jungfrau_storage_cell_delay_ns:
type: integer
format: int64
minimum: 2100
default: 5000
description: Delay between two storage cells [ns]
jungfrau_fixed_gain_g1:
type: boolean
default: false
description: Fix gain to G1 (can be useful for storage cells)
jungfrau_use_gain_hg0:
type: boolean
default: false
description: Use high G0 (for low energy applications)
spot_finding_settings:
type: object
required:
- enable
- indexing
- signal_to_noise_threshold
- photon_count_threshold
- max_pix_per_spot
- min_pix_per_spot
- low_resolution_limit
- quick_integration
- high_resolution_limit_for_spot_count_low_res
- ice_ring_width_q_recipA
properties:
enable:
type: boolean
default: true
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. This is temporary setting, i.e. can be changed anytime during data collection.
signal_to_noise_threshold:
type: number
format: float
minimum: 0
photon_count_threshold:
type: integer
format: int64
minimum: 0
min_pix_per_spot:
type: integer
format: int64
minimum: 1
max_pix_per_spot:
type: integer
format: int64
minimum: 1
high_resolution_limit:
type: number
format: float
description: |
High resolution limit for spot finding [Angstrom]. Optional: if omitted, spot finding extends
as far as the detector reaches, i.e. the detection is not clipped in resolution.
low_resolution_limit:
type: number
format: float
description: Low resolution limit for spot finding [Angstrom]
high_resolution_limit_for_spot_count_low_res:
type: number
format: float
description: High resolution threshold to consider spot "low resolution" [Angstrom]
minimum: 2.0
maximum: 8.0
quick_integration:
type: boolean
default: false
description: |
Quick integration of Bragg spots in diffraction images.
If enabled it will likely reduce performance of Jungfraujoch for datasets with a very high indexing rate.
(experimental feature)
ice_ring_width_q_recipA:
type: number
format: float
minimum: 0.0
maximum: 1.0
default: 0.03
description: Half-width of the ice ring band in q (1/A). Matches the offline default in
image_analysis/spot_finding/SpotFindingSettings.h, which was set from a measured ring
FWHM of ~0.06; the two must agree or the same data gets a narrower ice band online.
high_res_gap_Q_recipA:
type: number
format: float
minimum: 0.1
maximum: 5.0
default: 1.5
description: |
This parameter is used to remove spurious spots at a very high resolution, that sometimes appear due to very low background close to the edge of the detector.
If there is a gap in (1/d)-space between spots of at least this size, spots on the side of the gap with high resolution will be discarded. This is optional parameter.
This option should be turned OFF for small molecule datasets or for crystals with very low mosaicity, when it is expected to see only few spots in any case.
adaptive_threshold:
type: boolean
default: false
description: |
Self-calibrating spot detection: replace the fixed photon_count_threshold by a per-resolution-ring
threshold derived from each image's own noise, so the same setting works across datasets without
per-dataset tuning. photon_count_threshold is then ignored and false_pixels_per_frame sets the
operating point instead.
Only available on detectors whose images are analysed in software (the DECTRIS/SIMPLON workflow).
The JUNGFRAU and EIGER workflows find spots on the FPGA, which applies its own fixed threshold,
so enabling this there is rejected rather than silently ignored.
false_pixels_per_frame:
type: number
format: float
minimum: 1.0
maximum: 100000.0
default: 100.0
description: |
Operating point of the adaptive threshold: the number of noise pixels tolerated per frame.
About 100 suits a multi-megapixel detector. Ignored unless adaptive_threshold is set.
azim_int_settings:
type: object
required:
- solid_angle_corr
- polarization_corr
- low_q_recipA
- q_spacing
properties:
polarization_corr:
type: boolean
description: Apply polarization correction for azimuthal integration (polarization factor must be configured in dataset settings)
default: true
solid_angle_corr:
type: boolean
description: Apply solid angle correction for azimuthal integration
default: true
high_q_recipA:
type: number
minimum: 2e-5
maximum: 10.0
format: float
description: |
Upper q limit of the azimuthal integration [1/Angstrom]. Optional: if omitted, the integration
(and the adaptive spot detection that shares these q bins) extends to the highest q the
detector reaches.
low_q_recipA:
type: number
format: float
minimum: 1e-5
maximum: 10
q_spacing:
type: number
format: float
minimum: 1e-5
azimuthal_bins:
type: integer
format: int64
minimum: 1
maximum: 512
default: 1
description: Numer of azimuthal (phi) bins; 1 = standard 1D azimuthal integration
force_cpu:
type: boolean
default: false
description: |
Force CPU processing of azimuthal integration in the FPGA data acquisition workflow.
This allows to extend number of azimuthal integration bins, as well as to calculate standard deviation
of the azimuthal integration results.
detector_list_element:
type: object
required:
- id
- nmodules
- description
- width
- height
- serial_number
- base_ipv4_addr
- udp_interface_count
- readout_time_ns
- min_frame_time_ns
- min_count_time_ns
properties:
id:
type: integer
format: int64
minimum: 0
description:
type: string
example: "JUNGFRAU 4 Mpixel"
serial_number:
type: string
example: "JF17T16V01"
base_ipv4_addr:
type: string
example: "10.10.10.1"
udp_interface_count:
type: integer
format: int64
example: 2
description: Number of UDP interfaces per detector module
nmodules:
type: integer
format: int64
example: 18
width:
type: integer
format: int64
example: 2068
height:
type: integer
format: int64
example: 2164
pixel_size_mm:
type: number
format: float
example: 0.075
readout_time_ns:
type: integer
format: int64
min_frame_time_ns:
type: integer
format: int64
min_count_time_ns:
type: integer
format: int64
type:
$ref: "#/components/schemas/detector_type"
detector_list:
type: object
required:
- detectors
- current_id
properties:
detectors:
type: array
items:
$ref: '#/components/schemas/detector_list_element'
current_id:
type: integer
format: int64
example: 0
detector_selection:
type: object
required:
- id
properties:
id:
type: integer
format: int64
example: 1
measurement_statistics:
type: object
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
images_collected:
type: integer
format: int64
description: |
Images collected by the receiver. This number will be lower than images expected if there were issues with data collection performance.
images_sent:
type: integer
format: int64
description: |
Images sent to the writer.
The value does not include images discarded by lossy compression filter and images not forwarded due to full ZeroMQ queue.
images_written:
type: integer
format: int64
description: |
Images successfully written to disk.
The value is live updated for TCP/IP socket and direct HDF5 writer, while for ZeroMQ it is only updated at the end of experiment.
images_discarded_lossy_compression:
type: integer
format: int64
description: Images discarded by the lossy compression filter
max_image_number_sent:
type: integer
format: int64
collection_efficiency:
type: number
format: float
example: 1.0
minimum: 0.0
maximum: 1.0
compression_ratio:
type: number
format: float
example: 5.3
minimum: 0.0
cancelled:
type: boolean
max_receiver_delay:
type: integer
format: int64
indexing_rate:
type: number
format: float
detector_width:
type: integer
format: int64
detector_height:
type: integer
format: int64
detector_pixel_depth:
type: integer
format: int64
enum: [2, 4]
bkg_estimate:
type: number
format: float
unit_cell:
type: string
error_pixels:
type: number
format: float
description: Moving average of 1000 images counting number of error pixels on the detector
saturated_pixels:
type: number
format: float
description: Moving average of 1000 images counting number of saturated pixels on the detector
roi_beam_pixels:
type: number
format: float
description: |
If there is an ROI defined with name "beam", this number will hold moving average of 1000 images
for number of valid pixels within this ROI
roi_beam_sum:
type: number
format: float
description: |
If there is an ROI defined with name "beam", this number will hold moving average of 1000 images
for sum of valid pixels within this ROI
fpga_status:
type: array
items:
type: object
required:
- pci_dev_id
- serial_number
- base_mac_addr
- eth_link_status
- eth_link_count
- eth_link_speed
- power_usage_W
- fpga_temp_C
- hbm_temp_C
- packets_sls
- packets_udp
- idle
- fw_version
- pcie_link_speed
- pcie_link_width
properties:
pci_dev_id:
type: string
serial_number:
type: string
fw_version:
type: string
base_mac_addr:
type: string
eth_link_count:
type: integer
format: int64
eth_link_status:
type: integer
format: int64
power_usage_W:
type: number
format: float
fpga_temp_C:
type: number
format: float
hbm_temp_C:
type: number
format: float
packets_udp:
type: integer
format: int64
packets_sls:
type: integer
format: int64
idle:
type: boolean
pcie_link_speed:
type: integer
format: int64
description: PCIe link speed measured by generation (expected value is 4 == PCIe Gen4)
pcie_link_width:
type: integer
format: int64
description: PCIe link width (expected value is 8 == x8)
broker_status:
type: object
required:
- state
properties:
state:
type: string
enum: ["Inactive", "Idle", "Busy", "Measuring", "Pedestal", "Error"]
progress:
type: number
format: float
description: Progress of data collection (only available if receiving is running)
example: 1.0
minimum: 0.0
maximum: 1.0
message:
type: string
description: |
Message to display besides state of the jfjoch_broker; mostly used for errors and warnings
This matters especially for async functions (start/initialize), where API won't return reason
for the error during async operation.
message_severity:
type: string
enum: ["success", "info", "warning", "error"]
default: "error"
description: Level of the message to display
gpu_count:
type: integer
format: int32
description: Number of installed GPUs
broker_version:
type: string
description: Version of the jfjoch_broker
example: "1.0.0-rc.128"
image_pusher_status:
type: object
required:
- pusher_type
- addr
- connected_writers
description: |
Informs about status of the image pusher.
properties:
pusher_type:
$ref: "#/components/schemas/image_pusher_type"
addr:
type: array
items:
type: string
example: [ "tcp://1.2.3.4:5000", "tcp://1.2.3.4:5001" ]
description: |
List of addresses of image pushers.
For HDF5 socket - no addresses will be returned.
For ZeroMQ - list of addresses for each socket will be provided.
For TCP/IP - single address to connect all writers will be provided.
connected_writers:
type: integer
format: int64
minimum: 0
description: |
Number of connected writers
For ZeroMQ image socket: number is constant
For TCP/IP image socket: number is updated live during operation
images_written:
type: integer
format: int64
minimum: 0
description: |
Number of images written to the image socket.
This number is updated live during operation for TCP/IP image socket and direct HDF5 writer.
It is updated at the end of experiment for ZeroMQ image socket.
images_write_error:
type: integer
format: int64
minimum: 0
description: |
Number of images that could not be written to the image socket.
This number is updated live during operation for TCP/IP image socket.
No other socket use it.
writer_fifo_utilization:
type: array
items:
type: integer
format: int64
minimum: 0
description: |
Utilization of internal writer FIFO.
This number is updated live during operation for TCP/IP image socket.
No other socket use it.
plot:
type: object
required:
- x
- y
- title
description: x and y coordinates for plotting, it is OK to assume that both arrays have the same size; layout is optimized for Plotly
properties:
title:
type: string
default: ""
x:
type: array
items:
type: number
format: float
y:
type: array
items:
type: number
format: float
nullable: true
z:
type: array
items:
type: number
format: float
nullable: true
plot_unit_x:
type: string
enum:
- "image_number"
- "q_recipA"
- "d_A"
- "angle_deg"
- "ADU"
- "grid_um"
default: "image_number"
plots:
type: object
required:
- plot
- unit_x
properties:
title:
type: string
unit_x:
$ref: '#/components/schemas/plot_unit_x'
size_x:
type: number
format: float
description: Max X range of the plot
size_y:
type: number
format: float
description: Max Y range of the plot
plot:
type: array
items:
$ref: '#/components/schemas/plot'
scan_result:
type: object
description: Results of a scan
required:
- images
properties:
file_prefix:
type: string
rotation_unit_cell:
$ref: '#/components/schemas/unit_cell'
rotation_crystal_lattice:
$ref: '#/components/schemas/crystal_lattice'
rotation_bravais:
type: string
description: |
Bravais lattice type of the global rotation-indexing solution: crystal-system
letter + centering, e.g. "tP", "oC", "cF", "hR", "mP". Empty if not determined.
images:
type: array
items:
type: object
required:
- efficiency
- number
properties:
efficiency:
type: number
format: float
number:
type: integer
format: int64
description: Detector image number for a given cell
nx:
type: integer
format: int64
description: Cell position in X for grid scan
ny:
type: integer
format: int64
description: Cell position in Y for grid scan
angle:
type: number
format: float
description: Rotation angle associated with the image
bkg:
type: number
format: float
description: Background estimate
spots:
type: integer
format: int64
description: Spot count
spots_low_res:
type: integer
format: int64
description: Spot count in low resolution range
spots_indexed:
type: integer
format: int64
description: Spot count within indexing tolerance
spots_ice:
type: integer
format: int64
description: Spot count within common ice ring resolutions
ice:
type: number
format: float
description: Strongest hexagonal-ice ring intensity over the smooth radial background (1 = no ice)
index:
type: integer
format: int64
description: Indexing solution
latt_count:
type: integer
format: int64
description: Indexing lattice count
pr:
type: number
format: float
description: Profile radius, i.e. how far reflections are from the Ewald sphere
b:
type: number
format: float
description: B-Factor estimate
uc:
$ref: '#/components/schemas/unit_cell'
xfel_pulseid:
type: integer
format: int64
description: XFEL pulse ID
pixel_sum:
type: integer
format: int64
description: Total sum of all pixels
max:
type: integer
format: int64
description: Max viable pixel
sat:
type: integer
format: int64
description: Number of saturated pixels
err:
type: integer
format: int64
description: Number of error pixels
res:
type: number
format: float
description: Diffraction resolution estimate
calibration_statistics:
type: array
items:
required:
- module_number
- storage_cell_number
- pedestal_g0_mean
- pedestal_g1_mean
- pedestal_g2_mean
- gain_g0_mean
- gain_g1_mean
- gain_g2_mean
- masked_pixels
type: object
properties:
module_number:
type: integer
format: int64
storage_cell_number:
type: integer
format: int64
pedestal_g0_mean:
type: number
format: float
pedestal_g1_mean:
type: number
format: float
pedestal_g2_mean:
type: number
format: float
gain_g0_mean:
type: number
format: float
gain_g1_mean:
type: number
format: float
gain_g2_mean:
type: number
format: float
masked_pixels:
type: integer
format: int64
jfjoch_statistics:
type: object
description: "Pool statistics for Jungfraujoch to reduce transfers between frontend and jfjoch_broker"
properties:
detector:
$ref: '#/components/schemas/detector_status'
detector_list:
$ref: '#/components/schemas/detector_list'
detector_settings:
$ref: '#/components/schemas/detector_settings'
image_format_settings:
$ref: '#/components/schemas/image_format_settings'
instrument_metadata:
$ref: '#/components/schemas/instrument_metadata'
file_writer_settings:
$ref: '#/components/schemas/file_writer_settings'
data_processing_settings:
$ref: '#/components/schemas/spot_finding_settings'
measurement:
$ref: '#/components/schemas/measurement_statistics'
broker:
$ref: '#/components/schemas/broker_status'
fpga:
$ref: '#/components/schemas/fpga_status'
calibration:
$ref: '#/components/schemas/calibration_statistics'
zeromq_preview:
$ref: '#/components/schemas/zeromq_preview_settings'
zeromq_metadata:
$ref: '#/components/schemas/zeromq_metadata_settings'
dark_mask:
$ref: '#/components/schemas/dark_mask_settings'
pixel_mask:
$ref: '#/components/schemas/pixel_mask_statistics'
roi:
$ref: '#/components/schemas/roi_definitions'
az_int:
$ref: '#/components/schemas/azim_int_settings'
buffer:
$ref: '#/components/schemas/image_buffer_status'
indexing:
$ref: '#/components/schemas/indexing_settings'
bragg_integration:
$ref: '#/components/schemas/bragg_integration_settings'
image_pusher:
$ref: '#/components/schemas/image_pusher_status'
error_message:
type: object
required:
- msg
- reason
properties:
msg:
type: string
description: "Human readable message"
example: "Detector in wrong state"
reason:
type: string
description: "Enumerate field for automated analysis"
enum: ["WrongDAQState", "Other"]
roi_azimuthal:
type: object
description: "ROI as Q-range (or resolution range), optionally restricted to an azimuthal-angle sector"
required:
- name
- q_min_recipA
- q_max_recipA
properties:
name:
type: string
minLength: 1
description: "Name for the ROI; used in the plots"
q_min_recipA:
type: number
format: float
minimum: 0.00001
description: "Minimum Q-range for the ROI"
q_max_recipA:
type: number
format: float
minimum: 0.00001
description: "Maximum Q-range for the ROI"
phi_min_deg:
type: number
format: float
description: >
Lower azimuthal-angle bound of the sector [degrees]. Optional: provide both
phi_min_deg and phi_max_deg to restrict the ROI to an angular sector, or omit
both for a full ring. A sector with phi_min_deg > phi_max_deg wraps across 0.
phi_max_deg:
type: number
format: float
description: >
Upper azimuthal-angle bound of the sector [degrees]. Optional; see phi_min_deg.
roi_circle:
type: object
description: "Circular ROI"
required:
- name
- center_x_pxl
- center_y_pxl
- radius_pxl
properties:
name:
type: string
minLength: 1
description: "Name for the ROI; used in the plots"
center_x_pxl:
type: number
format: float
description: "X coordinate of center of the circle [pixels]"
center_y_pxl:
type: number
format: float
description: "Y coordinate of center of the circle [pixels]"
radius_pxl:
type: number
format: float
minimum: 0.0
exclusiveMinimum: true
description: "Radius of the circle [pixels]"
roi_box:
type: object
description: "Box ROI"
required:
- name
- min_x_pxl
- max_x_pxl
- min_y_pxl
- max_y_pxl
properties:
name:
type: string
minLength: 1
description: "Name for the ROI; used in the plots"
min_x_pxl:
type: integer
format: int64
description: "Lower bound (inclusive) in X coordinate for the box"
minimum: 0
max_x_pxl:
type: integer
format: int64
description: "Upper bound (inclusive) in X coordinate for the box"
minimum: 0
min_y_pxl:
type: integer
format: int64
description: "Lower bound (inclusive) in Y coordinate for the box"
minimum: 0
max_y_pxl:
type: integer
format: int64
description: "Upper bound (inclusive) in Y coordinate for the box"
minimum: 0
roi_circle_list:
type: object
description: "List of circular ROIs"
required:
- rois
properties:
rois:
type: array
maxItems: 12
items:
$ref: "#/components/schemas/roi_circle"
roi_box_list:
type: object
description: "List of box ROIs"
properties:
rois:
type: array
maxItems: 12
items:
$ref: "#/components/schemas/roi_box"
roi_azim_list:
type: object
description: "List of azimuthal ROIs"
properties:
rois:
type: array
maxItems: 12
items:
$ref: "#/components/schemas/roi_azimuthal"
roi_definitions:
type: object
required:
- box
- circle
- azim
description: "ROI defintions"
properties:
box:
$ref: '#/components/schemas/roi_box_list'
circle:
$ref: '#/components/schemas/roi_circle_list'
azim:
$ref: '#/components/schemas/roi_azim_list'
dark_mask_settings:
type: object
description: "Settings for collection of dark images to be used for mask calculation"
required:
- detector_threshold_keV
- frame_threshold_keV
- max_allowed_pixel_count
- max_frames_with_signal
- frame_time_us
- number_of_frames
properties:
detector_threshold_keV:
type: number
format: float
description: "Energy threshold for dark image collection"
minimum: 2.5
default: 3.5
maximum: 100.0
frame_time_us:
type: integer
format: int64
description: "Time between frames for dark image collection"
minimum: 500
default: 10000
maximum: 100000
number_of_frames:
type: integer
format: int64
description: "Number of frames for dark image collection; zero means no dark collection"
minimum: 0
default: 1000
max_allowed_pixel_count:
type: integer
format: int64
description: "Maximum count in a pixel considered normal (not-masked)"
minimum: 0
default: 1
max_frames_with_signal:
type: integer
format: int64
description: "Maximum number of frames with signal in a pixel considered normal (not-masked)"
minimum: 0
default: 10
indexing_settings:
type: object
description: "Settings for crystallography indexing"
required:
- algorithm
- geom_refinement_algorithm
- fft_high_resolution_A
- fft_max_unit_cell_A
- fft_min_unit_cell_A
- fft_num_vectors
- tolerance
- thread_count
- unit_cell_dist_tolerance
- index_ice_rings
- viable_cell_min_spots
- rotation_indexing
- rotation_indexing_min_angular_range_deg
- rotation_indexing_angular_stride_deg
- blocking
properties:
algorithm:
$ref: "#/components/schemas/indexing_algorithm"
fft_max_unit_cell_A:
type: number
format: float
default: 250
maximum: 500
minimum: 50
description: Largest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT
fft_min_unit_cell_A:
type: number
format: float
default: 10.0
minimum: 5
maximum: 40
description: Smallest unit cell to be indexed by FFT algorithm; parameter value affects execution time of FFT
fft_high_resolution_A:
type: number
format: float
default: 2.0
minimum: 0.5
maximum: 6.0
description: |
Highest resolution of spots used for FFT algorithm; parameter value affects execution time of FFT.
There is also correlation between smallest unit cell and max resolution, which need to be checked for very small systems.
fft_num_vectors:
type: integer
format: int64
minimum: 128
default: 16384
description: Number of search directions for the FFT algorithm; parameter value affects execution time of FFT.
tolerance:
type: number
format: float
minimum: 0.0
maximum: 0.5
description: Acceptance tolerance for spots after the indexing run - the larger the number, the more spots will be accepted
thread_count:
type: integer
format: int64
minimum: 1
maximum: 64
description: Thread count for indexing algorithm
geom_refinement_algorithm:
$ref: '#/components/schemas/geom_refinement_algorithm'
unit_cell_dist_tolerance:
type: number
format: float
minimum: 0.0001
maximum: 0.2001
default: 0.05
description: Relative distance tolerance for unit cell vs. reference; Lattices outside given tolerance will be ignored
viable_cell_min_spots:
type: integer
format: int64
minimum: 5
default: 10
description: Minimum number of indexed spots required for a cell to be considered viable
index_ice_rings:
type: boolean
default: false
description: |
Include spots marked as ice rings in the indexing run.
If `dataset_settings` doesn't have `detect_ice_rings` on, this option will have no effect on processing.
rotation_indexing:
type: boolean
default: false
rotation_indexing_min_angular_range_deg:
type: number
format: float
default: 20.0
minimum: 1.0
rotation_indexing_angular_stride_deg:
type: number
format: float
default: 0.5
minimum: 0
blocking:
type: boolean
default: true
description: |
Indexing in Jungfraujoch goes with a dedicated thread pool.
If set to false, the thread pool is non-blocking, i.e. if there are no threads available, image indexing will be skipped. This option is recommended for real-time processing at high frame rates.
If set to true, the thread pool will block until a thread is available.
instrument_metadata:
type: object
description: "Metadata for a measurement instrument"
required:
- source_name
- instrument_name
properties:
source_name:
type: string
example: Swiss Light Source
source_type:
type: string
description: |
Type of radiation source. NXmx gives a fixed dictionary, though Jungfraujoch is not enforcing compliance.
https://manual.nexusformat.org/classes/base_classes/NXsource.html#nxsource
NXsource allows the following:
Spallation Neutron Source
Pulsed Reactor Neutron Source
Reactor Neutron Source
Synchrotron X-ray Source
Pulsed Muon Source
Rotating Anode X-ray
Fixed Tube X-ray
UV Laser
Free-Electron Laser
Optical Laser
Ion Source
UV Plasma Source
Metal Jet X-ray
example: Synchrotron X-ray Source
default: ""
instrument_name:
type: string
example: CristallinaMX
pulsed_source:
type: boolean
description: |
Settings specific to XFEL (e.g., every image has to come from TTL trigger, save pulse ID and event code)
default: false
electron_source:
type: boolean
description: |
Settings specific to electron source (e.g., wavelength definition)
default: false
detector_module_direction:
type: string
enum: [Xp, Xn, Yp, Yn]
detector_type:
type: string
enum: [EIGER, JUNGFRAU, DECTRIS]
image_pusher_type:
type: string
default: None
enum: [ZeroMQ, HDF5, CBOR, TCP, None]
standard_detector_geometry:
type: object
description: Regular rectangular geometry, first module is in the bottom left corner of the detector
required:
- nmodules
properties:
nmodules:
type: integer
minimum: 1
description: Number of modules in the detector
gap_x:
type: integer
default: 8
minimum: 0
description: Gap size in X direction [pixels]
gap_y:
type: integer
minimum: 0
default: 36
description: Gap size in Y direction [pixels]
modules_in_row:
type: integer
minimum: 1
default: 1
description: Number of modules in one row
detector_module:
type: object
required:
- x0
- y0
- fast_axis
- slow_axis
properties:
x0:
type: number
y0:
type: number
fast_axis:
$ref: '#/components/schemas/detector_module_direction'
slow_axis:
$ref: '#/components/schemas/detector_module_direction'
detector:
type: object
required:
- description
properties:
description:
type: string
minLength: 1
serial_number:
type: string
default: "Unknown"
minLength: 1
type:
$ref: '#/components/schemas/detector_type'
high_voltage_V:
type: integer
format: int64
minimum: 0
maximum: 200
default: 0
udp_interface_count:
type: integer
format: int64
minimum: 1
maximum: 2
default: 1
module_sync:
type: boolean
default: true
description: Use module 0 as master for timing. Only applies to JUNGFRAU detector (this cannot be turned off for EIGER).
sensor_thickness_um:
type: number
format: float
minimum: 0
default: 320
readout_time_ns:
type: integer
format: int64
minimum: 1
description: |
Minimum difference between frame time and count time in microseconds
Defaults are 3'000 ns for EIGER and 20'000 ns for JUNGFRAU
min_count_time_ns:
type: integer
format: int64
minimum: 0
description: Minimum count time available for the detector.
min_frame_time_ns:
type: integer
format: int64
minimum: 0
description: Minimum frame time available for the detector.
calibration_file:
type: array
description: |
Can be empty for all detectors - default calibration used.
For JUNGFRAU: list of gain files, one entry per module.
For EIGER: one directory (with detector settings) or list of trim bit files, one entry per half-module.
items:
type: string
trim_energies_eV:
type: array
description: |
List of energies at which trimming calibration is provided.
Only needed for PSI EIGER and compulsory in this case
items:
type: integer
format: int32
minimum: 100
hostname:
type: array
description: |
Hostname for detector module. One entry per module
One entry per module. Either empty or number of module entries.
items:
type: string
sensor_material:
type: string
default: Si
tx_delay:
type: array
items:
type: integer
format: int64
base_data_ipv4_address:
type: string
example: 10.10.10.50
standard_geometry:
$ref: '#/components/schemas/standard_detector_geometry'
custom_geometry:
type: array
items:
$ref: '#/components/schemas/detector_module'
roi_mode:
type: string
default: ""
description: ROI setting for DECTRIS detectors
mirror_y:
type: boolean
default: true
description: Mirror detector in Y direction to account for MX convention of (0,0) point in top left corner
temp_thresold_degC:
type: integer
format: int64
description: Temperature threshold for JUNGFRAU detector modules
minimum: 40
maximum: 70
default: 55
default_settings:
$ref: '#/components/schemas/detector_settings'
zeromq_settings:
type: object
description: |
ZeroMQ configuration for Jungfraujoch software.
This structure is used to provide default settings using configuration JSON file and is not used in HTTP.
properties:
send_watermark:
type: integer
format: int64
minimum: 2
maximum: 16384
default: 100
description: Watermark for ZeroMQ send queue (number of outstanding messages queued on Jungfraujoch server per queue)
send_buffer_size:
type: integer
format: int64
description: Send buffer size for ZeroMQ socket
image_socket:
type: array
items:
type: string
example: ["tcp://1.2.3.4:5000", "tcp://1.2.3.4:5001"]
description: |
PUSH ZeroMQ socket for images. In case multiple sockets are provided, images are streamed over multiple sockets.
Images are serialized using CBOR.
Address follows ZeroMQ convention for sockets - in practice ipc://<socket file> and tpc://<IP address>:<port> sockets are OK.
0.0.0.0 instead of IP address is accepted and means listening on all network interfaces.
writer_notification_socket:
type: string
example: "tcp://1.3.4.6:7000"
description: |
PULL ZeroMQ socket for notifications from writer that it finished operation.
This allows Jungfraujoch to operate in a synchronous manner, with end of acquisition being also end of writing.
Address follows ZeroMQ convention for sockets - in practice ipc://<socket file> and tpc://<IP address>:<port> sockets are OK.
0.0.0.0 instead of IP address should be avoided, as this socket address is forwarded to the writer process via START ZerOMQ message and in case of multiple ineterfaces the address might be ambigous.
Using * (star) instead of port number is allowed and it means a random free port number.
tcp_settings:
type: object
description: |
TCP image stream configuration for Jungfraujoch software.
This structure is used to provide default settings using configuration JSON file and is not used in HTTP.
required:
- addr
properties:
send_buffer_size:
type: integer
format: int64
description: Send buffer size for TCP/IP socket
image_socket:
type: string
example: "tcp://1.2.3.4:5000"
description: |
tcp://<IP address>:<port>
0.0.0.0 instead of IP address is accepted and means listening on all network interfaces
nwriters:
type: integer
format: int64
minimum: 1
maximum: 100
default: 32
description: Number of TCP/IP writers to be used for streaming images
peer_liveness_timeout_ms:
type: integer
format: int64
description: |
Max time (in milliseconds) a send may block with no sign of life from the
writer (no BUSY heartbeat or ACK) before the connection is declared dead.
Optional; the built-in default is used when unset.
max_backpressure_timeout_ms:
type: integer
format: int64
description: |
Hard upper bound (in milliseconds) on backpressure: if no bytes can be sent to
the writer for this long the connection is declared dead even while the writer
keeps heartbeating, so a wedged writer cannot block the run or its
finalization. Optional; the built-in default is used when unset.
pcie_devices:
type: array
minLength: 1
items:
type: object
required:
- block_device
properties:
blk:
type: string
example: "/dev/jfjoch0"
description: Block device name
ipv4:
type: string
example: 10.1.1.7
description: IPv4 address of the block device
bragg_integration_settings:
type: object
description: "Settings for Bragg spot integration"
required:
- integration_model
properties:
integration_model:
$ref: '#/components/schemas/integration_model'
max_hkl:
type: integer
minimum: 1
maximum: 511
default: 100
description: |
How far the Bragg predictor walks the lattice: reflections with |h|,|k|,|l| above this are
never predicted. An axis is truncated once a/d_min exceeds it, so a long axis - or a short
one taken to high resolution - loses its outermost reflections. The cost grows as the cube
(2n+1)^3 of candidates per image, which is why online keeps a fixed, predictable value
instead of taking it from whichever crystal is mounted.
Omitting the field selects the default above; it is never interpreted as "choose per
crystal". The offline tools (rugnux, viewer) do derive it from the refined cell when it is
left unset there, but that is their own default and is not reachable through this API.
jfjoch_settings:
type: object
required:
- detector
- frontend_directory
- image_pusher
description: |
Default settings for Jungfraujoch software.
This structure is used to provide default settings using configuration JSON file and is not used in HTTP.
properties:
pcie:
$ref: '#/components/schemas/pcie_devices'
zeromq:
$ref: '#/components/schemas/zeromq_settings'
tcp:
$ref: '#/components/schemas/tcp_settings'
instrument:
$ref: '#/components/schemas/instrument_metadata'
file_writer:
$ref: '#/components/schemas/file_writer_settings'
detector:
type: array
minLength: 1
items:
$ref: '#/components/schemas/detector'
indexing:
$ref: '#/components/schemas/indexing_settings'
bragg_integration:
$ref: '#/components/schemas/bragg_integration_settings'
detector_settings:
$ref: '#/components/schemas/detector_settings'
azim_int:
$ref: '#/components/schemas/azim_int_settings'
image_format:
$ref: '#/components/schemas/image_format_settings'
image_buffer_MiB:
type: integer
minimum: 128
default: 2048
description: Size of internal buffer in MiB for images before they are sent to a stream
verbose:
type: boolean
default: false
description: Print extra debug information
receiver_threads:
type: integer
minimum: 1
maximum: 512
default: 64
description: Number of threads used by the receiver
numa_policy:
type: string
deprecated: true
description: Ignored value
frontend_directory:
type: string
description: Location of built JavaScript web frontend
spot_finding:
$ref: '#/components/schemas/spot_finding_settings'
image_pusher:
$ref: '#/components/schemas/image_pusher_type'
zeromq_preview:
$ref: '#/components/schemas/zeromq_preview_settings'
zeromq_metadata:
$ref: '#/components/schemas/zeromq_metadata_settings'
dark_mask:
$ref: '#/components/schemas/dark_mask_settings'
zeromq_metadata_settings:
type: object
required:
- enabled
- period_ms
properties:
enabled:
type: boolean
default: true
description: ZeroMQ metadata socket is enabled.
period_ms:
type: integer
format: int64
minimum: 1
default: 1000
description: |
Period for generating metadata package sent to the ZeroMQ interface in milliseconds.
socket_address:
type: string
description: |
PUB ZeroMQ socket for image metadata information.
Image metadata are serialized using CBOR.
Address follows ZeroMQ convention for sockets - in practice ipc://<socket file> and tcp://<IP address>:<port> sockets are OK.
0.0.0.0 instead of IP address is accepted and means listening on all network interfaces.
zeromq_preview_settings:
type: object
required:
- enabled
- period_ms
properties:
enabled:
type: boolean
default: true
description: ZeroMQ preview socket is enabled.
period_ms:
type: integer
format: int64
default: 1000
description: |
Period for generating preview image sent to the ZeroMQ interface in milliseconds. Default is 1 second.
If set to zero, all images will be sent ZeroMQ (should be used only in case of relatively slow data collection).
This has no effect on HTTP based preview, which updates always at rate of 1 second.
socket_address:
type: string
description: |
PUB ZeroMQ socket for preview images. This socket operates at a reduced frame rate.
Images are serialized using CBOR.
Address follows ZeroMQ convention for sockets - in practice ipc://<socket file> and tcp://<IP address>:<port> sockets are OK.
0.0.0.0 instead of IP address is accepted and means listening on all network interfaces.
paths:
/initialize:
post:
summary: Initialize detector and data acquisition
description: |
Should be used in two cases:
- Detector is in `Inactive` state
- Detector is in `Error` state
X-ray shutter must be closed.
This operation will reconfigure network interface of the detector.
During operation of the detector it is recommended to use the `POST /pedestal` operation instead.
If storage cells are used, the execution time might be few minutes.
This is async function - one needs to use `POST /wait_till_done` to ensure operation is done.
responses:
"200":
description: Initialization started
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/pedestal:
post:
summary: Collect dark current for the detector
description: |
Updates calibration of the JUNGFRAU detector. Must be in `Idle` state.
X-ray shutter must be closed. Recommended to run once per hour for long integration times (> 100 us).
This is async function - one needs to use `POST /wait_till_done` to ensure operation is done.
responses:
"200":
description: Everything OK
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/start:
post:
summary: Start detector
description: |
Start data acquisition.
Detector must be in `Idle` state.
Default behavior is for the call to block until detector is ready to accept soft/TTL triggers.
However, this behavior can be changed by settings `async_start` to true in the request body,
in which case the call will return immediately and one needs to use `/wait_until_running` to ensure detector is ready to run.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/dataset_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/wait_until_running:
post:
summary: Wait for acquisition running
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 detector and Jungfraujoch are ready to collect data.
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 `Measuring` state
"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: Timeout reached, need to restart operation
/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 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: Timeout reached, need to restart operation
/trigger:
post:
summary: Send soft trigger to the detector
description: Generate soft trigger
responses:
"200":
description: Trigger sent
/cancel:
post:
summary: Cancel running data collection
description: |
Command will inform FPGA network card to stop pedestal or data collection at the current stage.
Any frame that is currently being processed by CPU will be finished and sent to writer.
Given the command is making sure to gracefully stop data acquisition and detector, it might take some time to switch back after command finished to `Idle` state.
If data collection is not running, the command has no effect.
responses:
"200":
description: Cancel request sent to FPGAs (or ignored, as data collection is not running)
/deactivate:
post:
summary: Prepare detector to turn off
description: |
Should be in `Idle` or `Error` state.
Command deactivates data acquisition and turns off detector high voltage and ASIC.
Should be used always before turning off power from the detector.
responses:
"200":
description: Detector ready to turn off
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/config/detector:
put:
summary: Change detector configuration
description: |
Detector settings are ones that have effect on calibration, i.e., pedestal has to be collected again after changing these settings.
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
If detector is in `Idle` state , pedestal procedure will be executed automatically - there must be no X-rays on the detector during the operation.
If detector is in `Inactive` or `Error` states, new settings will be saved, but no calibration will be executed.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/detector_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get detector configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/detector_settings'
/config/indexing:
put:
summary: Change indexing algorithm settings
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/indexing_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get indexing configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/indexing_settings'
/config/bragg_integration:
put:
summary: Change Bragg integration settings
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/bragg_integration_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get Bragg integration configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/bragg_integration_settings'
/config/file_writer:
put:
summary: Change file writer settings
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/file_writer_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get file writer settings
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/file_writer_settings'
/config/instrument:
put:
summary: Change instrument metadata
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/instrument_metadata'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get instrument metadata
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/instrument_metadata'
/config/image_format:
put:
summary: Change image output format
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/image_format_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get image output format
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/image_format_settings'
/config/image_format/raw:
post:
summary: Configure format for raw data collection
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
responses:
"200":
description: Everything OK
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/config/image_format/conversion:
post:
summary: Configure format for data collection with full conversion
description: |
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
responses:
"200":
description: Everything OK
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/config/spot_finding:
put:
summary: Configure spot finding
description: Can be done anytime, also while data collection is running
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/spot_finding_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
get:
summary: Get data processing configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/spot_finding_settings'
/config/azim_int:
put:
summary: Configure azimuthal integration
description: Can be done when detector is Inactive or Idle
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/azim_int_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get azimuthal integration configuration
description: Can be done anytime
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/azim_int_settings'
/config/internal_generator_image:
put:
summary: Load binary image for internal FPGA generator
description: |
Load image for internal FPGA generator. This can only happen in Idle state of the detector.
Requires binary blob with 16-bit integer numbers of size of detector in raw/converted coordinates
(depending on detector settings).
parameters:
- name: id
in: query
description: Image id to upload
required: false
schema:
type: integer
format: int64
minimum: 0
maximum: 127
requestBody:
content:
application/octet-stream:
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/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
description: |
Jungfraujoch allows to control multiple detectors and/or region-of-interests.
The command allows to choose one detector from the list (ID has to be consistent with one provided by GET response).
Changing detector will set detector to `Inactive` state and will require reinitialization.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/detector_selection'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: List available detectors
description: Configured detectors that can be selected by used
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/detector_list'
/config/zeromq_preview:
put:
summary: Set ZeroMQ preview settings
description: |
Jungfraujoch can generate preview message stream on ZeroMQ SUB socket.
Here settings of the socket can be adjusted.
While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.
Options set with this PUT request have no effect on HTTP based preview.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/zeromq_preview_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get ZeroMQ preview settings
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/zeromq_preview_settings'
/config/zeromq_metadata:
put:
summary: Set ZeroMQ metadata settings
description: |
Jungfraujoch can generate metadata message stream on ZeroMQ PUB socket. This stream covers all images.
Here settings of the socket can be adjusted.
While the data structure contains also socket_address, this cannot be changed via HTTP and is ignore in PUT request.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/zeromq_metadata_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get ZeroMQ metadata socket settings
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/zeromq_metadata_settings'
/config/dark_mask:
put:
summary: Set configuration for dark data collection to calculate mask
description: |
This is only possible when operating DECTRIS detectors at the moment; it will be also available for PSI EIGER at some point.
This can only be done when detector is `Idle`, `Error` or `Inactive` states.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/dark_mask_settings'
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
get:
summary: Get settings for dark data collection to calculate mask
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/dark_mask_settings'
/status:
get:
summary: Get Jungfraujoch status
description: Status of the data acquisition
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/broker_status'
/fpga_status:
get:
summary: Get status of FPGA devices
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/fpga_status'
/xfel/pulse_id:
get:
summary: Return XFEL pulse IDs for the current data acquisition
description: Return array of XFEL pulse IDs - (-1) if image not recorded
responses:
"200":
description: "Pulse ID collected"
content:
application/json:
schema:
type: array
items:
type: integer
format: int64
"404":
description: "Not in XFEL mode or no acquisition recorded"
/xfel/event_code:
get:
summary: Return XFEL event codes for the current data acquisition
description: Return array of XFEL event codes
responses:
"200":
description: "Event codes collected"
content:
application/json:
schema:
type: array
items:
type: integer
format: int64
"404":
description: "Not in XFEL mode or no acquisition recorded"
/image_pusher/status:
get:
summary: Get status of image pusher
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/image_pusher_status'
"500":
description: Error encountered when trying to read status
content:
text/plain:
schema:
type: string
description: Exception error
/detector/status:
get:
summary: Get detector status
description: Status of the JUNGFRAU detector
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/detector_status'
"404":
description: Running in "simulator" mode - no detector present
"500":
description: Error encountered when trying to read status
content:
text/plain:
schema:
type: string
description: Exception error
/config/roi:
get:
summary: Get ROI definitions
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/roi_definitions'
put:
summary: Upload ROI definitions
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/roi_definitions"
responses:
"200":
description: Everything OK
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/statistics:
get:
summary: Get general statistics
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/jfjoch_statistics'
/statistics/data_collection:
get:
summary: Get data collection statistics
description: Results of the last data collection
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/measurement_statistics'
"404":
description: No data collection performed so far
/statistics/calibration:
get:
summary: Get calibration statistics
description: Statistics are provided for each module/storage cell separately
responses:
"200":
description: Everything OK
content:
application/json:
schema:
$ref: '#/components/schemas/calibration_statistics'
/config/mask:
get:
summary: Get mask of the detector (binary)
description: |
Detector must be Initialized.
Get full pixel mask of the detector.
See NXmx standard for meaning of pixel values.
responses:
"200":
description: Binary array (4 byte; unsigned)
content:
application/octet-stream:
schema:
type: string
format: binary
/config/user_mask:
get:
summary: |
Detector must be Initialized.
Get user mask of the detector (binary)
description: "Get user pixel mask of the detector in the actual detector coordinates: 0 - good pixel, 1 - masked"
responses:
"200":
description: User mask in binary format (4 byte; unsigned)
content:
application/octet-stream:
schema:
type: string
format: binary
put:
summary: Upload user mask of the detector (binary)
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 binary array (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.
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
"200":
description: All good
"400":
description: Mask is not 4-byte unsigned integer array or empty body
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/config/mask.tiff:
get:
summary: Get mask of the detector (TIFF)
description: |
Should be in `Idle` state.
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: |
Detector must be Initialized.
Get user mask of the detector (TIFF)
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 a single-channel TIFF (8-, 16- or 32-bit integer, signed or 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:
image/tiff:
schema:
type: string
format: binary
responses:
"200":
description: All good
"400":
description: Not a valid single-channel TIFF or size doesn't match the detector
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/preview/pedestal.tiff:
get:
parameters:
- in: query
name: gain_level
required: true
schema:
type: integer
description: Gain level (0, 1, 2)
- in: query
name: sc
schema:
type: integer
description: Storage cell number
summary: Get pedestal in TIFF format
responses:
"200":
description: Calibration image
content:
image/tiff:
schema:
type: string
format: binary
"400":
description: Invalid gain level or storage cell number
"404":
description: No calibration recorded so far
/preview/plot:
get:
summary: Generate 1D plot from Jungfraujoch
parameters:
- $ref: "#/components/parameters/binning"
- $ref: "#/components/parameters/plot_type"
- $ref: "#/components/parameters/fill_value"
- $ref: "#/components/parameters/experimental_coord"
- $ref: "#/components/parameters/azint_unit"
responses:
"200":
description: Everything OK.
content:
application/json:
schema:
$ref: '#/components/schemas/plots'
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
/preview/plot.bin:
get:
summary: |
Generate 1D plot from Jungfraujoch and send in raw binary format.
Data are provided as (32-bit) float binary array.
This format doesn't transmit information about X-axis, only values, so it is of limited use for azimuthal integration.
parameters:
- $ref: "#/components/parameters/plot_type"
- $ref: "#/components/parameters/roi"
responses:
"200":
description: Everything OK.
content:
application/octet-stream:
schema:
type: string
format: binary
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
/result/scan:
get:
summary: Get full scan result
responses:
"200":
description: Everything OK.
content:
application/json:
schema:
$ref: '#/components/schemas/scan_result'
"404":
description: No grid scan recorded
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/image_buffer/start.cbor:
get:
summary: Get Start message in CBOR format
description: Contains metadata for a dataset (e.g., experimental geometry)
responses:
"200":
description: Return start message
content:
application/cbor:
schema:
type: string
format: binary
"404":
description: No measurement so far
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/image_buffer/image.cbor:
get:
summary: Get image message in CBOR format
description: Contains full image data and metadata. The image must come from the latest data collection.
parameters:
- $ref: '#/components/parameters/image_id'
responses:
"200":
description: Return image message
content:
application/cbor:
schema:
type: string
format: binary
"404":
description: Image not present in the buffer - either not yet measured or already replaced by a next image.
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/image_buffer/image.jpeg:
get:
summary: Get preview image in JPEG format using custom settings
parameters:
- $ref: '#/components/parameters/image_id'
- $ref: '#/components/parameters/show_user_mask'
- $ref: '#/components/parameters/show_roi'
- $ref: '#/components/parameters/show_spots'
- $ref: '#/components/parameters/show_predictions'
- $ref: '#/components/parameters/show_beam_center'
- $ref: '#/components/parameters/saturation'
- $ref: '#/components/parameters/jpeg_quality'
- $ref: '#/components/parameters/resolution_ring'
- $ref: '#/components/parameters/color_scale'
- $ref: '#/components/parameters/resolution_estimate'
responses:
"200":
description: Preview image
content:
image/jpeg:
schema:
type: string
format: binary
"404":
description: Image not present in the buffer - either not yet measured or already replaced by a next image.
"400":
description: Input parsing or validation error
content:
text/plain:
schema:
type: string
description: Exception error
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/image_buffer/image.tiff:
get:
summary: Get preview image in TIFF format
parameters:
- $ref: '#/components/parameters/image_id'
responses:
"200":
description: Preview image
content:
image/tiff:
schema:
type: string
format: binary
"404":
description: No preview image recorded so far
/image_buffer/clear:
post:
summary: Clear image buffer
description: Turns off image buffer for the last data collection. Can be only run when Jungfraujoch is not collecting data.
responses:
"200":
description: Done
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/image_buffer/status:
get:
summary: Get status of the image buffers
description: |
Can be run at any stage of Jungfraujoch operation, including during data collection.
The status of the image buffer is volatile during data collection - if data collection goes for more images than available buffer slots,
then image might be replaced in the buffer between calling /images and /image.cbor.
responses:
"200":
description: Done
content:
application/json:
schema:
$ref: '#/components/schemas/image_buffer_status'
"500":
description: Error within Jungfraujoch code - see output message.
content:
application/json:
schema:
$ref: '#/components/schemas/error_message'
/version:
get:
summary: Get Jungfraujoch version of jfjoch_broker
responses:
"200":
description: Release number of Jungfraujoch
content:
text/plain:
schema:
type: string
example: 1.0.0-rc.25