Physics

Physics on the light path.

syris.physics.compute_aliasing_limit(n, wavelength, pixel_size, propagation_distance, fov=None, fourier=True)

Get the non-aliased fraction of data points when propagating a wavefield to a region n
\times pixel\_size to propagation_distance using wavelength, pixel_size and field of view fov (if not specified computed as n * pixel_size). If fourier is True then the limit is computed for the Fourier space.

syris.physics.compute_collection(num_aperture, opt_ref_index)

Get the collection efficiency of the scintillator combined with a lens. The efficiency is given by \eta = \frac{1 - \sqrt{1 - \left( \frac{N\!A}{n} \right)^2}}{2}, where N\!A is the numerical aperture num_aperture of the lens, n is the optical refractive index opt_ref_index given by the Scintillator.

syris.physics.compute_diffraction_angle(diameter, propagation_distance)

Compute the diffraction angle for a region where a wavefield within the diameter can interfere on a propagation_distance.

syris.physics.compute_propagation_distance_limit(n, wavelength, pixel_size)

Compute the propagation distance which just fits the sampling theorem for n pixels, wavelength and pixel_size.

syris.physics.compute_propagation_sampling(wavelength, distance, fov, fresnel=True)

Compute the required number of pixels and pixel size in order to satisfy the sampling theorem when propagating a wavefield with wavelength to distance and we want to propagate field of view fov. If fresnel is true, the same distance computation approximation is done as when computing a Fresnel propagator (2nd order Taylor series expansion for the square root).

syris.physics.compute_propagator(size, distance, lam, pixel_size, fresnel=True, region=None, apply_phase_factor=False, mollified=True, queue=None, block=False)

Create a propagator with (size, size) dimensions for propagation distance, wavelength lam and pixel_size. If fresnel is True, use the Fresnel approximation, if it is False, use the full propagator (don’t approximate the square root). region is the diameter of the the wavefront area which is capable of interference. If apply_phase_factor is True, apply the phase factor defined by Fresnel approximation. If mollified is True the aliased frequencies are suppressed. If command queue is specified, execute the kernel on it. If block is True, wait for the kernel to finish.

syris.physics.energy_to_wavelength(energy)

Convert energy [eV-like] to wavelength [m].

syris.physics.is_wavefield_sampling_ok(wavefield_exponent, queue=None, out=None)

Check the sampling of the wavefield_exponent. Use OpenCL queue and out array. Return True if the sampling is OK, False otherwise.

syris.physics.propagate(samples, shape, energies, distance, pixel_size, region=None, apply_phase_factor=False, mollified=True, detector=None, offset=None, queue=None, out=None, t=None, check=True, block=False)

Propagate samples with shape as (y, x) which are syris.opticalelements.OpticalElement instances at energies to distance. Use pixel_size, limit coherence to region, apply_phase_factor is as by the Fresnel approximation phase factor, offset is the sample offset. queue an OpenCL command queue, out a PyOpenCL Array. If block is True, wait for the kernels to finish. If check is True, check the transmission function sampling.

syris.physics.ref_index_to_attenuation_coeff(ref_index, lam)

Convert refractive index to the linear attenuation coefficient given by \mu = \frac{4 \pi \beta}{\lambda} based on given ref_index and wavelength lam.

syris.physics.transfer(thickness, refractive_index, wavelength, exponent=False, queue=None, out=None, check=True, block=False)

Transfer thickness (can be either a numpy or pyopencl array) with refractive_index and given wavelength. If exponent is True, compute the exponent of the function without applying the wavenumber. Use command queue for computation and out pyopencl array. If block is True, wait for the kernel to finish. If check is True, the function is checked for aliasing artefacts. Returned out array is different from the input one because of the pyopencl.clmath behavior.

syris.physics.transfer_many(objects, shape, pixel_size, energy, exponent=False, offset=None, queue=None, out=None, t=None, check=True, block=False)

Compute transmission from more objects. If exponent is True, compute only the exponent, if it is False, evaluate the exponent. Use shape (y, x), pixel_size, energy, offset as (y, x), OpenCL command queue, out array, time t, check the sampling if check is True and wait for OpenCL kernels if block is True. Returned out array is different from the input one because of the pyopencl.clmath behavior.

syris.physics.wavelength_to_energy(wavelength)

Convert wavelength [m-like] to energy [eV].