def _basetop(dprof: np.ndarray, pind: int) -> Tuple[int, int]: """Finds the base and top of peak in ldr or v profile.""" top = droplet.ind_top(dprof, pind, len(dprof), 10, 2) base = droplet.ind_base(dprof, pind, 10, 2) return base, top
def test_ind_base_4(self): mx = ma.masked_array(self.x, mask=[1, 0, 1, 1, 1, 0, 0]) dx = ma.diff(mx).filled(0) with pytest.raises(IndexError): droplet.ind_base(dx, self.peak_position, self.search_range, self.threshold)
def test_ind_base_3(self): small_threshold = 1.01 assert droplet.ind_base(self.dx, self.peak_position, self.search_range, small_threshold) == 4
def test_ind_base_2(self): huge_threshold = 5000 assert droplet.ind_base(self.dx, self.peak_position, self.search_range, huge_threshold) == 1
def test_ind_base_1(self): search_range = 100 assert droplet.ind_base(self.dx, self.peak_position, search_range, self.threshold) == 4
def _basetop(dprof, pind): """Finds the base and top of peak in ldr or v profile.""" top = droplet.ind_top(dprof, pind, len(dprof), 10, 2) base = droplet.ind_base(dprof, pind, 10, 2) return top, base