Skip to content

Commit b840e21

Browse files
Remove default laser direction parameters (#82)
* remove default values for laser propagation direction and polarization; made laser antenna normal an optional parameter * Version 0.0.22 * also removed the defaults for laser focal and centroid positions This reverts commit 2dc473d. Co-authored-by: Roelof Groenewald <[email protected]>
1 parent dc2023e commit b840e21

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

PICMI_Python/lasers.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ class PICMI_GaussianLaser(_ClassWithInit):
4444
duration: float
4545
Duration of the Gaussian pulse [s], defined as :math:`\\tau` in the above formula
4646
47-
focal_position: vector of floats, default=[0,0,0]
48-
Position of the laser focus [m]
49-
50-
centroid_position: vector of floats, default=[0,0,0]
51-
Position of the laser centroid at time 0 [m]
52-
53-
propagation_direction: unit vector of floats, default=[0,0,1]
47+
propagation_direction: unit vector of floats
5448
Direction of propagation [1]
5549
56-
polarization_direction: unit vector of floats, default=[1,0,0]
50+
polarization_direction: unit vector of floats
5751
Direction of polarization [1]
5852
53+
focal_position: vector of floats
54+
Position of the laser focus [m]
55+
56+
centroid_position: vector of floats
57+
Position of the laser centroid at time 0 [m]
58+
5959
a0: float
6060
Normalized vector potential at focus
6161
Specify either a0 or E0 (E0 takes precedence).
@@ -83,10 +83,10 @@ class PICMI_GaussianLaser(_ClassWithInit):
8383
Optional name of the laser
8484
"""
8585
def __init__(self, wavelength, waist, duration,
86-
focal_position = [0., 0., 0.],
87-
centroid_position = [0., 0., 0.],
88-
propagation_direction = [0., 0., 1.],
89-
polarization_direction = [1., 0., 0.],
86+
propagation_direction,
87+
polarization_direction,
88+
focal_position,
89+
centroid_position,
9090
a0 = None,
9191
E0 = None,
9292
phi0 = None,
@@ -141,16 +141,16 @@ class PICMI_AnalyticLaser(_ClassWithInit):
141141
the full field, including the oscillitory component.
142142
Parameters can be used in the expression with the values given as keyword arguments.
143143
144-
propagation_direction: unit vector of floats, default=[0,0,1]
144+
wavelength: float
145+
Laser wavelength.
146+
This should be built into the expression, but some codes require a specified value for numerical purposes.
147+
148+
propagation_direction: unit vector of floats
145149
Direction of propagation [1]
146150
147-
polarization_direction: unit vector of floats, default=[1,0,0]
151+
polarization_direction: unit vector of floats
148152
Direction of polarization [1]
149153
150-
wavelength: float, optional
151-
Laser wavelength.
152-
This should be built into the expression, but some codes require a specified value for numerical purposes.
153-
154154
amax: float, optional
155155
Maximum normalized vector potential.
156156
Specify either amax or Emax (Emax takes precedence).
@@ -166,8 +166,8 @@ class PICMI_AnalyticLaser(_ClassWithInit):
166166
"""
167167
def __init__(self, field_expression,
168168
wavelength,
169-
propagation_direction = [0., 0., 1.],
170-
polarization_direction = [1., 0., 0.],
169+
propagation_direction,
170+
polarization_direction,
171171
amax = None,
172172
Emax = None,
173173
name = None,
@@ -221,10 +221,11 @@ class PICMI_LaserAntenna(_ClassWithInit):
221221
position: vector of strings
222222
Position of antenna launching the laser [m]
223223
224-
normal_vector: vector of strings
225-
Vector normal to antenna plane [1]
224+
normal_vector: vector of strings, optional
225+
Vector normal to antenna plane, defaults to the laser direction
226+
of propagation [1]
226227
"""
227-
def __init__(self, position, normal_vector, **kw):
228+
def __init__(self, position, normal_vector=None, **kw):
228229

229230
self.position = position
230231
self.normal_vector = normal_vector

0 commit comments

Comments
 (0)