Units and naming¶
Metric first¶
The library works in metric units: millimetres and metres for lengths, mm² for areas, kg/m
for cable weights and newtons for forces. Optical quantities use nm, THz, GHz, km, dB and
dBm. Imperial units are a translation layer at the edges, for input and display, through
units.
Two kinds of conversion are kept apart:
- Soft conversions
- A measured value (a cable's diameter, a weight) converted with an exact factor, such as 25.4 mm per inch. It is rounded only for display.
- Hard conversions
- A designation (a conduit trade size, a rebar size) that maps to its metric name by table, not by arithmetic. Metric designator 27 is trade size 1, not 25.4 mm.
Units in every name¶
Every quantity carries its unit in its name, so a value can't be read in the wrong unit:
| Suffix | Unit | Example |
|---|---|---|
_mm, _m, _km |
length | od_mm, length_km |
_mm2 |
area | area_mm2 |
_n |
force | tension_n |
_nm, _thz, _ghz |
wavelength, frequency | centre_nm, width_ghz |
_db |
ratio (loss, gain, margin) | loss_db, osnr_db |
_dbm |
power relative to 1 mW | launch_dbm |
_db_per_km |
attenuation coefficient | attenuation_db_per_km |
_ps, _us |
time | pmd_ps, latency_us |
Data files keep the units they were published in (od_in, weight_lb_per_ft), and the module
that reads a file converts them when it loads.