def dogdec(signal, widths=None, angle=0, ellipticity=1, boundary="symm"): if widths is None: widths = np.arange(1, min(signal.shape) / 4) beams = [imgutils.GaussianBeam(ellipticity * w, w, bpa=angle) for w in widths] filtered = [b.convolve(signal, boundary=boundary) for b in beams] res = [(el[0] - el[-1]) for el in nputils.nwise(filtered, 2)] for s in res: s[s <= 0] = 0 res = [s - b2.convolve(s, boundary=boundary) for (s, (b1, b2)) in zip(res, nputils.nwise(beams, 2))] # res = [b1.convolve(s, boundary=boundary) - b2.convolve(s, boundary=boundary) for (s, (b1, b2)) in zip(res, nputils.nwise(beams, 2))] return res
def dogdec(signal, widths=None, angle=0, ellipticity=1, boundary="symm"): if widths is None: widths = np.arange(1, min(signal.shape) / 4) beams = [ imgutils.GaussianBeam(ellipticity * w, w, bpa=angle) for w in widths ] filtered = [b.convolve(signal, boundary=boundary) for b in beams] res = [(el[0] - el[-1]) for el in nputils.nwise(filtered, 2)] for s in res: s[s <= 0] = 0 res = [ s - b2.convolve(s, boundary=boundary) for (s, (b1, b2)) in zip(res, nputils.nwise(beams, 2)) ] # res = [b1.convolve(s, boundary=boundary) - b2.convolve(s, boundary=boundary) for (s, (b1, b2)) in zip(res, nputils.nwise(beams, 2))] return res
def pyramiddec(signal, widths=None, angle=0, ellipticity=1, boundary="symm"): if widths is None: widths = np.arange(1, min(signal.shape) / 4) beams = [imgutils.GaussianBeam(ellipticity * w, w, angle=angle) for w in widths] min_scale = beams[0].convolve(signal, boundary=boundary) - beams[1].convolve(signal, boundary=boundary) filtered_min = [b.convolve(min_scale, boundary=boundary) for b in beams] filtered_all = [b.convolve(signal, boundary=boundary) for b in beams] dog = [(el[0] - el[-1]) for el in nputils.nwise(filtered_all, 2)] return [v - k for k, v in zip(filtered_min, dog)]
def pyramiddec(signal, widths=None, angle=0, ellipticity=1, boundary="symm"): if widths is None: widths = np.arange(1, min(signal.shape) / 4) beams = [ imgutils.GaussianBeam(ellipticity * w, w, angle=angle) for w in widths ] min_scale = beams[0].convolve( signal, boundary=boundary) - beams[1].convolve(signal, boundary=boundary) filtered_min = [b.convolve(min_scale, boundary=boundary) for b in beams] filtered_all = [b.convolve(signal, boundary=boundary) for b in beams] dog = [(el[0] - el[-1]) for el in nputils.nwise(filtered_all, 2)] return [v - k for k, v in zip(filtered_min, dog)]