Skip to main content

Scan Parameters (Generic Records)

ScanParameters, GenericDataHeader/Descriptor/Record

25. ScanParameters

Per-scan metadata (also called "trailer extra" in Thermo parlance). Located at RunHeader.scan_params_addr.

This stream is self-describing: a GenericDataHeader defines the field layout, followed by one GenericRecord per scan. The GenericDataHeader is NOT stored at scan_params_addr itself; it is located somewhere between RunHeader.error_log_addr and RunHeader.scan_trailer_addr in the file, typically near the instrument log. It is found by scanning forward from error_log_addr looking for a valid GDH whose fixed_record_size() matches (file_size − scan_params_addr) / num_scans.

25.1 Stream Layout at scan_params_addr

Records begin directly at scan_params_addr - there is no preamble u32 or any other header at this offset. The file may contain a few trailing bytes (typically 4-8) after the last record; these are not part of any scan.

Byte offsetDescription
0First byte of Record[0] (first scan)
record_sizeFirst byte of Record[1]
......
(num_scans − 1) × record_sizeFirst byte of Record[num_scans − 1]
num_scans × record_sizeOptional trailing bytes (instrument-dependent)

25.2 Locating the GenericDataHeader

The GDH for the ScanParameters stream is stored in the region bounded by RunHeader.error_log_addr (inclusive) and RunHeader.scan_trailer_addr (exclusive). Because the instrument log, error log, and ScanParameters GDH may be interleaved in this region, the reader locates the GDH by linear forward scan:

  1. Compute expected_record_size = (file_size − scan_params_addr) / num_scans (integer division).
  2. Scan from error_log_addr toward scan_trailer_addr, attempting to decode a GenericDataHeader at each plausible alignment.
  3. Accept the first GDH whose fixed_record_size() equals expected_record_size (first pass). If no exact match is found, accept any structurally valid GDH (second pass).

25.3 Common Fields

The exact field set and order vary by instrument family and firmware version. Representative fields:

LabelTypeDescription
"Ion Injection Time (ms):"Float32 or Float64Fill time in ms
"Charge State:"Int32Precursor charge (0 = MS1 / unknown)
"Monoisotopic M/Z:"Float64Monoisotopic precursor m/z (0 = not determined)
"Master Scan Number:"Int32Parent MS1 scan number (−1 = none)
"Master Index:"Int32Alternative master scan reference (newer firmware)
"Micro Scan Count:"Int32Number of micro-scans averaged
"Scan Segment:"Int32Segment index
"Scan Event:"Int32Event index within segment
"Orbitrap Resolution:"Int32Resolving power (older firmware)
"FT Resolution:"Int32Resolving power (newer firmware)
"HCD Energy:"AsciiStringCollision energy (may be stepped, e.g. "27 30 33")
"Elapsed Scan Time (sec):"Float32 or Float64Scan duration
"AGC:"Bool or AsciiStringAGC on/off ("On " / "Off")
"AGC Target:"Int32Target ion count
"Max. Ion Time (ms):"Float64Maximum allowed fill time
"Number of LM Found:"Int32Number of lock masses matched
"LM Correction (ppm):"Float64Applied lock-mass correction

Older LTQ Orbitrap instruments prepend one or more empty-label AsciiString fields (containing \t-separated internal state) before the human-readable fields above.


26. GenericDataHeader

Self-describing header that defines the schema for GenericRecord streams.

OrderTypeFieldDescription
1UInt32nNumber of field descriptors
2GenericDataDescriptor[n]fieldsArray of field descriptors

After decoding, the header produces a template list used to decode each subsequent GenericRecord.


27. GenericDataDescriptor

A single field descriptor within a GenericDataHeader.

OrderTypeFieldDescription
1UInt32typeData type code (see table below)
2UInt32lengthByte length (for string types)
3PascalStringWin32labelHuman-readable field name

27.1 Type Codes

CodeTypeSizeDescription
0x0-0Gap/section separator (no data)
0x1Int81Signed byte
0x2UInt81Boolean (true/false)
0x3UInt81Boolean (yes/no)
0x4UInt81Boolean (on/off)
0x5UInt81Unsigned byte
0x6Int162Signed short
0x7UInt162Unsigned short
0x8Int324Signed long
0x9UInt324Unsigned long
0xAFloat324Single-precision float
0xBFloat648Double-precision float
0xCStringlengthASCIIZ string
0xDWStringlength × 2UTF-16-LE null-terminated string

28. GenericRecord

A single data record decoded using the templates generated by a GenericDataHeader. The fields are read sequentially in the order defined by the header's descriptor array.

Each field's type and size are determined by the corresponding GenericDataDescriptor. Type 0x0 (gap) produces no data - it is a label-only separator.