Initial Field
InitialField
Represents an object with various parameters for a beam of light.
Initializes an object with various parameters for a beam of light.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
beam_width |
float
|
The beam width parameter represents the width of the beam. It determines the spread of the beam and is typically measured as the full width at half maximum (FWHM) of the beam intensity distribution. |
required |
focal_point |
tuple
|
The focal point is the point in space where the beam is focused. It is a coordinate in three-dimensional space (x, y, z) that represents the position of the focal point. |
required |
field_type |
str
|
The |
'gaussian'
|
amplitude |
float
|
The amplitude parameter represents the maximum value or intensity of the beam. It determines the overall strength or power of the beam. Defaults to 1. |
1
|
polar_angle |
float
|
The |
0
|
azimuthal_angle |
float
|
The azimuthal angle is a measure of the angle between the projection of the vector onto the xy-plane and the positive x-axis. It determines the orientation of the beam in the xy-plane. Defaults to 0. |
0
|
polarization |
str
|
The "polarization" parameter determines the polarization of the beam. It can have two possible values: "TE" for transverse electric polarization and "TM" for transverse magnetic polarization. Defaults to "TE". |
'TE'
|
Source code in yasfpy/initial_field.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
field_type = field_type
instance-attribute
amplitude = amplitude
instance-attribute
polar_angle = polar_angle
instance-attribute
azimuthal_angle = azimuthal_angle
instance-attribute
polarization = polarization
instance-attribute
beam_width = beam_width
instance-attribute
focal_point = focal_point
instance-attribute
log = log.scattering_logger(__name__)
instance-attribute
__set_pol_idx
Sets the polarization index based on the polarization type.
The polarization index is determined based on the value of the polarization
attribute.
If the polarization
is "unp" or 0, the polarization index is set to 0.
If the polarization
is "te" or 1, the polarization index is set to 1.
If the polarization
is "tm" or 2, the polarization index is set to 2.
If the polarization
is not a valid value, the polarization index is set to 0 and a warning message is logged.
Source code in yasfpy/initial_field.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
__set_normal_incidence
Sets the normal incidence flag based on the polar angle.
This method checks the value of the polar angle and determines if it is close to zero. If the absolute value of the sine of the polar angle is less than 1e-5, the normal incidence flag is set to True. Otherwise, the normal incidence flag is set to False.
Source code in yasfpy/initial_field.py
81 82 83 84 85 86 87 88 89 |
|
__setup
Performs the initial setup of the field.
This method sets the polarization index and normal incidence for the field.
Source code in yasfpy/initial_field.py
91 92 93 94 95 96 97 98 |
|