def METHOD_NAME(self, positionData, rmin, rmax):
    # Make a copy to work on, and sort it.
    n = len(positionData)
    rData = list(zip(positionData[:], list(range(n))))
    rData.sort()
    if rmin is None:
        rmin = min([x[0] for x in rData])
    if rmax is None:
        rmax = max([x[0] for x in rData])
    # Now build up the grid weighting based on the dr steps.
    weightData = np.zeros(n)
    for j in range(n):
        i = rData[j][1]
        if j == 0:
            r0 = max(rmin, min(rmax, rData[j][0]))
        else:
            r0 = max(rmin, min(rmax, 0.5*(rData[j-1][0] + rData[j][0])))
        if j == n - 1:
            r1 = max(rmin, min(rmax, rData[j][0]))
        else:
            r1 = max(rmin, min(rmax, 0.5*(rData[j][0] + rData[j+1][0])))
        weightData[i] = r1 - r0
        assert weightData[i] >= 0.0
    # That's it, we now have the grid weighting.
    assert len(weightData) == len(positionData)
    assert min(weightData) >= 0.0
    return weightData