def estimate_scales(spectrum, centers, box_width, scale_axis=0):
    shape = spectrum.shape
    bcenters = np.round(np.array(centers).astype('int'))
    scales = []
    # loop over the box centers
    for bc in bcenters:

        # calculate box limits
        bmin = [max(c - w, 0) for c, w in zip(bc, box_width)]
        bmax = [min(c + w + 1, s) for c, w, s in zip(bc, box_width, shape)]

        # cut the spectrum and squish
        s = tuple([slice(mn, mx) for mn, mx in zip(bmin, bmax)])
        scale = squish(spectrum[s], scale_axis)
        scale = scale / scale[0]
        scales.append(scale[1:])
    return scales


# User facing fit/simulation functions
Estimate scale parameter for peaks in a spectrum.
dataset/ETHPy150Open jjhelmus/nmrglue/nmrglue/analysis/linesh.py/estimate_scales