Station anomalies with exact coordinate alignment
Reconcile A/B and B/A station order explicitly, retain temperature difference units and refuse a positional scientific mismatch.
// Two station files have equal shapes but different coordinate order.
import aner.tensor
let current = tensor.semantic([[10.0], [20.0]], "station", List("A", "B"), "degC")
let baseline = tensor.semantic([[12.0], [9.0]], "station", List("B", "A"), "degC")
// Reindexing explicitly reconciles the declared coordinate identities.
let aligned = baseline.reindex_like(current)
let anomaly = current.subtract(aligned)
print("Baseline aligned to A, B")
print(aligned.value(0, 0))
print(aligned.value(1, 0))
print("Station anomalies")
print(anomaly.value(0, 0))
print(anomaly.value(1, 0))
print(anomaly.unit())
print("Coordinate order is preserved")
print(anomaly.coordinates())
print("First current temperature in Kelvin")
print(current.convert("K").value(0, 0))
Make it your experiment.
Use Aner 0.0.3 or newer. Save this program as examples/contextual_coordinates.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/contextual_coordinates.aner
aner run examples/contextual_coordinates.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Use Aner 0.0.4 or newer and VS Code helper 0.1.38 or newer. These deterministic examples execute on CPU Float64. Native contextual operations preserve declared identities and scientific contracts; supported backends and limits are operation specific. No network or external service is required. Intentional failure sources linked from each guide are negative tests, not successful tutorial programs.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution