#: compute box dimensions NLAYERS, HEIGHT, WIDTH = 58, 96, 96 #: illumination wavelengths in nm WAVELENGTHS = np.linspace(380, 780, 9) #: create some experimental data (stack) optical_data = dtmm.nematic_droplet_data((NLAYERS, HEIGHT, WIDTH), radius=30, profile="r", no=1.5, ne=1.6, nhost=1.5) #optical_data[0][...]=1 #optical_data[1][0,...]=1 #optical_data[1][-1,...]=1 window = dtmm.aperture((96, 96), 0.95, 0.) window = None #: create non-polarized input light field_data_in = dtmm.illumination_data((HEIGHT, WIDTH), WAVELENGTHS, beta=0., pixelsize=PIXELSIZE, window=window) f, w, p = dtmm.transfer_field(field_data_in, optical_data, beta=0., phi=0., betamax=0.8, method="4x4", ret_bulk=True,
for i in range(size): if (i // period) % 2 == 0: out.append(n1**2) else: out.append(n2**2) return np.array(out) #e=e + 1j mod = (1 + 1 * np.sin(np.linspace(0, np.pi / 2048 * PIXELSIZE * WIDTH, WIDTH))**2) mod = eps_periodic() e[..., 2] = mod[None, None, :] window = dtmm.aperture((HEIGHT, WIDTH), 0.1, 1) #: create non-polarized input light field_data_in = dtmm.illumination_data((HEIGHT, WIDTH), WAVELENGTHS, jones=(1, 0), pixelsize=PIXELSIZE, window=window) #: transfer input light through stack f, w, p = dtmm.transfer_field(field_data_in, (d, e, a), betamax=np.inf, diffraction=1) ff = np.fft.fftshift(dtmm.fft.fft2(f), axes=(-2, -1)) i = dtmm.field2specter(ff) cmf = dtmm.load_tcmf(w)
"""EM field example""" import dtmm import numpy as np import matplotlib.pyplot as plt WAVELENGTHS = [500, 600] SIZE = (128, 128) window = dtmm.aperture((128, 128)) field_data = dtmm.illumination_data(SIZE, WAVELENGTHS, window=window, jones=(1, 0), pixelsize=200, beta=(0, 0.1, 0.2), phi=(0., 0., np.pi / 6)) field = field_data[0] #500nm Ex = field[:, 0, 0] #Ex of the x-polarized light subplots1 = [plt.subplot(i) for i in (231, 232, 233)] subplots2 = [plt.subplot(i) for i in (234, 235, 236)] for i, ax in enumerate(subplots1): ax.imshow(Ex[i].real, origin="lower")
import numpy as np #: pixel size in nm PIXELSIZE = 200 #: compute box dimensions NLAYERS, HEIGHT, WIDTH = 60, 96, 96 #: illumination wavelengths in nm WAVELENGTHS = np.linspace(380, 780, 9) #: create some experimental data (stack) optical_data = dtmm.nematic_droplet_data((NLAYERS, HEIGHT, WIDTH), radius=30, profile="r", no=1.5, ne=1.6, nhost=1.5) window = dtmm.aperture((96, 96)) #: create non-polarized input light field_data_in = dtmm.field.illumination_data((HEIGHT, WIDTH), WAVELENGTHS, pixelsize=PIXELSIZE) #: transfer input light through stack field_data_out = dtmm.transfer_field(field_data_in, optical_data) #: visualize output field viewer = dtmm.field_viewer(field_data_out) viewer.set_parameters(sample=0, intensity=2, polarizer=0, focus=-14, analyzer=90)