Exact-answer checks of open measurement code: what they found in eleven packages
In plain terms
When software gives you an answer you cannot check against reality, there is a cheap way to find out whether it is doing what it says: give it a problem you built yourself, so you know the exact answer, and see what comes back. We did that for two kinds of scientific code. For the array software we found no mistake in the central calculation, which way a wave is travelling. We found plenty of smaller things around it: instructions that say the opposite of what the code does, a shortcut that overstates east-west distances away from the equator (by 36 percent at 43 degrees latitude), a setting that silently returns zero, a program that no longer starts on a current version of its numerical library, a default that behaves differently if you change the units of the data. Each is small. Together they show what an exact-answer check can turn up in about a day per field, in the places our tests happened to reach.
Key terms
- Sensor array
- A group of sensors (seismometers for ground motion, microphones for low-frequency sound) placed a few hundred metres to tens of kilometres apart and recorded together.
- Plane wave, delay
- A wave far from its source reaches the array as a flat front. Each sensor sees the same signal at a slightly different time; that time difference is its delay. The delays depend only on the sensor positions, the direction the wave comes from, and how fast it crosses the array.
- Back-azimuth
- The compass direction, measured clockwise from north, that the wave comes from. A wave from due east has back-azimuth 90 degrees.
- Slowness
- How many seconds the wave takes to cross one kilometre of the array (the inverse of its apparent speed). Array software estimates back-azimuth and slowness together.
- Known-truth fixture
- An input built so that the correct answer is known exactly, used to test software. Here: plane waves with delays computed from the formula, with no noise or with a stated amount of added noise.
- Signal-to-noise ratio (SNR)
- How large the signal is compared with added random noise. SNR 10 means the signal is ten times the noise.
- Deblending, photometry
- In an astronomical image, nearby galaxies overlap. Deblending splits the light between them so each one’s brightness (its photometry) can be measured.
- Detection image, threshold
- A deblending program first builds a single image in which sources should stand out, then decides what counts as a source by comparing it with a threshold.
- Issue, pull request
- On GitHub, an issue is a report or question left for a project’s maintainers; a pull request proposes a change to the code. A review is a comment on someone else’s pull request.
- MSE, RMSE
- Mean squared error is the average of squared differences. Root mean squared error is its square root, which is in the same units as the data.
1. Why check against known answers
The usual way to trust a measurement tool is to see that its output looks sensible on real data. That cannot catch a tool that is consistently off by a factor, a tool whose documentation disagrees with its behaviour, or a rarely used setting that returns nonsense. With real data you do not know the answer. With a constructed input you do, so every disagreement is attributable to the software or to the test, and the test is simple enough to inspect. The cost is that a constructed input only tests what you thought to construct.
2. The two kinds of software
2.1 Direction finding with sensor arrays
If a wave arrives from the north-east, sensors nearer the source see it earlier. From the delays at many sensors, array software works back to the direction and the slowness. Figure 1 shows the idea with a real array layout (13 sensors over 3.6 km) and a wave we constructed.

A worked example. Three sensors lie on an east-west line, 2 km apart. A wave comes from due east at 0.05 s per km, so the exact delays between neighbouring sensors are 0.100 s. One package, at latitude 42.8 degrees north, predicted delays 1.362 times larger (0.136 s): its plane-wave mode treated a degree of longitude as if it were as long as a degree of latitude. A direction computed from the wrong delays is wrong, and nothing in the output says so.
2.2 Measuring overlapping galaxies
Three astronomy packages were checked. Figure 2 shows what a blend is. scarlet-lite deblends: it separates overlapping sources in multi-band images. BlendingToolKit (BTK) simulates blended scenes and scores deblenders against the truth. SEP detects sources and measures their brightness with an aperture. The checks here are small and constructed: a scene rescaled to different flux units, arrays with known differences, small matching problems whose best answer can be enumerated, and known flux and centroid values.

data/btk_scenes_rband.npz). The right panel is the sum of the two left panels plus sky noise, which is all a deblending program is given. Its output is one image per source, like the two left panels, from which each source’s brightness is then measured. In scene 1 the smaller source nearly disappears into the larger one’s light. Simulated images, not real sky; shown on an arcsinh scale.3. Method
Array packages. Plane waves with exact fractional delays (Fourier phase shifts) on three real layouts: a 6-element infrasound array (largest pair 0.29 km; 0.34 km/s, 1 to 5 Hz) and two seismic arrays (13 elements over 3.6 km; 10 elements over 21.9 km; 0.05 s/km, 0.8 to 2 Hz). Twenty-four directions per layout, including the seams where compass directions wrap (0, 1, 179, 180, 181 and 359 degrees), noise-free and at SNR 10. The protocol (thresholds, directions, geometries) was fixed before any package was run, and its hash is checked when the harness loads. One rule was added during the sweep: where a docstring and the package’s own code disagree on a convention, both readings are run and the disagreement is reported as a documentation finding. Array_Seis_Circle was examined with targeted diagnostics rather than the full scored protocol.
Astronomy packages. The fixtures are listed in Table 2. The gates for the later tests in that program were written by us before scoring and were not registered with an outside party.
4. Results
4.1 Array packages
Table 1. Worst direction error over 24 known directions, noise-free, infrasound / seismic, in degrees.
| Package | Worst error | Finding |
|---|---|---|
| ObsPy array_processing | 0.41 / 1.95 | Used as the reference; no finding |
| obspy_arraytools | 0.41 / 1.95 | Identical to ObsPy in these checks |
array_processing, fk_freq | 0.21 / 1.0 | Docstring gives the coordinate order reversed and the output shape transposed |
| Array_Seis_Circle | targeted | Plane mode omits cos(latitude); sample shifts truncated; grid step mismatch; two docstring traps |
| SeisSeeker | 1.18 / 12.0 | One setting returns direction 0 and zero slowness for any input; a helper returns 405 for the point (1, 1) |
| RETREAT (least squares) | 0.55 / 10.1 | Does not import on NumPy 2 (run here with an alias) |
| infrapy | 0.12 / 12.2 | On the 22 km array the default Bartlett beam errs by up to 12 degrees; the covariance form gives 3.75 |
| lts_array | 0.48 / 10.2 | Windows with zero-sample pair delays returned NaN in 29 of 48 seismic cases (0 with pull request 39 applied) |
| VesPy; matched_field_processing_simple | not run | Python 2 only; a near-source locator, not a direction estimator |

data/array_results.csv). Seismic errors of several degrees are resolution limits at 20 Hz for tools that shift by whole samples or search a fixed grid: their median signed error is between 0.0 and 0.1 degrees noise-free. The two points at 180 degrees are not resolution limits. They are a docstring order that flips the answer and a setting that returns zero, and the second is not the default. The lts_array released-code row excludes the 29 cases that returned NaN.4.2 Two defects that offset each other (Array_Seis_Circle)
Two of the three defects in Array_Seis_Circle push the slowness in opposite directions. Shifting traces by a whole number of samples truncates toward zero, which overstates slowness. The grid used to search slowness has a slightly different step from the one used to read off the peak, which understates it. Applied separately and together to the same case:

data/asc_variants.csv). Fixing only the grid step makes slowness worse (orange), because the grid drift had been cancelling part of the truncation bias. Both together give the best result. The cos(latitude) defect affects plane-wave mode only and is not part of this figure.4.3 Astronomy packages
Table 2. Constructed checks of three astronomy packages.
| Package | Fixture | Result |
|---|---|---|
| scarlet-lite default initializer | The same two-source scene at two flux-unit scales | Scale 1: one 225-pixel PSF component per source. Scale 0.001: two extended components per source (57 and 1,581 pixels). Detection maximum 2.6 against threshold 5, versus 2,600 against 0.005. Final fit not tested |
BTK mse | Constant differences of 0, 2 and -3 | Returns [0, 2, 3]. Mean squared errors would be [0, 4, 9]; the function returns their square roots |
| BTK matching | 2, 3 and 4 source fixtures | Finds 1 of 2, 2 of 3 and 2 of 4 feasible pairs. Minimum total distance followed by radius rejection does not promise the largest number of pairs. Already described in BTK issue 345, which calls it very rare |
| SEP | Known flux, centroid and segmentation sums | Agrees |
The scarlet-lite check is a matter of units. The default detection image becomes smaller as the data are expressed in larger units, while the threshold becomes larger, so the same sky can take a different branch (Figure 5). A sweep of the same scene over six decades of scale (Figure 6) shows the branch changes between scale 0.3 and scale 1 and is otherwise constant on each side. We did not sample inside that interval.

data/scarlet_morphologies.npz, produced by code/scarlet_morphologies.py). At scale 1 each source starts from one point-spread-function-sized component; at scale 0.001 it starts from a compact component plus an extended one. Pixel counts are the non-zero pixels of each component’s starting shape.
data/scarlet_scale_sweep.csv, produced by code/scarlet_scale_sweep.py). If the threshold test is the only thing deciding the branch, the lines would cross where 2.6/a equals 5a, near a = 0.72; we sampled 0.3 and 1 and report only that the change lies between them. The LSST production caller supplies its own detection image and does not use this default.5. Every finding, and where it applies
A finding in a code path few people use matters less than one in a default. The last column says what we know about reach; it is not a measure of impact on any real result, which we did not test.
| # | Finding | Type | Where it applies | Reported |
|---|---|---|---|---|
| 1 | fk_freq docstring: coordinate order | Documentation | Anyone following the docstring; the code is right | array_processing issue |
| 2 | fk_freq docstring: output shape | Documentation | Anyone following the docstring; the code is right | array_processing issue |
| 3 | get_slow_baz direction type | Documentation | Anyone following the docstring (180-degree flip) | Array_Seis_Circle issue |
| 4 | calculate_locus angle direction | Documentation | Anyone following the docstring | Array_Seis_Circle issue |
| 5 | BTK mse returns RMSE | Documentation | Any use of that helper; downstream use not examined | BTK issue |
| 6 | Missing cos(latitude) | Approximation | Plane-wave mode only; curved mode is exact | Array_Seis_Circle issue |
| 7 | Whole-sample shifts truncated | Approximation | Sample shifting; shown here in curved mode | Array_Seis_Circle issue |
| 8 | Grid step differs from peak-reading step | Approximation | The four grid-search functions in one module | Array_Seis_Circle issue |
| 9 | One setting returns direction 0, slowness 0 | Wrong output | Non-default setting (default is the working one) | SeisSeeker issue |
| 10 | Scalar angle helper adds 360 | Wrong output | Latent: the package calls it on table columns | SeisSeeker issue |
| 11 | Import fails on NumPy 2 | Import or edge | Every user of that module on NumPy 2 | RETREAT issue |
| 12 | NaN at zero-sample pair delays | Import or edge | Compact arrays in released code | Already reported by others in 2024; we reviewed the open fix |
| 13 | Default detection image depends on flux units | Unit dependence | Only when no detection image is supplied; production code supplies one | scarlet-lite issue (as a question) |
| 14 | Matching can return fewer than the maximum pairs | Policy | BTK matching | Already described in BTK issue 345 |
| 15 | Bartlett beam averages complex spectra across sub-windows | Method choice | Default method with sub-windows on a 22 km array | infrapy issue (as a question) |
| 16 | Peak refinement is one-sided at the 180-degree seam | Method choice | A wave from due south came back as -180.12 degrees | infrapy issue |
Counts by type: documentation or name 5, approximation 3, wrong output 2, import or numerical edge 2, unit dependence 1, policy or method choice 3. Fourteen were reported by us and two were already known to others. Three packages had no finding (ObsPy array_processing as the reference, obspy_arraytools as identical to it, and SEP), so eight of eleven had at least one. A further documentation note for obspy_arraytools (a slowness unit, s/km documented against a s/deg default) was recorded in the sweep but not rerun and is not counted. None of the sixteen is a wrong direction convention, which the array fixtures were built to test. The wrong outputs we found came from a non-default branch (SeisSeeker), a geometry approximation (Array_Seis_Circle plane mode) and a failed import (RETREAT).
6. Checking ourselves
The same approach applies to our own work. Four cases:
- A flagging rule of ours was not distinct. A timing flag in our seismic quality-control brief was run against lts_array, an established least-trimmed-squares array processor, on the same synthetic fault records (one per family) that the brief uses. At a realistic sample rate, or with sub-sample peak interpolation, the established tool matched the flag on clock faults and flagged far fewer two-arrival records. The brief states that the timing check is not a distinct capability. One synthetic generator, previously examined.
- A posted sentence attributed results to the wrong change. Our Array_Seis_Circle report said rounding alone gives slowness within 2% and 0.8 degrees. Those figures belong to rounding plus the grid fix together (Figure 4). The text was corrected.
- Our own record named the wrong issue. The brief’s addendum said the lts_array zero-delay NaN was “reported upstream” as issue 33. That thread dates from 2024 and was opened by others; our contribution is a review of pull request 39. The text was corrected.
- Our astronomy checks were corrected in review. Isolated-source timings were first presented as per-scene medians; they are sums over 36 scenes. A 22-fold speedup belonged to a different, all-scene comparison. A claim that all tests used frozen gates was narrowed: the first was exploratory and one scoring addendum was written after detection counts were seen. Of the thirteen claim entries in that program’s ledger, seven were falsified by their own gates, three supported, one is in progress and two were not tested.
Table 3. The comparison in case 1 (counts of records; data from the quality-control brief’s addendum).
| Condition (records) | Our timing flag | lts_array 10 Hz | lts_array 100 Hz | lts_array 10 Hz, sub-sample peaks |
|---|---|---|---|---|
| Strong clock fault, familiar arrays (72): flagged / correct station | 72 / 70 | 66 / 65 | 72 / 72 | 72 / 72 |
| Strong clock fault, withheld array (120): flagged / correct | 120 / 120 | 105 / 105 | 120 / 120 | 120 / 120 |
| Weak clock fault (72): correct station | 64 | 3 | 64 | 66 |
| No fault, single wave, familiar (72): false flags | 2 | 9 | 2 | 1 |
| No fault, single wave, withheld (120): false flags | 0 | 12 | 1 | 3 |
| Two independent arrivals, withheld (120): flagged | 82 | 12 | 17 | 15 |
| Coherent echo, familiar (72): flagged | 53 | 34 | 28 | 34 |
The remaining wording differences found on rerun were small and are corrected in the posted text: “longer sub-windows help further” in the infrapy report held only at the full window (3.75, 3.93 and 2.77 degrees for 24, 48 and 96 second sub-windows); “about 100 m” was the mean station distance from the array centre while the largest pair is 290 m; and 3.75 had been written as 3.7.
7. Reports sent
Each report states the finding, a reproducer where one fits in a message, and the limits. Two were framed as questions because we could not tell whether the behaviour was intended. This paper does not track what happens to them; they are listed so the evidence can be found.
| Repository | Item | Posted |
|---|---|---|
| eejwa/Array_Seis_Circle | issue 6 | 19 Nov 2026 |
| TomSHudson/SeisSeeker | issue 6 | 19 Nov 2026 |
| paddy-seismic/retreat | issue 6 | 19 Nov 2026 |
| uafgeotools/array_processing | issue 53 | 19 Nov 2026 |
| LANL-Seismoacoustics/infrapy | issue 32 (question) | 19 Nov 2026 |
| uafgeotools/lts_array | review on pull request 39 | 19 Nov 2026 |
| lsst/scarlet_lite | issue 30 (question) | 24 Nov 2026 |
| LSSTDESC/BlendingToolKit | issue 542 | 24 Nov 2026 |
A maintainer’s reply or silence says nothing about whether a finding is correct. Each finding rests on a script anyone can run.
8. What this does and does not show
It shows that exact-answer fixtures, built in about a day for each field, turn up a range of small problems in widely used open packages, mostly outside the headline calculation; that the same fixtures can be applied to our own components and corrected claims; and that every number in the tables can be regenerated from the files listed below.
It does not show
- Prevalence. The packages were chosen because they were open, runnable and in two fields we work in. Eight of eleven having a finding is a statement about this set, not about scientific software.
- Impact. Whether any finding changes a published result is untested. Several sit in non-default paths. For the unit dependence, final fitted fluxes were not examined and the production caller bypasses the default.
- Agreement. Fixtures and readings were made by one author and rerun by the same author. No finding here has been confirmed by a maintainer or an independent party, and the maintainers may reasonably see some as documentation requests or as intended behaviour.
- Real data. The inputs are synthetic and exact. They test conventions and arithmetic, not performance on real wavefields or real survey images.
- A better method. Nothing here compares our approach with other ways of testing software, or claims others have not found the same things.
- The typology. The sixteen findings and their six types were assigned by us after the fact; another person could split or merge them.
9. Reproduction and data
Files that accompany this paper: data/array_results.csv (Table 1 and Figure 3), data/asc_variants.csv (Figure 4), data/btk_scenes_rband.npz (Figure 2), data/scarlet_morphologies.npz and code/scarlet_morphologies.py (Figure 5), data/scarlet_scale_sweep.csv and code/scarlet_scale_sweep.py (Figure 6), code/make_figures.py and code/make_galaxy_figures.py, and the rerun log with one row per posted claim. Each posted issue contains its own reproducer where one fits in a message. The array harness (one adapter per package, the frozen protocol and its hash) is not yet public.
Revisions tested, each the tip of its repository’s default branch when checked (19 to 24 November): Array_Seis_Circle 7f3b9f0, SeisSeeker d14d1d8, retreat 3ab5f74, array_processing 766292a, infrapy eca33ff, scarlet-lite ccef28ce and BlendingToolKit 6901e8c. Environment: NumPy 2.5.5, SciPy 1.18.1, ObsPy 1.5.2, numba 0.68.1. Two shims are stated in the lab book: a NumPy 2 import alias to run RETREAT, and loading SeisSeeker’s beamformer verbatim from source because its package import needs an unrelated dependency.
References
- Beyreuther M, et al. ObsPy: a Python toolbox for seismology. Seismol Res Lett 81:530 (2010).
- Bishop JW, Fee D, Szuberla CAL. Improved infrasound array processing with robust estimators. Geophys J Int 221:2058 (2020). lts_array, github.com/uafgeotools/lts_array.
- Melchior P, et al. SCARLET: source separation in multi-band images by constrained matrix factorization. Astron Comput 24:129 (2018).
- github.com/eejwa/Array_Seis_Circle/issues/6; github.com/TomSHudson/SeisSeeker/issues/6; github.com/paddy-seismic/retreat/issues/6; github.com/uafgeotools/array_processing/issues/53; github.com/LANL-Seismoacoustics/infrapy/issues/32; github.com/uafgeotools/lts_array/pull/39.
- github.com/lsst/scarlet_lite/issues/30; github.com/LSSTDESC/BlendingToolKit/issues/542 and /345.
- Parallax Metrology. Analyst-assisted seismic quality control (technical brief, 22 October 2026, addendum 19 November 2026).
- Parallax Metrology. Known-truth checks of an open deblending stack (draft note, 23 November 2026).