Write the operational modal analysis pipeline for a monitored steel footbridge from logger records, sensor and calibration sheets and the monitoring plan; it is run on further records with known modal properties and stiffness changes.
harbor run -t reactive-labs/bridge-modal-idharbor download reactive-labs/bridge-modal-idYou are Maren Achterberg, structural engineer in the bridges group of Tarnholt Wray Structural Engineers LLP. The firm has monitored Kettlewath Footbridge, a 58 m steel footbridge of Ousemere Borough Council, with eight accelerometers since May 2024. Today is Tuesday 24 November 2026. Colm Brannigan, associate director, wrote this morning:
The Council's inspector found cracking at a girder splice on 3 November, and they want to know on 4 December what the monitoring shows: which modes have lost stiffness this year and since when. Dafydd's trend log cannot be defended and he has left. Please write the reduction of plan rev C as one script that takes a DL-8 record folder and writes the result, and run the ten 2026 assessment records I have pulled through it. Ngozi will check the script on her FE benchmark records before any number leaves the office.
In /app/inputs:
recordings/: ten 20-minute records of 2026, one folder each (KWF_YYYYMMDD_HHMM), holding the logger's binary
record (.bin) and its JSON sidecar.docs/: the monitoring plan KWF-MON-PLN-001 rev C, the baseline report KWF-DYN-RPT-002 rev B, the site log,
site visit note SV-05, the logger maker's firmware release notes and the e-mail thread with Colm, Ngozi and the
Council.layout/ and calibration/: the sensor layout sheet and the calibration register.legacy/: the previous engineer's script, his handover notes and his trend log./app/output/modal_id.py, run as
python3 /app/output/modal_id.py <record_dir> <out.json>
It reads one record folder in the format of the ten in hand and writes one JSON object:
| Key | Content |
|---|---|
record_id |
the record's id from the sidecar (not scored) |
modes |
object with exactly the keys L1, V1, T1, L2, V2 (the tracked modes of plan section 4) |
modes[m].frequency_hz |
natural frequency of the mode in the record, Hz (as it was, not normalised for temperature) |
modes[m].damping_pct |
damping ratio, per cent of critical |
modes[m].shape |
list of eight real numbers: the mode shape at P1 to P8, in that order, in bridge axes (vertical positions positive upwards, lateral positions positive towards north); scale and overall sign are free |
modes[m].sli_pct |
stiffness-loss indicator of plan section 7.2, per cent; null when the record is not assessed |
status |
the record's status under plan section 8: "normal", "watch", "action" or "not_assessed" |
The script runs with Python 3.12, numpy, scipy, pandas, openpyxl and python-docx, on one CPU core with 3 GB of
memory and no network, and must finish a record within 60 seconds. It is run as another user from a copy of
/app/output: it may load helper files that you put in /app/output (found relative to __file__), but
/app/inputs is not there when it runs.
/app/output/results/<record_id>.json for each of the ten records in hand: the script's output for that record.
Ngozi Abara, the technical reviewer, runs your script on the FE benchmark records of plan section 9: 32 further records from the same instrument, generated from the calibrated finite-element model with stiffness changes, temperatures, wind and pedestrian traffic of her choosing and written as the logger wrote its records at each stage of the monitoring system's history since May 2024. Your output is compared with what went into the model: the frequency, damping ratio and mode shape of each tracked mode in that record, the stiffness-loss indicator that plan section 7.2 gives for the model's frequency and the record's structure temperature, and the status that section 8 gives for those indicators. The ten result files are compared in the same way with her reduction of the ten records.
Each record scores up to 100 points:
| Item | Points | Full credit |
|---|---|---|
frequency_hz |
25 | within 0.4 % (L1: 0.6 %; L2: 1.0 %) |
damping_pct |
15 | within 60 % of the value |
shape |
20 | MAC with the reference shape of 0.98 or more |
sli_pct |
30 | within 0.8 percentage points (L1: 1.2; L2: 2.0); null exactly when the record is not assessed |
status |
10 | exact |
Frequency, damping and the indicator earn full credit within the stated error and fall linearly to nothing at twice that error; the shape credit falls linearly from MAC 0.98 to nothing at MAC 0.94. A mode's damping, shape and indicator credits are multiplied by that mode's frequency credit. For each of the first four items the credit is averaged over the five modes and multiplied by the points. A correct status earns the 10 points times the average indicator credit; a record whose status is wrong scores zero. A record on which the script fails, runs out of time or writes no readable JSON scores zero. The final score is 80 % the mean over the benchmark records and 20 % the mean over the ten result files.