Exemplo n.º 1
0
 def test_ind_top_4(self):
     mx = ma.masked_array(self.x, mask=[1, 0, 1, 0, 1, 0, 1, 0])
     dx = ma.diff(mx).filled(0)
     with pytest.raises(IndexError):
         droplet.ind_top(dx, self.peak_position, self.n_prof,
                         self.search_range, self.threshold)
Exemplo n.º 2
0
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
Exemplo n.º 3
0
 def test_ind_top_3(self):
     small_threshold = 1.01
     assert droplet.ind_top(self.dx, self.peak_position, self.n_prof,
                            self.search_range, small_threshold) == 3
Exemplo n.º 4
0
 def test_ind_top_2(self):
     huge_threshold = 5000
     assert droplet.ind_top(self.dx, self.peak_position, self.n_prof,
                            self.search_range, huge_threshold) == 7
Exemplo n.º 5
0
 def test_ind_top_1(self):
     search_range = 100
     assert droplet.ind_top(self.dx, self.peak_position, self.n_prof,
                            search_range, self.threshold) == 3
Exemplo n.º 6
0
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
Exemplo n.º 7
0
 def test_ind_top_0(self):
     assert (droplet.ind_top(self.dx, self.peak_position, self.n_prof,
                             self.search_range, self.threshold) == 3)