Ejemplo n.º 1
0
        np.linspace(-1, 1, nby),
        np.linspace(-1, 1, nbx),
        indexing="ij",
    )
    window = multivariate_normal.pdf(
        np.column_stack([grid_z.flat, grid_y.flat, grid_x.flat]),
        mean=mu,
        cov=covariance,
    )
    window = window.reshape((nbz, nby, nbx))
elif window_type == "tukey":
    comment = comment + "_tukey"
    window = pu.tukey_window(data.shape, alpha=alpha)
elif window_type == "blackman":
    comment = comment + "_blackman"
    window = pu.blackman_window(data.shape)
else:
    print("invalid window type")
    sys.exit()

if debug:
    fig, ax0 = plt.subplots(1, 1)
    plt.imshow(window[:, :, nbx // 2], vmin=0, vmax=window.max())
    plt.title("Window at middle frame")

    fig, ax0 = plt.subplots(1, 1)
    plt.plot(window[nbz // 2, nby // 2, :])
    plt.plot(window[:, nby // 2, nbx // 2])
    plt.plot(window[nbz // 2, :, nbx // 2])
    plt.title("Window linecuts at array center")
Ejemplo n.º 2
0
                        sum_frames=True,
                        title='Bragg peaks positions',
                        slice_position=pivot,
                        vmin=0,
                        vmax=1,
                        scale='linear',
                        cmap=my_cmap,
                        is_orthogonal=True,
                        reciprocal_space=True)
    plt.pause(0.1)

#########################
# define the peak shape #
#########################
peak_shape = pu.blackman_window(shape=(kernel_length, kernel_length,
                                       kernel_length),
                                normalization=100)

#####################################
# define the list of angles to test #
#####################################
angles_qx = np.linspace(
    start=angles_ranges[0],
    stop=angles_ranges[1],
    num=max(1,
            np.rint((angles_ranges[1] - angles_ranges[0]) / angular_step) + 1))
angles_qz = np.linspace(
    start=angles_ranges[2],
    stop=angles_ranges[3],
    num=max(1,
            np.rint((angles_ranges[3] - angles_ranges[2]) / angular_step) + 1))