def test_r_min_and_r_max(self): peak_array = np.empty(shape=(2, 3), dtype=np.object) for ix, iy in np.ndindex(peak_array.shape): peak_array[ix, iy] = np.random.randint(30, 70, size=(1000, 2)) peak_array_filtered0 = ct._filter_peak_array_radius(peak_array, 0, 0, r_min=20, r_max=25) for ix, iy in np.ndindex(peak_array_filtered0.shape): assert len(peak_array_filtered0[ix, iy]) == 0 peak_array_filtered1 = ct._filter_peak_array_radius(peak_array, 0, 0, r_min=20, r_max=100) for ix, iy in np.ndindex(peak_array_filtered1.shape): assert len(peak_array_filtered1[ix, iy]) == 1000 peak_array_filtered2 = ct._filter_peak_array_radius(peak_array, 0, 0, r_min=110, r_max=130) for ix, iy in np.ndindex(peak_array_filtered2.shape): assert len(peak_array_filtered2[ix, iy]) == 0
def test_xc(self): peak_array = np.empty(shape=(2, 3), dtype=np.object) for ix, iy in np.ndindex(peak_array.shape): peak_array[ix, iy] = np.random.randint(30, 70, size=(1000, 2)) peak_array_filtered = ct._filter_peak_array_radius(peak_array, 10, 50, r_min=10) for ix, iy in np.ndindex(peak_array_filtered.shape): assert len(peak_array_filtered[ix, iy]) == 1000
def test_yc(self): peak_array = np.empty(shape=(2, 3), dtype=np.object) for ix, iy in np.ndindex(peak_array.shape): peak_list = np.random.randint(30, 70, size=(999, 2)).tolist() peak_list.append([10, 50]) peak_array[ix, iy] = np.array(peak_list) peak_array_filtered = ct._filter_peak_array_radius(peak_array, 50, 10, r_min=10) for ix, iy in np.ndindex(peak_array_filtered.shape): assert len(peak_array_filtered[ix, iy]) == 999