def surfd(X, Xmap, bins, Xerr=None, Xmaperr=None, boot=False, scale=1.0, return_err=False, smooth=False):
    '\n    call: surfd(X, map, bins,\n                    xerr = None, merr = None, scale = 1.)\n    calculates H(X)/H(M) = Nx pdf(x) dx / Nm pdf(m) dm ; dm = dx\n          so it is independent of whether dx or dlog(x)\n    '
    if boot:
        n = np.histogram(bootstrap(X, Xerr, smooth=True), bins=bins, range=(bins.min(), bins.max()))[0]
        s = (np.histogram(bootstrap(Xmap, Xmaperr, smooth=True), bins=bins, range=(bins.min(), bins.max()))[0] * scale)
    else:
        n = np.histogram(X, bins=bins, range=(bins.min(), bins.max()))[0]
        s = (np.histogram(Xmap, bins=bins, range=(bins.min(), bins.max()))[0] * scale)
    if (not return_err):
        return (n / s)
    else:
        return ((n / s), ((n / s) * np.sqrt(((1.0 / n) - (scale / s)))))
call: surfd(X, map, bins,
                xerr = None, merr = None, scale = 1.)
calculates H(X)/H(M) = Nx pdf(x) dx / Nm pdf(m) dm ; dm = dx
      so it is independent of whether dx or dlog(x)
def surfd(X, Xmap, bins, Xerr=None, Xmaperr=None, boot=False, scale=1.0, return_err=False, smooth=False):
    '\n    call: surfd(X, map, bins,\n                    xerr = None, merr = None, scale = 1.)\n    calculates H(X)/H(M) = Nx pdf(x) dx / Nm pdf(m) dm ; dm = dx\n          so it is independent of whether dx or dlog(x)\n    '
    if boot:
        n = np.histogram(bootstrap(X, Xerr, smooth=True), bins=bins, range=(bins.min(), bins.max()))[0]
        s = (np.histogram(bootstrap(Xmap, Xmaperr, smooth=True), bins=bins, range=(bins.min(), bins.max()))[0] * scale)
    else:
        n = np.histogram(X, bins=bins, range=(bins.min(), bins.max()))[0]
        s = (np.histogram(Xmap, bins=bins, range=(bins.min(), bins.max()))[0] * scale)
    if (not return_err):
        return (n / s)
    else:
        return ((n / s), ((n / s) * np.sqrt(((1.0 / n) - (scale / s)))))