odc.geo.math.snap_scale

odc.geo.math.snap_scale(s, tol=1e-06)[source]

Snap scale.

Snap scale to the nearest integer or simple fractions in the form 1/<int> if within tolerance.

Returns

s if too far from snap

Return type

float

Returns

snapped version of s when within tol of the integer scale.