Skip to content

Commit da112fb

Browse files
committed
add warning if laser init is too short
1 parent ee9fd6d commit da112fb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/python/picongpu/picmi/gaussian_laser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import typeguard
1515
import typing
16+
import logging
1617

1718

1819
@typeguard.typechecked
@@ -154,6 +155,10 @@ def get_as_pypicongpu(self) -> laser.GaussianLaser:
154155
/ (self.propagation_direction[1] * constants.c)
155156
/ self.duration) # unit: multiple of laser pulse duration
156157
# @todo extend this to other propagation directions than +y
158+
if pypicongpu_laser.pulse_init < 3.:
159+
logging.warning("set centroid_position and propagation_direction indicate that laser "
160+
+ "initalization might be too short.\n"
161+
+ f"Details: laser.pulse_init = {pypicongpu_laser.pulse_init} < 3")
157162

158163
pypicongpu_laser.polarization_type = self.picongpu_polarization_type
159164
pypicongpu_laser.polarization_direction = self.polarization_direction

0 commit comments

Comments
 (0)