utils

module of dascore.io.sr4731 source

Utilities for reading SR-4731 OTDR SOR files.

SR-4731 is the Telcordia OTDR Data Format. This implementation currently supports the OFL100/FIBERCLOUD subset seen in DASCore’s ofl100_*.sor test files and makes these specific assumptions:

  • The file starts with a Map block and contains GenParams, SupParams, FxdParams, DataPts, and Cksum blocks.
  • The map block version is 200.
  • SupParams stores manufacturer, model, and serial number in the first three null-separated fields.
  • FxdParams exposes the timestamp, distance unit, wavelength, pulse width, sample spacing, index of refraction, averaging, and display range fields documented in _parse_fixed_params.
  • FxdParams carries exactly one pulse-width entry. The fields after it sit at fixed offsets which a second entry would shift, so a file declaring another count is refused rather than silently misread.
  • The averaging time is read as the standard’s tenths of a second. Several vendors write that field on their own scale, so only a supplier known to keep the standard has it read as a duration, which is then both reported and promoted to the time coordinate’s step. Every other file keeps the bare instant and states no averaging time.
  • DataPts is a single unsegmented trace with unsigned little-endian 16-bit samples and the display scale documented in _parse_data_points.
  • Trace samples follow pyotdr’s SR-4731 display convention: (max_raw - raw) * scale / 1_000_000.
  • Distance spacing is derived from sample spacing and index of refraction.
  • Key events, proprietary blocks, and checksums are not parsed or validated.

Classes

Name Description
Block A SOR block map entry.
SR4731PatchAttrs Patch attributes for supported SR-4731 SOR files.