File types

From ADVACAM Wiki
Jump to navigation Jump to search

Under construction

  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction
  • Under construction

File type and extensions constants

These constants are file types and extensions. It can be used for filenames testing or with acquisition functions.

Python example:

# measure and save one 0.25 second frame to png file named "testFile.png"
dev.doSimpleAcquisition(1, 0.25, pixet.PX_FTYPE_PNG, "testFile")
dev.doSimpleAcquisition(1, 0.25, pixet.PX_FTYPE_AUTODETECT, "testFile.png")
File types and extensions constants table
File type constants File extensions constants Exts
PX_FTYPE_NONE (No direct file saving – data stored only in memory)
PX_FTYPE_AUTODETECT (FTYPE detected by extension in a filename)
PX_FTYPE_ASCII_FRAME PX_EXT_ASCII_FRAME "txt"
PX_FTYPE_BINARY_FRAME PX_EXT_BINARY_FRAME "pbf"
PX_FTYPE_MULTI_FRAME PX_EXT_MULTI_FRAME "pmf"
PX_FTYPE_BINARY_MULTIFRAME PX_EXT_BINARY_MULTI_FRAME "bmf"
PX_FTYPE_TPX3_PIXELS PX_EXT_TPX3_PIXELS "t3p"
PX_FTYPE_TPX3_PIXELS PX_ASCII PX_EXT_TPX3_PIXELS_ASCII "t3pa"
PX_FTYPE_CLUSTER_LOG PX_EXT_CLUSTER_LOG "clog"
PX_FTYPE_PIXEL_LOG PX_EXT_PIXEL_LOG "plog"
PX_FTYPE_PNG PX_EXT_PNG "png"
PX_FTYPE_TPX3_RAW_DATA PX_EXT_TPX3_RAW_DATA "t3r"
PX_FTYPE_PIXET_RAW_DATA PX_EXT_PIXET_RAW_DATA "prd"
PX_FTYPE_EXTERNAL (reserved)
(description file saved automatically with pmf/txt) PX_EXT_FRAME_DESC "dsc"
(index file saved automatically with pmf/txt) PX_EXT_INDEX "idx"
Files extensions summary
txt ASCII matrix: Text files with img lines converted to text lines with numbers separated by spaces.
pbf Simple binary files, numbers only.
pmf Multiple frames. Default is same as the txt, but multiple frames on top of each other. Can use BINARY flag.
t3pa Tpx3 pixels ASCII. Text format, tab-separated columns with the header in the first row. Biggest to saving.
t3p Tpx3 pixels. Binary format. Lower saved size, more complex to understand.
t3r Tpx3 raw data. Fastest to saving, difficult to understand, slow to processing and can cause processing errors.
bstg Binary settings file: Measured data with all configuration. See Binary Spectral Imaging API: BSTG files
clog, plog Clusters/pixels logs. Text files contains clusters separated to frames with pixels lists. Historic formats for saving a data with few hited pixels in a frames.
h5 HDF5, hierarchical data format 5. Used as one of multi-frame formats.
info Text file with "[FileInfo]" head and all metadata list.
dsc Text file with frame index first and all metadata list.
idx Binary index for multi-frame files. Usesfull for fast access to n-th frame.

File saving flags summary

File saving flags can do additional settings for file(s) saving.

  • Can be used in saving files or in doAdvancedAcquisition python methods, for example.
  • Flags can be combined.
  • Default frame file settings is set of separate subframes text files, with all pixels include zeros, each subframe with idx+dsc files:
file_ToT.pmf, file_ToT.pmf.dsc, file_ToT.pmf.idx, file_ToA.pmf, file_ToA.pmf.dsc, file_ToA.pmf.idx
File saving flags
Flag constant base name Description
PX_FRAMESAVE_BINARY Use binary format in pmf.
PX_FRAMESAVE_SPARSEX Index + non-zero pixels in file. # separates (sub)frs.
PX_FRAMESAVE_SPARSEXY X, Y + non-zero pixel in file. # separates (sub)frames.
PX_FRAMESAVE_NODSC Do not add dsc file.
PX_FRAMESAVE_NOSUBFRAMES Do not use subframes, save main frame only.
PX_FRAMESAVE_SUBFRAMES_ONEFILE Save all subframes to a single file.
PX_FRAMESAVE_SUBFRAMES_SAVEMAINFRAME Save separate all subframes and main frame extra.

File extensions and flags: TXT/PBF/PMF/BMF details

The files formats

txt Single frame in the text file.
pbf Pixet Binary Frame - Single frame in the binary file.
pmf Pixet Multi Frame - Multiframe file with text or binary format, depends on flags used with saving.
bmf Binary Multi Frame - Multiframe file with binary format, depends on flags used with saving.
idx Index for seeking - Binary array of 64b pointers to start of frames and subframes.
dsc Description. List of all metadata for each frame and subframe. Actual device and acquisition parameters, data types, etc. The "Frame name" item can be helpful to orientation in pmf structure if the ONEFILE flag used. The Type=item is helpful to understanding the structure of data if the BINARY flag used.

Multi-files names generation


flags 0 (default), input filename = "name", acqCount = 1
name_ToA.txt, name_ToA.txt.dsc, name_ToT.txt, name_ToT.txt.dsc


acqCount = 6
name_0_ToA.txt, name_0_ToA.txt.dsc, name_0_ToT.txt, ...
...
name_5_ToA.txt, name_5_ToA.txt.dsc, ...


PMF note
With each pmf generating .pmf.idx binary file, other is same as TXT with acqCount = 1.