def source(self): length = 10 * mm num_data = 1024 wavelength = self.lambda_light x0 = np.linspace(-length / 2, length / 2, num_data) y0 = np.linspace(-length / 2, length / 2, num_data) source = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) # source.plane_wave(phi=0 * degrees, theta=0 * degrees) source.gauss_beam(A=1, r0=(0 * um, 0 * um), z0=0, w0=(5 * mm, 5 * mm), phi=0 * degrees, theta=0 * degrees) return source
from diffractio.scalar_masks_XY import Scalar_mask_XY from diffractio.scalar_sources_XY import Scalar_source_XY from matplotlib import rcParams #rcParams['figure.figsize']=(12,10) #rcParams['figure.dpi']=400 num_pixels = 1024 #2048 length = 4000.0 * um x0 = np.linspace(-length / 2, length / 2, num_pixels) y0 = np.linspace(-length / 2, length / 2, num_pixels) wavelength = 0.5 * um u1 = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) #u1.plane_wave(A=1, theta=0 * degrees, phi=0 * degrees) source_length = length / 2 N_sources = 25 xs0 = np.linspace(-source_length / 2, source_length / 2, N_sources) ys0 = np.linspace(-source_length / 2, source_length / 2, N_sources) N_thetas = 5 N_phis = 3 NA = 0.01 thetas = np.linspace(0, 2 * np.pi, N_thetas) phis = np.linspace(0, NA, N_phis) t2 = Scalar_mask_XY(x=x0, y=y0, wavelength=wavelength)
from diffractio.scalar_masks_XY import Scalar_mask_XY from diffractio.scalar_sources_XY import Scalar_source_XY from matplotlib import rcParams rcParams['figure.figsize'] = (12, 10) rcParams['figure.dpi'] = 200 num_pixels = 512 length = 500 * um x0 = np.linspace(-length / 2, length / 2, num_pixels) y0 = np.linspace(-length / 2, length / 2, num_pixels) wavelength = 0.6238 * um u1 = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) u1.plane_wave(A=1, theta=0 * degrees, phi=30 * degrees) t1 = Scalar_mask_XY(x=x0, y=y0, wavelength=wavelength) t1.roughness(t=(0.2 * um, 0.2 * um), s=1 * um) ############################### u2 = u1 * t1 u2.draw(kind='phase') u3 = u2.RS(z=1 * mm, new_field=True) u4 = u2.RS(z=5 * mm, new_field=True) u5 = u2.RS(z=10 * mm, new_field=True) draw_several_fields((u3, u4, u5),
from matplotlib import rcParams rcParams['figure.figsize']=(12,10) rcParams['figure.dpi']=400 num_pixels = 1024#2048 length = 1000.0 * um x0 = np.linspace(-length / 2, length / 2, num_pixels) y0 = np.linspace(-length / 2, length / 2, num_pixels) wavelength = 0.5 * um u1 = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) u1.plane_wave(A=1, theta=0 * degrees, phi=0 * degrees) source_length = length/2 N_sources = 3 xs0 = np.linspace(-source_length / 2, source_length / 2, N_sources) ys0 = np.linspace(-source_length / 2, source_length / 2, N_sources) t1 = Scalar_mask_XY(x=x0, y=y0, wavelength=wavelength) t1.image(filename="pi.tif", invert=False) t2 = Scalar_mask_XY(x=x0, y=y0, wavelength=wavelength) t2.image(filename="ph.png", invert=False) r = 20 * um
from diffractio import nm, um, mm, cm, degrees from diffractio.scalar_sources_XY import Scalar_source_XY import numpy as np x0 = np.linspace(-1 * mm, 1 * mm, 100) y0 = np.linspace(-1 * mm, 1 * mm, 100) l1 = 589.6 * nm l2 = 589.6 * nm u1 = Scalar_source_XY(x=x0, y=y0, wavelength=l1, info='u1') u2 = Scalar_source_XY(x=x0, y=y0, wavelength=l2, info='u2') u1.gauss_beam(r0=(0, 0), w0=1 * mm, A=1, theta=0 * degrees, phi=0 * degrees) u2.plane_wave(A=1, z0=0, theta=90 * degrees, phi=100 * degrees) u_sum = u1 + u2 u_sum.draw(filename='air_wedge.png', has_colorbar='horizontal')
rcParams['figure.figsize'] = (12, 10) rcParams['figure.dpi'] = 200 # ## Slit # In[25]: num_pixels = 512 length = 100 * um x0 = np.linspace(-length / 2, length / 2, num_pixels) y0 = np.linspace(-length / 2, length / 2, num_pixels) wavelength = 0.6238 * um u1 = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) u1.plane_wave(A=1, theta=0 * degrees, phi=0 * degrees) # u1.laguerre_beam(p=2, l=1, r0=(0 * um, 0 * um), w0=7 * um, z=0.01 * um) t1 = Scalar_mask_XY(x=x0, y=y0, wavelength=wavelength) t1.slit(x0=0, size=10 * um, angle=0 * degrees) u2 = u1 * t1 u3 = u2.RS(z=25 * um, new_field=True) u4 = u2.RS(z=100 * um, new_field=True) draw_several_fields((u2, u3, u4), titulos=('mask', '25 um', '100 um')) # ## double slit
from pinholes_utils_drawing import draw_several_fields from pinholes import random_points_mask #rcParams['figure.figsize']=(12,10) #rcParams['figure.dpi']=400 num_pixels = 1024 #2048 length = 4000.0 * um x0 = np.linspace(-length / 2, length / 2, num_pixels) y0 = np.linspace(-length / 2, length / 2, num_pixels) wavelength = 0.5 * um u1 = Scalar_source_XY(x=x0, y=y0, wavelength=wavelength) #u1.plane_wave(A=1, theta=0 * degrees, phi=0 * degrees) step = 40 * um xs0 = np.linspace(-length / 2, length / 2, int(length / step)) ys0 = np.linspace(-length / 2, length / 2, int(length / step)) ratio = int(num_pixels / (length / step)) # N_thetas = 21 # N_phis = 7 # NA = 0.02 # thetas = np.linspace(0, 2* np.pi, N_thetas) # phis = np.linspace (0, NA, N_phis)