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.

Return type:

float

Returns:

s if too far from snap

Returns:

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