import math


def _generate_resolution_shells(low, high):
    """Generate 9 evenly spaced in reciprocal space resolution
    shells from low to high resolution, e.g. in 1/d^2."""

    dmin = (1.0 / high) * (1.0 / high)
    dmax = (1.0 / low) * (1.0 / low)
    diff = (dmin - dmax) / 8.0

    shells = [1.0 / math.sqrt(dmax)]

    for j in range(8):
        shells.append(1.0 / math.sqrt(dmax + diff * (j + 1)))

    return shells