Skip to content

Commit 78a7e24

Browse files
committed
add warning if laser init is too short
1 parent d72a0e3 commit 78a7e24

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
@@ -173,6 +174,10 @@ def get_as_pypicongpu(self) -> laser.GaussianLaser:
173174
/ (self.propagation_direction[1] * constants.c)
174175
/ self.duration) # unit: multiple of laser pulse duration
175176
# @todo extend this to other propagation directions than +y
177+
if pypicongpu_laser.pulse_init < 3.:
178+
logging.warning("set centroid_position and propagation_direction indicate that laser "
179+
+ "initalization might be too short.\n"
180+
+ f"Details: laser.pulse_init = {pypicongpu_laser.pulse_init} < 3")
176181

177182
pypicongpu_laser.polarization_type = self.picongpu_polarization_type
178183
pypicongpu_laser.polarization_direction = self.polarization_direction

0 commit comments

Comments
 (0)