measurement_stats
Aggregate .MEAS scalar results across .step sweeps or Monte Carlo runs. Compute min, max, mean, median, std, and percentiles to identify worst-case values and parameter drift.
Instructions
Use to AGGREGATE .MEAS scalar results across a .step sweep or Monte Carlo run. Answers questions like 'across 100 MC trials, what's the worst-case rise time?' or 'how does gain vary as R sweeps 1k..10k?'. Inputs the .log file produced by the run.
Returns per-measurement: min, max, mean, median, std, p10, p90, min_step_index (argmin) and max_step_index (argmax), failure count, and an optional histogram (set histogram_bins=0 to skip).
Accepts any job id: a sweep/MC batch aggregates across its runs; a single-simulation job aggregates its own log (one value per step for a .step run). WHEN-style .MEAS (constant level, varying crossing) is detected the same way on both paths and swaps to aggregating the 'at' (crossing) field; the aggregated_field output says which was used. On a plain single run, stats collapse to n=1 (one value per measurement): the headline stats are the value the simulator printed — for a WHEN that's the trigger level — and any AT/crossing time is returned separately in the entry's 'at' field, so a single-run WHEN/AT read isn't lost. (simulation_summary also just reads the raw scalars.)
Works with .MEAS from any analysis type (.tran/.ac/.dc/.op) — the measurement directives themselves embed the analysis context. Pass measurement=NAME to aggregate just one; otherwise returns all .MEAS in the log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | 'json' or 'text' | |
| job_id | No | Job ID. For a batch job (``run_montecarlo`` / ``run_sweep``) the tool loads each completed run's log, concatenates the .MEAS results (one row per run), and aggregates. For a completed single-simulation job it aggregates that run's log (per-step values for a .step run). Mutually exclusive with ``log_file``. | |
| log_file | No | Path to .log file from a single ``.step`` run that already concatenates every step's .MEAS results. For Monte Carlo / multi-run sweep jobs that emit one log per run, pass ``job_id`` instead and the aggregator walks every run's log. | |
| measurement | No | If given, stats for only this .MEAS; otherwise all measurements. | |
| histogram_bins | No | Histogram bin count. Set to 0 to skip histogram computation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes | ||
| per_run | No |