Laser
Defines a laser beam object with the important parameters to make the laser safety computations.
- class lasersafety.laser.LaserBeam(wavelength: float | int, repetition_rate: float | int, beam_diameter: float | int, average_power: float | int | None = None, peak_power: float | int | None = None, pulse_duration: float | int | None = None, pulse_energy: float | int | None = None, divergence: float | int | None = 0, distance: float | int = 0.1)
The LaserBeam object with the necessary parameters to make the laser safety computations.
The init method has four optional parameters: average_power, peak_power, pulse_duration, and pulse_energy. These four parameters are interconnected, and usually, two of them are enough to find the other two (unless the average power and pulse energy are given). Creating a laser beam with two few OR too many arguments (or only the average power and pulse energy), will result in a raised exception.
- Parameters:
wavelength (float | int) – wavelength of the light, in m.
repetition_rate (float | int) – repetition rate for pulsed lasers, in Hz. Set this value to 0 for a continuous laser.
beam_diameter (float | int) – beam diameter, in m.
average_power (Optional[float | int], optional) – average power, in W. This parameter may be omitted if the peak_power and pulse_duration or the pulse energy are given. This parameter may not be omitted for continuous lasers. Defaults to None.
peak_power (Optional[float | int], optional) – peak power, in W. This parameter may be omitted if the average_power and pulse_duration or the pulse_energy and pulse_duration are given. This parameter may be omitted for pulsed lasers. Defaults to None.
pulse_duration (Optional[float | int], optional) – pulse duration, in s. This parameter may be omitted if the average_power or the pulse_energy and pulse_duration are given. This parameter may be omitted for pulsed lasers. Defaults to None.
pulse_energy (Optional[float | int], optional) – pulse energy, in J. This parameter may be omitted if the peak_power and pulse_duration or average power are given. This parameter may be omitted for pulsed lasers. Defaults to None.
divergence (float | int, optional) – divergence, in rad. Defaults to 0.
distance (float | int, optional) – distance to consider for divergent beam, in m. Defaults to 10e-2.
- Raises:
ValueError – if the average power is omitted for a continuous laser.
- wavelength: float | int | None
Wavelength of the beam, in m.
- repetition_rate: float | int | None
Repetition rate of the laser, in Hz.
- base_beam_diameter: float | int | None
Base beam diameter, in m.
- beam_divergence: float | int | None
Beam divergence, in rad.
- distance: float | int | None
Distance to consider for divergent beam, in m.
- continuous: bool
True, if the laser is continuous, False if it is pulsed.
- average_power: float | int | None
Average power of the beam, in W.
- peak_power: float | int | None
Peak power for pulsed lasers, in W.
- pulse_duration: float | int | None
Pulse duration for pulsed lasers, in s.
- pulse_energy: float | int | None
Pulse energy for pulsed lasers, in J.
- _solve(repetition_rate: float | int, average_power: float | int | None = None, peak_power: float | int | None = None, pulse_duration: float | int | None = None, pulse_energy: float | int | None = None) Tuple[float | int, float | int, float | int, float | int]
Solve the laser parameters (from two parameters, find the other two). This first checks that exactly two parameters are given, and that this is not the (average_power, pulse_energy) case.
Then, it manually goes over the 5 cases and use the formulas, to return all the parameters.
- Parameters:
repetition_rate (float | int) – repetition rate, in Hz.
average_power (Optional[float | int], optional) – average power, in W. Defaults to None.
peak_power (Optional[float | int], optional) – peak power, in W. Defaults to None.
pulse_duration (Optional[float | int], optional) – pulse duration, in s. Defaults to None.
pulse_energy (Optional[float | int], optional) – pulse energy, J. Defaults to None.
- Raises:
ValueError – if stritcly more than 2 parameters are given.
ValueError – if strictly less than 2 parameters are given.
ValueError – if average_power and pulse_energy are the two given parameters.
- Returns:
the average power in W, the peak power in W, the pulse duration in s, the pulse energy in J.
- Return type:
Tuple[float | int, float | int, float | int, float | int]
- property beam_diameter: float
The beam diameter at the considered distance. If the divergence is 0, this is directly the beam diameter. Otherwise it is computed with
\(D(d) = D_{base} + 2d\tan(\theta)\)
where \(D(d)\) is the diameter at distance \(d\), \(D_{base}\) the base diameter and \(\theta\) the divergence.
- Returns:
the diameter, in m at the considered distance.
- Return type:
float
- property cross_section_area: float
The cross section area, computed as
\(\pi \left(\frac{D(d)}{2}\right)^2\)
where \(D(d)\) is the beam diameter at distance \(d\).
- Returns:
the cross section area, in m^2.
- Return type:
float
- property reference_number_pulses: float
The reference number of pulses used in the EN207 standard, which is the number of pulses in 10 s.
This is computed by multiplying the repetition rate in Hz by 10.
- Returns:
number of pulses in 10 s.
- Return type:
float
- property power_density: float
Power density in W per m^2.
This is computed by dividing the average power by the cross section area.
- Returns:
the average power density in W per m^2.
- Return type:
float
- property peak_power_density: float
The peak power density, in W per m^2.
This is computed by dividing the peak power by the cross section area.
- Returns:
the peak power density in W per m^2.
- Return type:
float
- property energy_density: float
The energy density, in J per m^2.
This is computed by dividing the pulse energy by the cross section area.
- Returns:
the energy density, in J per m^2.
- Return type:
float
- property corrected_energy_density: float
The corrected energty density, in J per m^2.
This is done by correcting the energy density byu multiplying it by the fourth root of the reference number of pulses.
Warning: this does not perform any check on wavelength.
- Returns:
the corrected energy density, in J per m^2.
- Return type:
float
- property mode: Mode
The mode of the laser, depending on the pulse duration.
- Returns:
the mode of the laser.
- Return type:
- en207_analysis() List[Tuple[Mode, int]]
Perform the EN207 analysis.
If the mode of the laser is M, it only performs the continuous scale analysis.
If the mode of the laser is anything but M, it perform both the continuous scale and pulsed scale analysis.
- Returns:
list of mode and scale number required for the mode.
- Return type:
List[Tuple[Mode, int]]
- en208_analysis() int
Perform the EN208 analysis.
Depending on the pulse duration, the continuous or pulsed computation used used.
- Returns:
scale number for EN208.
- Return type:
int