For a rim check when you have two points and their elevations.
Width and grade come from those points. The distance is a haversine on a sphere of radius 1,737,400 m. Overlap uses the same sphere. It is not a geodesic survey.
Ok is not a road.
pip install -e .
PYTHONPATH=src python -m unittest tests.test_kernelPYTHONPATH=src python -m rimkeep examples/span.csvThe rest of this file is the rule that command prints.
--json prints one object. The process exit code is that object's exit. 0 is a pass word (ok, pass, scored, path). 1 is a refusal. 2 means the file could not be read. keep is false. absent is what this output does not contain: a stamp, measured basin months, and the points inside a .laz file.
This object is not WaterML and it is not a USGS response.
{
"absent": [
"stamp",
"measured_months",
"laz_points"
],
"desk": "rimkeep",
"exit": 0,
"formula": "On the rim is not a road.",
"keep": false,
"rows": [
{
"line": "ok on_rim=false slope=1.888809177 setback=80 width=303.2335042",
"word": "ok"
}
],
"word": "ok"
}For a traverse planner who wants to drive a crater rim.
Owner: Digital Currensy Inc. Copyright: 2026 Digital Currensy Inc. License: Apache-2.0. The file named LICENSE is the standard license and is not edited.
A crater-rim keep-out from on-rim, shadow setback, slope, and width. Ok is not a road. examples/span.csv computes the width as a haversine on the 1,737,400 m sphere and the slope as the grade of the two elevations over that width.
keep returns the first gate that trips, in this order:
on_rimis missing →missingon_rimis true →on_rim- slope, width, or PSR setback is present and negative →
missing - PSR setback is not missing and is under 50 m →
psr - slope or width is missing →
missing - slope is over 15 degrees →
slope - width is under 30 m →
thin - otherwise →
ok
Ok is not a road. A missing on_rim, slope, or width is not ok. The line prints on_rim, slope, setback, and width next to the word. A non-finite number is missing. A missing PSR setback does not fail by itself. A negative slope, width, or setback is missing. A non-finite overlap coordinate raises ValueError ("bad number") and is not treated as separate.
The overlap is a haversine on a 1,737,400 m sphere. It is not a surveyed control network. Disks overlap when that distance is less than the sum of the radii. A negative radius does not overlap. Ok is not a road.
examples/rim.csv uses the header on_rim,slope_deg,psr_m,width_m. It includes one on-rim row and one ok row. Empty fields mean missing. Worked rows are not a traverse plan and no elevation model is fetched.
git clone <this repo>
cd rimkeep
PYTHONPATH=src python -m unittest tests.test_kernel
PYTHONPATH=src python -m rimkeep examples/rim.csv
Python 3.11 or newer. No third-party packages.
Copyright 2026 Digital Currensy Inc. Apache-2.0.