7. Drawing for vector paraxial fields

For vector fields, there are special drawings. Here we explain how to extract information from these drawings

[1]:
from diffractio import degrees, mm, nm, np, plt, sp, um
from diffractio.scalar_fields_XY import Scalar_field_XY
from diffractio.scalar_masks_XY import Scalar_mask_XY
from diffractio.scalar_sources_XY import Scalar_source_XY

from diffractio.vector_paraxial_masks_XY import Vector_paraxial_mask_XY
from diffractio.vector_paraxial_sources_XY import Vector_paraxial_source_XY

from diffractio.utils_drawing import concatenate_drawings, draw_several_fields
number of processors: 8
[2]:
from matplotlib import rcParams
rcParams['figure.figsize']=[8,6]
rcParams['figure.dpi']=125

8. Definition of a vector wave

[3]:
length = 500 * um
num_data = 256
wavelength = 0.6328 * um

x0 = np.linspace(-200*um, 200*um, 512)
y0 = np.linspace(-200*um, 200*um, 512)

u0=Scalar_source_XY(x0,y0,wavelength)
u0.gauss_beam(A=1, r0=(0,0), w0=(100*um,100*um))

EM = Vector_paraxial_source_XY(x0, y0, wavelength)
EM.azimuthal_wave(u=u0, r0=(0,0), radius=(200,200))
EM.RS(z=10*mm, new_field=False)

Ex,Ey,_=EM.get()

EM.reduce_matrix=''

8.1. Draw intensity

[4]:
#EM.__draw_intensity__();
EM.draw(kind='intensity');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_7_0.png
[5]:
#EM.__draw_intensities__();
EM.draw(kind='intensities');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_8_0.png

8.2. Draw phase

[6]:
#EM.__draw_phases__();
EM.draw(kind='phases');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_10_0.png

8.3. draw field

[7]:
#EM.__draw_field__();
EM.draw(kind='fields');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_12_0.png

8.4. Draw Stokes

[8]:
EM.draw(kind='stokes');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_14_0.png
[9]:
#EM.__draw_param_ellipse__();
EM.draw(kind='param_ellipse');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_15_0.png

8.5. Polarizations ellipses

[10]:
EM.__draw_ellipses__(
    logarithm=False,
    normalize=False,
    cut_value=False,
    num_ellipses=(30, 30),
    amplification=0.75,
    color_line='r',
    line_width=.5,
    draw_arrow=True,
    head_width=2,
    ax=False)
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_17_0.png

This polarizaation ellipses can also be drawn at any other drawing, provided that we have the axis associated to this drawing

[11]:
h1,h2=EM.draw(kind='intensities')
EM.__draw_ellipses__(
    logarithm=False,
    normalize=False,
    cut_value=False,
    num_ellipses=(30, 30),
    amplification=0.5,
    color_line='w',
    line_width=.5,
    draw_arrow=True,
    head_width=2,
    ax=h1)

EM.__draw_ellipses__(
    logarithm=False,
    normalize=False,
    cut_value=False,
    num_ellipses=(30, 30),
    amplification=0.5,
    color_line='y',
    line_width=.5,
    draw_arrow=True,
    head_width=2,
    ax=h2)
plt.tight_layout()
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_19_0.png

8.6. Other way

[12]:
x0 = np.linspace(-125 * um, 125 * um, 512)
y0 = np.linspace(-125 * um, 125 * um, 512)

wavelength = 0.6328 * um

Scalar source

[13]:
u0 = Scalar_source_XY(x0, y0, wavelength)
u0.gauss_beam(
    r0=(0, 0),
    w0=(100 * um, 100 * um),
    z0=0 * um,
    A=1,
    theta=0. * degrees,
    phi=0 * degrees)

Vector source

[14]:
EM = Vector_paraxial_source_XY(x0, y0, wavelength)
EM.radial_wave(u=u0, r0=(0,0), radius=(200,200))

If we need, we can convert the \(E_x\) and \(E_y\) fields in Scalar_field_XY.

[15]:
Ex,Ey,_=EM.get()
print(Ex)
Scalar_field_XY
 - x:  (512,),   y:  (512,),   u:  (512, 512)
 - xmin:       -125.00 um,  xmax:      125.00 um
 - ymin:       -125.00 um,  ymax:      125.00 um
 - Imin:       0.00,     Imax:      0.99
 - phase_min:  -180.00 deg, phase_max: 0.00 deg
 - wavelength: 0.63 um
 - date:       2021-05-09_18_07_26
 - info:

We can obtain a variety of representation, simply using the draw method.

[16]:
EM.draw(kind='ellipses')
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_29_0.png
[17]:
EM.draw(kind='fields');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_30_0.png

Polarimetric representation can be performed in a simple way.

[18]:
EM.draw('stokes');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_32_0.png
[19]:
EM.draw('param_ellipse');
../../../_images/source_tutorial_vector_paraxial_XY_tutorial_vector_paraxial_XY_draw_33_0.png