Files
slsDetectorPackage/docs/src/fileformat.rst
Dhanya Thattil 72056ff813
Some checks failed
Build on RHEL9 / build (push) Failing after 4m6s
Build on RHEL8 / build (push) Failing after 5m13s
Dev/doc architecture commands (#1272)
* wip for sw architecture

* wip:intro

* wip client wip

* documentation on architecutre is done. commands left

* wip. clientto module done

* almost done

* about 2nd port

* done

* review changes

* review fixes

* minor
2025-08-21 11:41:54 +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 modules 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.