Exact-answer checks of open measurement code: what they found in eleven packages

Russell Parrish, Parallax Metrology. Draft paper, 24 November 2026. Not peer reviewed.

Abstract. Much scientific software turns raw measurements into a number nobody can check directly. We checked eleven open-source packages by feeding them inputs whose correct answer we constructed ourselves: eight packages that estimate the direction of seismic and sound waves from sensor arrays (19 November 2026), and three that measure the brightness of overlapping galaxies in astronomical images (23 November 2026). In every array package the direction conventions (axis order, sign, back-azimuth versus azimuth) were correct in code. Around them we recorded sixteen findings, two of them already known to others: five where documentation or a name contradicts the code, three geometry or rounding approximations, two wrong outputs from a secondary branch or helper, two import or numerical-edge failures, one dependence on flux units in a default setting, and three about matching policy or method choice. Eight of the eleven packages had at least one finding. We reported fourteen of them to the maintainers as issues. We then reran every check: one sentence in our own report had its numbers attributed to the wrong change, and an earlier test had already shown one of our own flagging rules to be no better than an existing tool. All inputs are synthetic, the packages were not sampled, and nothing here estimates how common such problems are or how much they matter for real data.

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.

Left: a map of 13 sensors with parallel wavefronts approaching from the north-east and an arrow labelled back-azimuth 45 degrees. Right: thirteen copies of the same pulse arriving at slightly different times, from about 0 to 0.17 seconds.
Figure 1. The idea behind the array checks. A wave with a chosen direction (45 degrees) and slowness (0.05 s per km) crosses a real 13-sensor layout. Because we construct it, the arrival time at every sensor is exact, and a program’s answer can be compared with 45 degrees.

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.

Two rows of three greyscale image panels. Row one: a large elliptical galaxy alone, a small faint round source alone, and the combined noisy image in which the small source is almost invisible inside the large galaxy's light. Row two: a small oval source alone, a larger oval source alone, and the combined noisy image in which they overlap.
Figure 2. What a blend is. Each row is one simulated scene of two galaxies (BTK, built from real COSMOS galaxy images, LSST r band, 0.2 arcsec per pixel; data: 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.

PackageWorst errorFinding
ObsPy array_processing0.41 / 1.95Used as the reference; no finding
obspy_arraytools0.41 / 1.95Identical to ObsPy in these checks
array_processing, fk_freq0.21 / 1.0Docstring gives the coordinate order reversed and the output shape transposed
Array_Seis_CircletargetedPlane mode omits cos(latitude); sample shifts truncated; grid step mismatch; two docstring traps
SeisSeeker1.18 / 12.0One 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.1Does not import on NumPy 2 (run here with an alias)
infrapy0.12 / 12.2On the 22 km array the default Bartlett beam errs by up to 12 degrees; the covariance form gives 3.75
lts_array0.48 / 10.2Windows with zero-sample pair delays returned NaN in 29 of 48 seismic cases (0 with pull request 39 applied)
VesPy; matched_field_processing_simplenot runPython 2 only; a near-source locator, not a direction estimator
Dot plot on a log axis of worst direction error in degrees for each package and configuration, infrasound in blue and seismic in orange. Most blue dots lie between 0.1 and 1.2 degrees and most orange dots between 1 and 12 degrees. Two configurations, fk_freq with docstring coordinate order and SeisSeeker with remove_autocorr false, sit at 180 degrees.
Figure 3. Worst direction error by package and configuration (data: 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:

Dot plot of slowness error in percent for four rows. As released: plus 9, 9 and 7. Rounding only: minus 2, plus 4 and 0. Grid spacing only, in orange: plus 8, 12 and 15. Both: plus 2, plus 2 and minus 2. Worst direction errors are 3.4, 1.4, 2.5 and 0.8 degrees.
Figure 4. Slowness error for a 13-sensor, 3.6 km array at 100 Hz in curved-wave mode, for waves from 45, 200 and 300 degrees (data: 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.

PackageFixtureResult
scarlet-lite default initializerThe same two-source scene at two flux-unit scalesScale 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 mseConstant differences of 0, 2 and -3Returns [0, 2, 3]. Mean squared errors would be [0, 4, 9]; the function returns their square roots
BTK matching2, 3 and 4 source fixturesFinds 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
SEPKnown flux, centroid and segmentation sumsAgrees

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.

Top row: the two-source synthetic scene, then the single compact component each source receives at scale 1, 225 pixels each. Bottom row: at scale 0.001 each source receives two components, a compact one of 57 pixels and an extended one of 1,581 pixels.
Figure 5. The same two-source scene and the same settings at two flux-unit scales (data: 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.
Log-log plot against flux-unit scale from 0.0001 to 100. The detection image maximum falls from about 26,000 to 0.026 while the threshold rises from 0.0005 to 500. Left of scale 0.3 the scene gets two extended components per source; right of scale 1 it gets one PSF component per source; between them the branch change was not sampled.
Figure 6. The same scene expressed in different flux units (data: 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.

#FindingTypeWhere it appliesReported
1fk_freq docstring: coordinate orderDocumentationAnyone following the docstring; the code is rightarray_processing issue
2fk_freq docstring: output shapeDocumentationAnyone following the docstring; the code is rightarray_processing issue
3get_slow_baz direction typeDocumentationAnyone following the docstring (180-degree flip)Array_Seis_Circle issue
4calculate_locus angle directionDocumentationAnyone following the docstringArray_Seis_Circle issue
5BTK mse returns RMSEDocumentationAny use of that helper; downstream use not examinedBTK issue
6Missing cos(latitude)ApproximationPlane-wave mode only; curved mode is exactArray_Seis_Circle issue
7Whole-sample shifts truncatedApproximationSample shifting; shown here in curved modeArray_Seis_Circle issue
8Grid step differs from peak-reading stepApproximationThe four grid-search functions in one moduleArray_Seis_Circle issue
9One setting returns direction 0, slowness 0Wrong outputNon-default setting (default is the working one)SeisSeeker issue
10Scalar angle helper adds 360Wrong outputLatent: the package calls it on table columnsSeisSeeker issue
11Import fails on NumPy 2Import or edgeEvery user of that module on NumPy 2RETREAT issue
12NaN at zero-sample pair delaysImport or edgeCompact arrays in released codeAlready reported by others in 2024; we reviewed the open fix
13Default detection image depends on flux unitsUnit dependenceOnly when no detection image is supplied; production code supplies onescarlet-lite issue (as a question)
14Matching can return fewer than the maximum pairsPolicyBTK matchingAlready described in BTK issue 345
15Bartlett beam averages complex spectra across sub-windowsMethod choiceDefault method with sub-windows on a 22 km arrayinfrapy issue (as a question)
16Peak refinement is one-sided at the 180-degree seamMethod choiceA wave from due south came back as -180.12 degreesinfrapy 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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 flaglts_array 10 Hzlts_array 100 Hzlts_array 10 Hz, sub-sample peaks
Strong clock fault, familiar arrays (72): flagged / correct station72 / 7066 / 6572 / 7272 / 72
Strong clock fault, withheld array (120): flagged / correct120 / 120105 / 105120 / 120120 / 120
Weak clock fault (72): correct station6436466
No fault, single wave, familiar (72): false flags2921
No fault, single wave, withheld (120): false flags01213
Two independent arrivals, withheld (120): flagged82121715
Coherent echo, familiar (72): flagged53342834

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.

RepositoryItemPosted
eejwa/Array_Seis_Circleissue 619 Nov 2026
TomSHudson/SeisSeekerissue 619 Nov 2026
paddy-seismic/retreatissue 619 Nov 2026
uafgeotools/array_processingissue 5319 Nov 2026
LANL-Seismoacoustics/infrapyissue 32 (question)19 Nov 2026
uafgeotools/lts_arrayreview on pull request 3919 Nov 2026
lsst/scarlet_liteissue 30 (question)24 Nov 2026
LSSTDESC/BlendingToolKitissue 54224 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

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

  1. Beyreuther M, et al. ObsPy: a Python toolbox for seismology. Seismol Res Lett 81:530 (2010).
  2. 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.
  3. Melchior P, et al. SCARLET: source separation in multi-band images by constrained matrix factorization. Astron Comput 24:129 (2018).
  4. 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.
  5. github.com/lsst/scarlet_lite/issues/30; github.com/LSSTDESC/BlendingToolKit/issues/542 and /345.
  6. Parallax Metrology. Analyst-assisted seismic quality control (technical brief, 22 October 2026, addendum 19 November 2026).
  7. Parallax Metrology. Known-truth checks of an open deblending stack (draft note, 23 November 2026).