Files
slsDetectorPackage/docs/src/fileformat.rst
maliakal_dandlunin_l 529f91c4ae
Build on RHEL9 docker image / build (push) Successful in 3m48s
Build on RHEL8 docker image / build (push) Successful in 4m40s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m55s
Run Simulator Tests on local RHEL8 / build (push) Successful in 22m20s
1010/docs typos svg images (#1524)
* replaced png images with svg

* fixed docs typos

* fix filename

* fix image references, filename in index

* fixed drawio svg export, upd drawio plots

---------

Co-authored-by: lrlunin <lunin.leonid@gmail.com>
2026-08-14 15:55:21 +02:00

3.0 KiB

File format

If fwrite is enabled, the receiver will write data to files.

Number of Files

Every acquisition will create a master file and data files.

An acquisition can have multiple data files for a single frame. The number of files is determined by the number of UDP ports per module and the number of modules.

  • Every module has its own receiver process. Every receiver process can have 1 or 2 UDP ports.
  • Each UDP port will create its own file. Therefore, each receiver can write 1 or 2 files.
  • So, for example a detector with 4 modules with 2 UDP ports each will create a total of 8 files with file names containing UDP port index '_d0' to '_d7'.

A new file containing '_f[file_index]' in file name is also created when reaching the maximum frames per file. Configured using rx_framesperfile.

Naming

Master File Name: [fpath]/[fname]_master_[findex].[ext]
Data File Name: [fpath]/[fname]_dx_fy_[findex].[ext]
  • fpath: file path set using command fpath. Default: '/'
  • fname: file name prefix using command fname. Default: "run"
  • findex: acquisition index using command findex. Automatically incremented for every acquisition with sls_detector_acquire (if fwrite enabled).
  • x: unique udp port index. New file per UDP port.
  • y: file index. New file created after reaching max frames per file.
  • ext: file extension. Default: "raw"(data file) or "json"(master file)

Some file name examples:

# first file
path-to-file/run_d0_f0_0.raw

# first file for second UDP port
path-to-file/run_d1_f0_0.raw

# second file after reaching max frames in first file
path-to-file/run_d0_f1_0.raw

# second acquisition, first file
path-to-file/run_d0_f0_1.raw

Formats

There are 2 file formats supported by the receiver:

  • Binary - extension .json (master file) or .raw (data files)
  • HDF5 - extension .h5

The default is binary. HDF5 can be enabled by compiling the package with HDF5 option enabled. The file format is set using the command fformat.

Content

`Master File`: Contains the metadata of the acquisition. The content is described in master file attributes <master file attributes>.
`Data File`: Contains the metadata for each image (slsReceiverHeader<sls receiver header format>) and the data of the image transmitted over that port. The image data is described in Detector Image Size and Format <data format> section.
More content and examples are found in the HDF5 file format <hdf5 file format> and Binary file format <binary file format> sections.