RNPFI(5) File Formats Manual RNPFI(5)

rnpfiRad-Net Phase Function Indices

rnpfi is a binary file format for storing a list of indices referring to phase functions. The indices are attached to a volumetric mesh which is described there but must be defined in a separate file, for example in an smsh(5) file. The number of indices and their order must therefore correspond to the data of the mesh to which they are attached, i.e. to the nodes or cells listed in the corresponding mesh.

A rnpfi file is actually a Star-Buffer file (see sbuf(5)). It starts with a header of 4 integers. The first integer is a power of two (usually 4096) that defines the size of the memory page in bytes (pagesize) on which the list of indices are aligned. By aligning data to pagesize, and depending on system requirements, memory mapping can be used to automatically load/unload pages on demand (see mmap(2)). The second integer is the size of the array, i.e. the number of indices stored in the list. The two remaining integers store the memory size (4 bytes) and the memory alignment (4 bytes) of an index.

Padding bytes follow the file header to align the listed indices to pagesize.

Padding bytes are finally added at the end of the file to align its overall size with the size of a page.

Data are encoded with respect to the little endian bytes ordering, i.e. least significant bytes are stored first.

The file format is as follows:

rnpfi ::= pagesize⟩ ⟨size4 4
padding
indices
padding
pagesize ::= uint64_t
size ::= uint64_t # Number of indices stored
indices ::= uint32_t ...
padding ::= [int8_t ...]

mmap(2), sbuf(5), smsh(5)

The rnpfi format was first developed for the htrdr-planeto(1) program.

September 26, 2023 UNIX