srxraylib.waveoptics package
Submodules
srxraylib.waveoptics.CompactAFReader module
srxraylib.waveoptics.NumpyToSRW module
srxraylib.waveoptics.polarization module
Polarization class (deprecated, use wofry/wofrylib instead).
srxraylib.waveoptics.propagator module
1D wave-optics propagators.
- srxraylib.waveoptics.propagator.propagate_1D_fraunhofer(wavefront, propagation_distance=0.0, shift_half_pixel=0)[source]
1D Fraunhofer propagator using convolution via Fourier transform :param shift_half_pixel: :param shift_half_pixel: :param wavefront: :param propagation_distance: propagation distance. If set to zero, the abscissas
of the returned wavefront are in angle (rad)
- Returns:
a new 1D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator.propagate_1D_fresnel(wavefront, propagation_distance)[source]
1D Fresnel propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: propagation distance :return: a new 1D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator.propagate_1D_fresnel_convolution(wavefront, propagation_distance)[source]
1D Fresnel propagator using direct convolution :param wavefront: :param propagation_distance: :return:
- srxraylib.waveoptics.propagator.propagate_1D_fresnel_radius(wavefront, propagation_distance, eta)[source]
1D Fresnel propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: propagation distance :return: a new 1D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator.propagate_1D_integral(wavefront, propagation_distance, detector_abscissas=[None], method=0, magnification=1.0, npoints_exit=None)[source]
1D Fresnel-Kirchhoff propagator via integral implemented as sum :param wavefront: :param propagation_distance: propagation distance :param detector_abscissas: a numpy array with the abscissas at the image position. If undefined ([None])
it uses the same abscissas present in input wavefront.
- Parameters:
method – 0 (default_ makes a loop over detector coordinates, 1: makes matrices (outer products) so it is more memory hungry.
magnification – if detector_abscissas is [None], the detector abscissas range is the input wavefront range times this magnification factor. Default =1
npoints_exit – if detector_abscissas is [None], the number of points of detector abscissas. Default=None meaning that the same number of points than wavefront are used.
- Returns:
a new 1D wavefront object with propagated wavefront
srxraylib.waveoptics.propagator2D module
2D wave-optics propagators: Fraunhofer, Fresnel, etc.
- srxraylib.waveoptics.propagator2D.propagate_2D_fraunhofer(wavefront, propagation_distance=1.0, shift_half_pixel=0)[source]
2D Fraunhofer propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: propagation distance. If set to zero, the abscissas
of the returned wavefront are in angle (rad)
- Parameters:
shift_half_pixel – set to 1 to shift half pixel (recommended using an even number of pixels) Set as default.
- Returns:
a new 2D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator2D.propagate_2D_fresnel(wavefront, propagation_distance, shift_half_pixel=1)[source]
2D Fresnel propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: propagation distance :param shift_half_pixel: set to 1 to shift half pixel (recommended using an even number of pixels) Set as default. :return: a new 2D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator2D.propagate_2D_fresnel_convolution(wavefront, propagation_distance, shift_half_pixel=1)[source]
2D Fresnel propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: propagation distance :param shift_half_pixel: set to 1 to shift half pixel (recommended using an even number of pixels) Set as default. :return: a new 2D wavefront object with propagated wavefront
- srxraylib.waveoptics.propagator2D.propagate_2D_fresnel_srw(wavefront, propagation_distance, srw_autosetting=0)[source]
2D Fresnel propagator using convolution via Fourier transform :param wavefront: :param propagation_distance: :param srw_autosetting:set to 1 for automatic SRW redimensionate wavefront :return:
- srxraylib.waveoptics.propagator2D.propagate_2D_integral(wavefront, propagation_distance, shuffle_interval=0, calculate_grid_only=1)[source]
2D Fresnel-Kirchhoff propagator via simplified integral
- NOTE: this propagator is experimental and much less performant than the ones using Fourier Optics
Therefore, it is not recommended to use.
- Parameters:
wavefront –
propagation_distance – propagation distance
shuffle_interval –
it is known that this method replicates the central diffraction spot The distace of the replica is proportional to 1/pixelsize To avoid that, it is possible to change a bit (randomly) the coordinates of the wavefront. shuffle_interval controls this shift: 0=No shift. A typical
value can be 1e5. The result shows a diffraction pattern without replica but with much noise.
calculate_grid_only – if set, it calculates only the horizontal and vertical profiles, but returns the full image with the other pixels to zero. This is useful when calculating large arrays, so it is set as the default.
- Returns:
a new 2D wavefront object with propagated wavefront
srxraylib.waveoptics.wavefront module
1D wavefront class (deprecated, use wofry/wofrylib instead).
- class srxraylib.waveoptics.wavefront.Wavefront1D(wavelength=1e-10, electric_field_array=None)[source]
Bases:
object- electric_field_array = None
- classmethod initialize_wavefront_from_range(x_min=0.0, x_max=0.0, number_of_points=1000, wavelength=1e-10)[source]
- classmethod initialize_wavefront_from_steps(x_start=0.0, x_step=0.0, number_of_points=1000, wavelength=1e-10)[source]
- wavelength = 0.0
srxraylib.waveoptics.wavefront2D module
2D wavefront class (deprecated, use wofry/wofrylib instead).
- class srxraylib.waveoptics.wavefront2D.Wavefront2D(wavelength=1e-10, electric_field_array=None, electric_field_array_pi=None)[source]
Bases:
object- electric_field_array = None
- get_mask_grid(width_in_pixels=(1, 1), number_of_lines=(1, 1))[source]
- Parameters:
width_in_pixels – (pixels_for_horizontal_lines,pixels_for_vertical_lines
number_of_lines – (number_of_horizontal_lines, number_of_vertical_lines)
- Returns:
- classmethod initialize_wavefront_from_arrays(x_array, y_array, z_array, z_pi_array=None, wavelength=1e-10)[source]
- classmethod initialize_wavefront_from_range(x_min=0.0, x_max=0.0, y_min=0.0, y_max=0.0, number_of_points=(100, 100), wavelength=1e-10, polarization=0)[source]
- classmethod initialize_wavefront_from_steps(x_start=0.0, x_step=0.0, y_start=0.0, y_step=0.0, number_of_points=(100, 100), wavelength=1e-10, polarization=0)[source]
- rebin(expansion_points_horizontal, expansion_points_vertical, expansion_range_horizontal, expansion_range_vertical, keep_the_same_intensity=0, set_extrapolation_to_zero=0)[source]
- set_spherical_wave(radius=1.0, complex_amplitude=1.0)[source]
- Parameters:
complex_amplitude –
radius – Positive radius is divergent wavefront, negative radius is convergent
- Returns:
- wavelength = 0.0