Beispiel #1
0
save_fig = True  # if True, will save the figure of the final support
comment = ""  # should start with _
#####################################
# parameters for gaussian filtering #
#####################################
filter_name = (
    "skip"  # apply a filtering kernel to the support, 'skip' or 'gaussian_highpass'
)
gaussian_sigma = 4.0  # sigma of the gaussian filter
######################################################################
# parameters for image deconvolution using Richardson-Lucy algorithm #
######################################################################
psf_iterations = 0  # number of iterations of Richardson-Lucy deconvolution,
# leave it to 0 if unwanted
psf_shape = (10, 10, 10)
psf = util.gaussian_window(window_shape=psf_shape, sigma=0.3, mu=0.0, debugging=False)
###########################
# experimental parameters #
###########################
energy = 10235  # in eV
tilt_angle = 0.25  # in degrees
distance = 5  # in m
pixel_x = 75e-06  # in m, horizontal pixel size of the detector,
# including an eventual preprocessing binning
pixel_y = 75e-06  # in m, vertical pixel size of the detector,
# including an eventual preprocessing binning
###########################################################################
# parameters used only when the data is in the detector frame (Bragg CDI) #
###########################################################################
beamline = "ID01"  # name of the beamline, used for data loading and
# normalization by monitor and orthogonalisation
Beispiel #2
0
        sum_frames=False,
        reciprocal_space=False,
        is_orthogonal=True,
        vmin=0,
        vmax=1,
        plot_colorbar=True,
        title=f"support at threshold {isosurface_threshold}",
    )

###################################
# calculate the blurring function #
###################################
psf_guess = util.gaussian_window(
    window_shape=obj.shape,
    sigma=sigma_guess,
    mu=0.0,
    voxel_size=voxel_size,
    debugging=debug,
)
psf_guess = psf_guess / min_obj  # rescale to the object original min
psf_partial_coh, error = algo.partial_coherence_rl(
    measured_intensity=obj,
    coherent_intensity=support,
    iterations=rl_iterations,
    debugging=False,
    scale="linear",
    is_orthogonal=True,
    reciprocal_space=False,
    guess=psf_guess,
)
Beispiel #3
0
 def test_3d_pad(self):
     data = np.zeros((4, 32, 32))
     data[:-1, -13:, 17:30] = util.gaussian_window(window_shape=(3, 13, 13))
     self.assertTrue(
         np.unravel_index(abs(data).argmax(), data.shape) == (1, 25, 23))
Beispiel #4
0
 def setUp(self) -> None:
     data = np.zeros((4, 32, 32))
     data[:-1, -13:, 17:30] = gaussian_window(window_shape=(3, 13, 13))
     self.data = data
Beispiel #5
0
 def test_3d(self):
     window = util.gaussian_window(window_shape=(3, 13, 13))
     self.assertTrue(
         np.unravel_index(abs(window).argmax(), window.shape) == (1, 6, 6))